-->
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: what cls specified when stored proc only returns a number
PostPosted: Wed Dec 01, 2010 1:28 pm 
Newbie

Joined: Wed Dec 01, 2010 1:25 pm
Posts: 2
Hi all
i have a named query declared as follows

Code:
<sql-query name="GetCurrentSubjectId_SP" callable="true">
        {? = call GetCurrentSubjectId() }
   </sql-query>



GetCurrentSubjectId is a stored procedure which needs no parameters and returns only a number.

so what return class i need to specify here?

here is how I execute the named query:

Code:
Query query=session.getNamedQuery("GetCurrentSubjectId_SP");
         long id=(Long)query.uniqueResult();



but i get this error. Obviously, i need to specify the return type. but how?

Code:
11:09:39,233 ERROR [http-8080-1] JDBCExceptionReporter:234 - ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Caused by: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored



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.