-->
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: invalid sql stmt calling oracle stored function with annot
PostPosted: Fri Mar 28, 2008 5:25 pm 
Newbie

Joined: Wed Dec 17, 2003 1:57 pm
Posts: 4
I'm having problems trying to call an Oracle 10g stored function that returns a result set (via sys_refcursor) from the NamedNativeQuery annotation.

I get this error:
Caused by: java.sql.SQLException: ORA-00900: invalid SQL statement


Here's the annotation:
@NamedNativeQuery(name = "MyQuery", callable = true,
query = "{? = call MYSCHEMA.MY_FUNCTION(:purgeDate)}",
readOnly = true, resultClass = QueryResultDTO.class)


Here's the logging:
DEBUG org.hibernate.SQL -
/* named native SQL query MyQuery*/ {? = call MYSCHEMA.MY_FUNCTION(?)}
33281 [http-8080-2] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 900, SQLState: 42000
33281 [http-8080-2] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00900: invalid SQL statement

What's the problem?


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.