This is an Oracle generated message and it's telling you rather clearly that your procedure cannot be found.
--- Cause: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'GET_KEY_2' is not a procedure or is undefined
ORA-06550: line 1, column 7:
 
One thing that I would suggest is that while the procedure might exist within your schema it might not be valid, meaning that it might contain errors. Please look to see if the procedure has errors. If it does then Oracle will tell you that it does not exist and that is because it is not valid.
 
There are only a few possibilities here:
  • The procedure does not exist
  • The procedure exists but is not contained within the package/schema that you are specifying.
  • The procedure exists but is invalid due to compilation errors.
This is clearly not a problem with iBatis or with the way that the procedure is being call. This is simply an issue within the Oracle schema that you are using.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 03, 2006 3:56 AM
To: [email protected]
Subject: Re: Stored procedures (package functions) returning a row

The log generated by log4j confirms that the PreparedStatement is correctly prepared

DEBUG [main] - Created connection 22664464.
DEBUG [main] - {conn-100000} Connection
DEBUG [main] - {pstm-100001} PreparedStatement: {call ut_Tipo_Dato.ut_setup}
DEBUG [main] - {pstm-100001} Parameters: []
DEBUG [main] - {pstm-100001} Types: []
DEBUG [main] - Returned connection 22664464 to pool.
DEBUG [main] - Checked out connection 22664464 from pool.
DEBUG [main] - {conn-100002} Connection
DEBUG [main] - {pstm-100003} PreparedStatement: {call ut_Tipo_dato.get_key_2}
DEBUG [main] - {pstm-100003} Parameters: []
DEBUG [main] - {pstm-100003} Types: []
DEBUG [main] - Returned connection 22664464 to pool.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in it/finmatica/gpj/aa/frontebd/DizionarioTipiDatoTest.xml.
--- The error occurred while applying a parameter map.
--- Check the get_key_2-InlineParameterMap.
--- Check the statement (update procedure failed).
--- Cause: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'GET_KEY_2' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Caused by: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00221: 'GET_KEY_2' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
[...]


Something is wrong on the stored code? It wouldn't seem.... A mini test harness written on-th-gfly runs correctly.
The Oracle diagnostic does not mention 'UT_TIPO_DATO.GET_KEY_2' (instead it reports 'GET_KEY_2' without mentioning its package)

Why does the diagnostic refer a parameterMap / the inline parameter of get_key_2?
--- The error occurred while applying a parameter map.
--- Check the get_key_2-InlineParameterMap.

The XML config file does NOT mention any parameter

<resultMap id="mapChiave" class="it.finmatica.gpj.aa.frontebd.ChiaveBean">
<result property="id" column="TIPO_DATO_ID"/>
</resultMap>

<procedure id="get_key_2" resultMap="mapChiave">
{call ut_Tipo_dato.get_key_2}
</procedure>

If, I've understood well the Jeff's suggestions
http://opensource.atlassian.com/confluence/oss/pages/diffpages.action?pageId=39&originalId=5835
a call to queryForObject is suitable when you get only one object as result.

What is wrong?
I'm confused.

Reply via email to