#1  
Old 02-01-2010, 04:05 PM
adarsh_kr adarsh_kr is offline
Member
 
Join Date: Mar 2006
Posts: 50
SQL Proc return DS

Hi all,

Sorry if it was already answered, but I am trying to find a way to read the result set of a SQL procedure (EXT) inside a SQLRPGLE program and wondering how I could do it.

Thanks in advance,
Adarsh
Reply With Quote
  #2  
Old 02-01-2010, 04:27 PM
Scott Klement's Avatar
Scott Klement Scott Klement is online now
 
Join Date: Jul 2005
Location: Milwaukee, WI, USA
Posts: 10,596
http://systeminetwork.com/article/re...result-set-rpg
Reply With Quote
  #3  
Old 02-01-2010, 04:38 PM
adarsh_kr adarsh_kr is offline
Member
 
Join Date: Mar 2006
Posts: 50
Thanks Scott. Appreciate your help.
Reply With Quote
  #4  
Old 02-02-2010, 11:45 AM
Lynne Noll Lynne Noll is offline
System iNetwork Forum Pro
 
Join Date: Jul 2005
Location: Gloucester MA USA
Posts: 2,827
I have a number of general parameter style RPG procedures that return array or mod data structures as result sets. I set up CLI to process the result sets (and they work nicely, and work with procedures that return cursors, and can work between different AS400's, and works for SQL procedures, and other parameter styles, and are all around cool. But cumbersome, even with a service program to help.Not more cumbersome than doing the same thing in .net, though--Rpg is way better.)

However, for cases where the procedure is called locally from RPG programs as well as from client applications, I found the simplest way of returning the result set was to call the procedure outside of SQL (as an ordinary procedure) and just return the number of elements and array in optional parameters. When the routine is called without the extra parameter, it returns a result set; otherwise, it returns the number of elements and array.
Reply With Quote
Reply

Tags
external, procedure, return set, sql

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:46 AM.