-->
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: Getting result set using sql-query
PostPosted: Fri Mar 28, 2008 2:36 am 
Beginner
Beginner

Joined: Tue Sep 11, 2007 5:57 am
Posts: 36
Suppose I have two tables namely Person and Address, and also have their respective class defined in the business layer. Now I have a stored procedure that returns the result of the following query

Select Per.ExternalID,Add.Line1,Add.Line2 From Person Per
Inner Join Address Add on Add.AddressUid=Per.AddressUid
Where Per.PersonUid=@PersonUid

Now is it possible to fetch this result set using predefined sql-query. I tried it using return-scalar, but it returns the result in Ilist wherein each entry is an object[]. Meaning I get IList[0] as an object[]

that is object[] result = Ilist[0];
result[0] is ExternalID
result[1] is Line1
result[2] is Line2

as expected, but the column names are not returned here. Is there any other way I can get the result returned by the SP along with the named defined.


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.