-->
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: Problem with calling stored procedures:Hibernate 3.2.4.sp1
PostPosted: Mon Jun 18, 2007 12:16 am 
Newbie

Joined: Sun Jun 17, 2007 11:54 pm
Posts: 1
Hibernate version: 3.2.4.sp1

Name and version of the database you are using: Oracle 10g

Hi,

I am facing problems with calling stored procedures.

The stored proc heading line:
create or replace PROCEDURE USERALERT( p_cur OUT sys_refcursor);

The Alert data model:
@NamedNativeQuery(name="testuserAlert", callable=true, query = "{?=call USERALERT(:param1)}", resultSetMapping="result")
@SqlResultSetMapping( name="result", entities=@EntityResult( entityClass=com.abc.model.Alert.class,
fields={ @FieldResult( name="alertId", column="alertId" ),
@FieldResult( name="userId", column="userId" ),
@FieldResult( name="time", column="time" )} ) )
public class Alert {
protected Long alertId;
protected Long userId;
protected Date time;


The query constructed to use the same:

Query query = entityManager.createNamedQuery("testuserAlert");
query.setParameter("param1", null);
return query.getResultList();

The exception that it throws is:

java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00222: no function with name 'USERALERT' exists in this scope
ORA-06550: line 1, column 7:

When i call functions, it works perfectly fine.
But when i want to call the stored proc, it says:
no functionwith name 'USERALERT' exists in this scope

Why is it only looking for functions even if i m calling a stored proc. Have i missed out anything very basic?

Any help will be truly appreciated

Thanks


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.