It seems that this stored procedure has a multi-result set result. The version 
of iBatis we are currently using doesn't work with such procedure, but I see 
the latest release supports this functionnality.

Time to update our version of iBatis !

Cyril

----- Message d'origine ----
De : Cyril <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Lundi, 18 Septembre 2006, 6h02mn 31s
Objet : Problem when executing stored procedure "Incorrect syntax near the 
keyword"

Hi!

I'm migrating an application from an internal JDBC framework to iBatis. 
Currently, a lot of the business work is done in stored procedure, so I just 
need to call the stored procedures from DAO with iBatis.

Until now, I hadn't any major issue, but when calling a particular stored 
procedure, I was stucked with an SQLException with my sqlMap.queryForList.  The 
exception is:

com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near the keyword 'from'.

(my data base is Sybase)

It doesn't look an iBatis problem, but when I call the same procedure with the 
same parameters from JDBC  or from my SQL client, everything is ok.

My iBatis sql map file contains:


<resultMap id="deliveryDetailResult" 
class="com.calyon.ccc.ibatis.pojo.DeliveryUtilizationLineFromDatabase">
        <result property="id" column="Id"/>
        <result property="amount" column="Utilisation"/>
        <result property="keyName" column="KeyName"/>
        <result property="authorizationId" column="KeyValue"/>
        <result property="utilizationDate" column="Date"/>
</resultMap>

<procedure id="getDetailedDeliveryUtilizations2" 
resultMap="deliveryDetailResult">
        <![CDATA[
            {call CCCGetDeliveryUtilization("TODAY", "Profile", "Client", 
"1234567890", "All", "N")}
        ]]>
</procedure>


It's just a procedure call, there is no "from" in it. Since I can call the 
stored procedure with these parameters from JDBC or SQL client, I assume there 
is also no problem in the stored procedure (which contains "from").

My DAO looks like:
List result = null;
try {
      result = sqlMap.queryForList("getDetailedDeliveryUtilizations2", new 
ArrayList());
} catch (SQLException sqle) {
       LOGGER.error("SQLException " + sqle.getMessage(), sqle);
}

Since I traced with the debugger quite deep in iBatis, I can't understand the 
problem. It should not come from iBatis, but does somebody have an idea?

Thanks,
Cyril Gambis






Reply via email to