ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Janon <fja...@yahoo.com>
Subject How to use a function on a parameter in an "update" mapped statement?
Date Sat, 08 Jul 2006 07:12:02 GMT

I want to convert a string containing a date in the format dd/month/year 
into a mySQL date format (YYYY/mm/dd) in an update statement. I tried:

  <mapped-statement name="saveJob">
    update jobs
        set clientid=#clientId#, summary=#summary#, jobduedate=str_to_date(#dueDate#, '%d/%m/%Y')
            where jobid=#id#

but it doesn't work or even generate an error, it jut stores 0000/00/00 
in the my SQL DB. I enabled DEBUG on SQL statements and  apparently the 
generated statement by iBatis is:

PreparedStatement: update jobs      set clientid=?, summary=?, jobduedate=?    where jobid=?
Parameters: [2, Yellow banner 7, 10/10/2000, 3]

No sign of my function call at all.

Is there a way to get my function call working?



View raw message