-->
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.  [ 2 posts ] 
Author Message
 Post subject: Oracle Cursor Expressions (Cursor subqueries)
PostPosted: Sun Aug 30, 2009 11:21 am 
Newbie

Joined: Thu Jan 29, 2009 10:03 am
Posts: 5
Hi All,

I'm connecting to an Oracle database, and accessing a function that returns a SYS_REFCURSOR. I can succesfully map the function using the following syntax:

@NamedNativeQuery( name = "blah_list"
, query = "{ call blah__function(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}"
, resultClass = blah.class
, hints = { @QueryHint(name = "org.hibernate.callable", value = "true")
, @QueryHint(name = "org.hibernate.readOnly", value = "true")
}
)

I can access the resultset it returns.

The issue is, within the resultset, there are nested CURSOR expressions.. ie:

SELECT my_column1, my_column2
,CURSOR (
SELECT my_column1
FROM my_table2
WHERE blah = blah ) column3
FROM my_table1

My question is, how do I return the data from all the cursors? I can return the main cursor (ie column 1 and 2), but column through comes through as empty.

Currently I'm using the following to access the resultSet:

public List<StandardServiceView> findstandardServiceView(Integer serviceID) {
Query query = getEntityManager().createNamedQuery("blah_list");
query.setParameter(1, blahID);
return query.getResultList();
}


Top
 Profile  
 
 Post subject: Re: Oracle Cursor Expressions (Cursor subqueries)
PostPosted: Wed Sep 02, 2009 9:56 am 
Newbie

Joined: Thu Jan 29, 2009 10:03 am
Posts: 5
My googling has lead me to believe, due to lack of anyone else questioning or providing examples of this, that I might have a problem getting my issue resolved..


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

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.