Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Call Strored Procedure in Hibernate

  Asked By: Ronnie    Date: Feb 20    Category: Java    Views: 1531
  

I have problem to call Stored Procedure in Hiberbnate.(the stored procedure define in oracle9i).
I write a stored procedure named "CONCAT_STR" that get two string as parameter and concat them and return the string.
Now I write as following statement in hbm file:


<sql-query name="callStore" callable="ture">
<return alias="callST" class="com.Store"/>
{ ? = call CONCAT_STR( :fName , :lName ) }
</sql-query>

Store Class already define for hibernate.

I Call this query as following statement:

Query query = inernateSession.getNameQuery( "callStore" );
query.setString( "fName" , "Alireza");
query.setString( "lName" , "Sahlolbey");

List list = query.list();

After run this I get following Error:

Hibernate : { ? = call CONCATR_STR( ? , ? )}
...
...
PLS-00382: expression is of wrong type
ORA-06550: Line 1 , column 7:
PL/SQL: Statement ignored

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Call Strored Procedure in Hibernate Or get search suggestion and latest updates.




Tagged: