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 M V Chetan <ch...@tcs.com> on 2009/08/21 18:18:28 UTC
Problem calling Stored function in Oracle
Hi,
I'm facing certain problems in getting my ibatis mapping to work with an
oracle stored function
Here is my mapping
http://www.nabble.com/file/p25082929/query1.jpg
{ ? = call PKG_SEARCH_LIST.F_COMPANY_LIST(?,?,?,?,?,?,?,?) }
The error that I get is
PLS-00306: wrong number or types of arguments in call to 'F_COMPANY_LIST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
The stored function is as follows
CREATE OR REPLACE
PACKAGE BODY PKG_SEARCH_LIST
AS
FUNCTION F_COMPANY_LIST(p_Company varchar2,p_EntFromDt date, p_EntToDt date,
p_LstModFromdt date, P_LstModToDt date, p_TransStatus varchar2, p_sort
varchar2, p_QueryType varchar2)
RETURN pkg_crs_util.ref_cursor
IS
ret_cursor pkg_crs_util.ref_cursor;
BEGIN
OPEN ret_cursor for select 1 parent_flg, 'Company1'company, null
active_status ,null role, null security, null Deal_Fr_Dt, null Deal_To_Dt,
null Deal_Title, null Deal_type from dual
union
select 0 parent_flg , 'Company1' company, 'Y' active_status ,1 role, 'xyz'
security, sysdate Deal_Fr_Dt, sysdate Deal_To_Dt, 'Mydeal'
Deal_Title,'Financing' Deal_type from dual
order by parent_flg desc ;
RETURN ret_cursor;
END;
END PKG_SEARCH_LIST;
Can someone please point out where I am going wrong?
Regards,
Chetan
--
View this message in context: http://www.nabble.com/Problem-calling-Stored-function-in-Oracle-tp25082929p25082929.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Problem calling Stored function in Oracle
Posted by M V Chetan <ch...@tcs.com>.
Thanks.It was indeed the ordering/sequencing that was the mistake here.I
moved it from the last to the top/first and then it started working.
Thanks very much.
Regards,
Chetan
Though I've never used oraclecursor with iBatis, I'll dare to note that
from the image attached I see that parametermap property for the
ORALECURSOR is the last one in the map.
But it must be the first one (order parameter map properties must match
order of ?,?... ).
--
View this message in context: http://www.nabble.com/Problem-calling-Stored-function-in-Oracle-tp25082929p25116009.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org