ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject RE: Stored procedures (package functions) returning a row
Date Tue, 03 Oct 2006 15:22:09 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META inline Content-Disposition: 
Boundary="0__=4EBBFB6FDFAA27028f9e8a93df938690918c4EBBFB6FDFAA2702" alternative; 
multipart Content-type:>
<META http-equiv=Content-Type content="text/html; charset=us-ascii" inline 
Content-Disposition: Content-type: 
--0__="4EBBFB6FDFAA27028f9e8a93df938690918c4EBBFB6FDFAA2702" html; text 
quoted-printable Content-Transfer-Encoding:>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=903321715-03102006><FONT color=#0000ff

size=2>This is an Oracle generated message and it's telling you rather clearly 
that your procedure cannot be found.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=903321715-03102006><FONT 
face="Courier New"><FONT color=#ff0000>--- Cause: </FONT><U><FONT

color=#000080>java.sql.SQLException</FONT></U><FONT color=#ff0000>: ORA-06550:

line 1, column 7:</FONT></FONT><BR><FONT face="Courier New" 
color=#ff0000>PLS-00221: 'GET_KEY_2' is not a procedure or is 
undefined</FONT><BR><FONT face="Courier New" color=#ff0000>ORA-06550: line
1, 
column 7:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=903321715-03102006><FONT face="Courier
New" 
color=#ff0000></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=903321715-03102006><FONT face="Courier
New" 
color=#ff0000><SPAN class=903321715-03102006><FONT color=#0000ff size=2>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.</FONT></SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=903321715-03102006><FONT face="Courier
New" 
color=#0000ff size=2><SPAN 
class=903321715-03102006></SPAN></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=903321715-03102006><FONT face="Courier
New" 
color=#0000ff size=2><SPAN class=903321715-03102006>There are only a few 
possibilities here:</SPAN></FONT></SPAN></DIV>
<UL dir=ltr>
  <LI>
  <DIV align=left><SPAN class=903321715-03102006><FONT face="Courier New" 
  color=#0000ff size=2><SPAN class=903321715-03102006>The procedure does not 
  exist</SPAN></FONT></SPAN></DIV></LI>
  <LI>
  <DIV align=left><SPAN class=903321715-03102006><FONT face="Courier New" 
  color=#0000ff size=2><SPAN class=903321715-03102006>The procedure exists but 
  is not contained within the package/schema that you are 
  specifying.</SPAN></FONT></SPAN></DIV></LI>
  <LI>
  <DIV align=left><SPAN class=903321715-03102006><FONT face="Courier New" 
  color=#0000ff size=2><SPAN class=903321715-03102006>The procedure exists but 
  is invalid due to compilation errors.</SPAN></FONT></SPAN></DIV></LI></UL>
<DIV><SPAN class=903321715-03102006></SPAN><FONT face="Courier New"><FONT

color=#0000ff><FONT 
size=2>This&nbsp;is&nbsp;clearly&nbsp;not&nbsp;a&nbsp;problem&nbsp;with&nbsp;iBatis&nbsp;or&nbsp;with&nbsp;the&nbsp;way&nbsp;that&nbsp;the&nbsp;procedure&nbsp;is&nbsp;being&nbsp;call.&nbsp;This&nbsp;is&nbsp;simply&nbsp;an&nbsp;issue&nbsp;within&nbsp;the&nbsp;Oracle&nbsp;schema&nbsp;that&nbsp;you&nbsp;are&nbsp;using.</FONT></FONT></FONT></DIV>
<DIV><FONT face="Courier New"><FONT color=#0000ff><FONT size=2><SPAN

class=903321715-03102006></SPAN></FONT></FONT></FONT><BR>&nbsp;</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> C.Zecca@ads.it [mailto:C.Zecca@ads.it]

<BR><B>Sent:</B> Tuesday, October 03, 2006 3:56 AM<BR><B>To:</B>

user-java@ibatis.apache.org<BR><B>Subject:</B> Re: Stored procedures (package

functions) returning a row<BR></FONT><BR></DIV>
<DIV></DIV>
<P>The log generated by log4j confirms that the PreparedStatement is correctly 
prepared<BR><BR><FONT face="Courier New">DEBUG [main] - Created connection

22664464.</FONT><BR><FONT face="Courier New">DEBUG [main] - {conn-100000}

Connection</FONT><BR><FONT face="Courier New">DEBUG [main] - {pstm-100001}

PreparedStatement: {call ut_Tipo_Dato.ut_setup}</FONT><BR><FONT 
face="Courier New">DEBUG [main] - {pstm-100001} Parameters: []</FONT><BR><FONT

face="Courier New">DEBUG [main] - {pstm-100001} Types: []</FONT><BR><FONT

face="Courier New">DEBUG [main] - Returned connection 22664464 to 
pool.</FONT><BR><FONT face="Courier New">DEBUG [main] - Checked out connection

