-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: To call oracle functon having out parameter & returns nu
PostPosted: Thu Mar 29, 2007 4:29 am 
Newbie

Joined: Sat Mar 24, 2007 8:14 am
Posts: 15
procedure is as below:
CREATE OR REPLACE function selectallfromtest (User_cv OUT SYS_REFCURSOR)
return number
is
ya number;
bEGIN
OPEN User_cv FOR
SELECT * FROM test;
ya := 10;
return ya;
End selectallfromtest ;

java code:
query = ses.getNamedQuery(qId);
List l = query.list();

.hbm.xml file entry is as below :-
<sql-query name="selectallfromtest" callable="true">
{ ? := call selectallfromtest(?)}
</sql-query>

Exception caught:
org.hibernate.QueryException: Not all named parameters have been set: [] [{ ? := call USER_pref_NEW(?)}]
at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:284)
at org.hibernate.impl.SQLQueryImpl.verifyParameters(SQLQueryImpl.java:220)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:159)
at com.iflex.fcr.dataSelect.DynamicQueryController.setResultset(DynamicQueryController.java:57)
at com.iflex.fcr.dataSelect.DynamicQueryController.fetchRecords(DynamicQueryController.java:24)
at com.iflex.fcr.dataSelect.TestDataselect.main(TestDataselect.java:35)
java.lang.NullPointerException
at com.iflex.fcr.dataSelect.TestDataselect.main(TestDataselect.java:38)


so my questin is:

how to call a oracle function given above which is havin out as function parameter and returns any value?

help me abt this plz , its urgent........

Thanks and Regards,

Shethap.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.