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 zh...@umich.edu on 2005/05/08 16:52:34 UTC
call procedure with SQL Server
I have following map settings:
<parameterMap id="procedure_1_Result" class="Map">
<parameter property="P_EMPNO" javaType="java.lang.String"
jdbcType="VARCHAR" mode="OUT"/>
</parameterMap>
<procedure id="my_table_seq_nextval" parameterMap="procedure_1_Result">
{call my_table_seq_nextval(?)}
</procedure>
And Java code is:
public String call_mssql_procedure()
{
Map map_param = new HashMap(1);
getSqlMapClientTemplate().insert(
"my_table_seq_nextval", map_param);
return ((String)map_param.get("P_EMPNO"));
}
Bu I go the following errors:
[java] org.springframework.jdbc.BadSqlGrammarException: Bad SQL grammar [(m
apped statement)] in task 'SqlMapClientTemplate'; nested exception is com.ibatis
.common.jdbc.exception.NestedSQLException:
[java] --- The error occurred in ibatis_map/AccessDB.xml.
[java] --- The error occurred while applying a parameter map.
[java] --- Check the accessdb.procedure_1_Result.
[java] --- Check the statement (update procedure failed).
[java] --- Cause: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver
for JDBC][SQLServer]Invalid object name 'sq_1'.
Any help?
-Henry