22664464 from pool.</FONT><BR><FONT face="Courier New">DEBUG [main] - 
{conn-100002} Connection</FONT><BR><FONT face="Courier New">DEBUG [main]
- 
{pstm-100003} PreparedStatement: {call </FONT><B><FONT 
face="Courier New">ut_Tipo_dato.get_key_2</FONT></B><FONT 
face="Courier New">}</FONT><BR><FONT face="Courier New">DEBUG [main]
- 
{pstm-100003} Parameters: []</FONT><BR><FONT face="Courier New">DEBUG [main]
- 
{pstm-100003} Types: []</FONT><BR><FONT face="Courier New">DEBUG [main]
- 
Returned connection 22664464 to pool.</FONT><BR><U><FONT face="Courier
New" 
color=#000080>com.ibatis.common.jdbc.exception.NestedSQLException</FONT></U><FONT

face="Courier New" color=#ff0000>: </FONT><BR><FONT face="Courier New" 
color=#ff0000>--- The error occurred in 
it/finmatica/gpj/aa/frontebd/DizionarioTipiDatoTest.xml. </FONT><BR><FONT 
face="Courier New" color=#ff0000>--- The error occurred while applying a 
parameter map. </FONT><BR><FONT face="Courier New" color=#ff0000>--- Check
the 
get_key_2-InlineParameterMap. </FONT><BR><FONT face="Courier New" 
color=#ff0000>--- Check the statement (update procedure failed). 
</FONT><BR><FONT face="Courier New" color=#ff0000>--- Cause: </FONT><U><FONT

face="Courier New" color=#000080>java.sql.SQLException</FONT></U><FONT 
face="Courier New" color=#ff0000>: ORA-06550: line 1, column 7:</FONT><BR><FONT

face="Courier New" color=#ff0000>PLS-00221: 'GET_KEY_2' is not a procedure or is 
undefined</FONT><BR><FONT face="Courier New" color=#ff0000>ORA-06550: line
1, 
column 7:</FONT><BR><FONT face="Courier New" color=#ff0000>PL/SQL: Statement

ignored</FONT><BR><BR><FONT face="Courier New" color=#ff0000>Caused
by: 
</FONT><U><FONT face="Courier New" 
color=#000080>java.sql.SQLException</FONT></U><FONT face="Courier New" 
color=#ff0000>: ORA-06550: line 1, column 7:</FONT><BR><FONT face="Courier
New" 
color=#ff0000>PLS-00221: 'GET_KEY_2' is not a procedure or is 
undefined</FONT><BR><FONT face="Courier New" color=#ff0000>ORA-06550: line
1, 
column 7:</FONT><BR><FONT face="Courier New" color=#ff0000>PL/SQL: Statement

ignored</FONT><BR><BR><FONT face="Courier New" color=#ff0000>at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(</FONT><U><FONT

face="Courier New" color=#000080>GeneralStatement.java:185</FONT></U><FONT

face="Courier New" color=#ff0000>)</FONT><BR><FONT face="Courier New" 
color=#ff0000>at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(</FONT><U><FONT

face="Courier New" color=#000080>GeneralStatement.java:104</FONT></U><FONT

face="Courier New" color=#ff0000>)</FONT><BR><FONT face="Courier New" 
color=#ff0000>[...]</FONT><BR><BR><BR>Something is wrong on the
stored code? It 
wouldn't seem.... A mini test harness written on-th-gfly runs correctly.<BR>The 
Oracle diagnostic does not mention 'UT_TIPO_DATO.GET_KEY_2' (instead it reports 
'GET_KEY_2' without mentioning its package)<BR><BR>Why does the diagnostic refer

a parameterMap / the inline parameter of get_key_2?<BR><FONT face="Courier New" 
color=#ff0000 size=2>--- The error occurred while applying a parameter map. 
</FONT><BR><FONT face="Courier New" color=#ff0000 size=2>--- Check the 
get_key_2-InlineParameterMap. </FONT><BR><BR>The XML config file does NOT

mention any parameter<BR><BR><FONT face="Courier New">&lt;resultMap

id="mapChiave" 
class="it.finmatica.gpj.aa.frontebd.ChiaveBean"&gt;</FONT><BR><FONT 
face="Courier New">&lt;result property="id" 
column="TIPO_DATO_ID"/&gt;</FONT><BR><FONT 
face="Courier New">&lt;/resultMap&gt;</FONT><BR><FONT 
face="Courier New"></FONT><BR><FONT face="Courier New">&lt;procedure

id="get_key_2" resultMap="mapChiave"&gt;</FONT><BR><FONT 
face="Courier New">{call ut_Tipo_dato.get_key_2}</FONT><BR><FONT 
face="Courier New">&lt;/procedure&gt;</FONT><BR><BR>If, I've
understood well the 
Jeff's suggestions<BR><A 
href="http://opensource.atlassian.com/confluence/oss/pages/diffpages.action?pageId=39&amp;originalId=5835">http://opensource.atlassian.com/confluence/oss/pages/diffpages.action?pageId=39&amp;originalId=5835</A><BR>a

call to queryForObject is suitable when you get <U>only one</U> object as 
result.<BR><BR>What is wrong?<BR>I'm confused. </P></BODY></HTML>


Mime
View raw message