This is the whole updatestatement. It is in dutch so don't get confused.

The 2 lines where it goes wrong are the line *SET keuze = ......* and the
line *SET actief = ......*
Both are of the type Bit in the database and of the Bool in my C# class.

*keuze = choice* in English and *actief = active* in English.

Hope someone can help me with my problem.

    <update id="UpdateRelated" parameterClass="Curriculum">
      UPDATE curriculum_onderwijseenheid
      <iterate property="Onderwijseenheden">
        <iterate property="Onderwijseenheden[0].Profielen">
          SET keuze = #Onderwijseenheden[0].Profielen[0].Keuze:Bit#
          SET gewijzigd = #Gewijzigd#
          SET actief = #Actief:Bit#
          WHERE curriculum = #Id#
          AND onderwijseenheid = #Onderwijseenheden[0].Id#
          AND profiel = #Onderwijseenheden[0].Profielen[0].Id#
        </iterate>
      </iterate>
    </update>

2009/6/3 Sal Bass <salbass...@hotmail.com>

>
> I map bools to bits in SQL server all the time without issue. Can you post
> the complete mapping statement?
>
>
> ________________________________
> > Date: Wed, 3 Jun 2009 16:13:49 +0200
> > Subject: Exception on Update
> > From: marco.frans...@gmail.com
> > To: user-cs@ibatis.apache.org
> >
> > Hello,
> >
> > I get the following exception when executing an update statement.
> >
> > Wrong value near '='
> >
> > I found out that it has to do with the bool value of mij object that wont
> be converted to the bit value in mij sqlserver database.
> >
> >
> > In my update I tried the following:
> >
> > SET active = #Active#
> >
> > I also tried the following
> >
> > SET active = #Active:Bit#
> >
> >
> > Both won't work I run Ibatis version 1.6.1
> >
> > When I remove this line and I just do not set the active field the query
> works, so thats why I am realy sure it has to do with this line. Is there
> someone who knows how to tackle this problem.
> >
> > --
> > Kindly regards,
> >
> > Marco Franssen
> >
> _________________________________________________________________
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290




-- 
Met vriendelijke groet,

Marco Franssen

Reply via email to