Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Reading this article about creating an array udt and using it in stored procedure:
Is there a way to call an SP and return an array using this?
I didn't read the article but returning an array from a SP sounds odd to me when you can return a result set which is basically an array of table rows with meta data attached to it.
Chris Ringer
A PROCEDURE returns an integer (or nothing), so technically, no. What they appear to be doing is using an "OUT" parameter as a way around this.
You must be thinking of executing this PROCEDURE from RPG, or something else not SQL. If you were using SQL you'd do a CREATE FUNCTION ... RETURNS TABLE.
Which begs the question, what are you trying to accomplish, that you need to return an array from a SQL PROCEDURE?
Sorry for dawdling. I was asked if it's possible to return an array from an sql stored procedure to an rpg program. From what I read, the answer is no, but we can get the job done using result sets, and that's what I answered. haven't heard anything more on it, and been to busy to ask.
Thanks for the response!