• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How resultset is returned by stored procedure?

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How resultset is returned by stored procedure?
I know that by using Callable Statement we can call stored procedures. But if that stored procedure is returning a resultSet, then how will you handle that resultset?
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hemant,

Say you stored procedure is sp_emp for famous Oracle emp table:




Now when you run the procedure from SQL prompt, it will return records for all the employees which is essentially a resultset. That's how the stored procedure can return resultset.

Now in yor java code:


The above code will give you all the employee records in resultset rst. So you can not use the resultset same way as you use for adhoc queries.

hth,
Harshil
 
Hemant Agarwal
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So you can not use the resultset same way as you use for adhoc queries.


What do you mean by that?
 
Harshil Mehta
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Hemant,

It was a typo , i meant to say "Now you can use". not "Now you can not use".

--Harshil
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic