ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: problem with <dynamic>
Date Thu, 26 Jan 2006 22:59:21 GMT
I think there's a fundamental problem here....

What you're generating is in no way a valid SQL statement.  Maybe this is
a copy/paste error?  Looks like the words "insert into" got put on the front
of an old update statement.

Jeff Butler

On 1/26/06, Wible, Thomas E <Thomas.E.Wible@mdnt.com> wrote:
> i've inherited a mySQL db using a tomcat web-frontend and ibatis sqlmaps
> (the original db designer has since left, natch)-:
> and have picked up the dialect ok until now:
> i've added a new column to an existing table, added all the supporting
> java data object code (it retrieves data i've poked into the column just
> fine) but it barfs on the following sqlmap:
>     <insert id="insertsql" parameterClass="myclass">
>         insert into mytable set lastchangedate = NOW()
>         <dynamic>
>             <isNotEmpty prepend="," property="oldcolumnvalue">
> `oldcolumnname` = $oldcolumnvalue$
>             </isNotEmpty>
>            <isNotEmpty prepend="," property="newcolumnvalue">
>                 `newcolumnname` = $newcolumnvalue$
>             </isNotEmpty>
>        </dynamic>
>     </insert>
> and i get the following java.sql.SQLexception:
>     column not found, msg from server: unknown column 'newcolumnvalue'  in
> 'field list'
> somehow the newcolumnvalue is being seen as the newcolumnname...wtf??? the
> new code is cut&pasted from existing(and working, until the mods) code...and
> i've been unsuccessful in getting log4j debug output (java.sql?)to work...
> can i buy a clue, please?
> thanx
> tom

View raw message