You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Robert Dare <rd...@comerxia.com> on 2004/12/06 16:37:58 UTC

SQL With Oracle Functions:

I have tried many variations of the following SQL,
and each time I get an "Invalid column name" exception.

<select id="getMyData"
        parameterClass="java.lang.String"
        resultClass="MyCustomClass">
    <![CDATA[
        select 
              PO.ORDER_ID , 
              to_char(PO.DATE_CREATED, 'yyyy-mm-dd HH24:mi:ss') , 
        FROM
              MY_PO_TABLE PO
        WHERE
              PO.ORDER_ID=#value#
    ]]>
</select>

This query works when run from JDBC, using PreparedStatement
and accessing the ResultSet via a rs.getString("PO.DATE_CREATED");

I am using Oracle 8i, iBATIS 2.0.8 and Tomcat 5.0.28.

I couldn't find anything about this in the iBATIS docs or 
in Google.

Thanks!

Rob.