Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Unanswered: Multiple result sets in procedure

    I am new to Sybase and I encountered the following statement when I was browsing through one of the documents :

    "In Sybase, it is possible to return multiple recordsets by performing a series of SELECT’s in the procedure one after the other".

    Can someone give me an example and brief me on this ? From the statement, here is my understanding

    create procedure proc_name
    select * from emp1;
    select * from emp2;

    In the above case, the result sets of select queries 1 and 2 will be available to the calling procedure. Is my understanding correct? If yes, how does a procedure calling proc_name() access the result set ?

  2. #2
    Join Date
    Sep 2002
    Hong Kong
    Your sample procedure is exactly how this works. However the results themselves are sent back to the client application, not the calling stored proc.

    Depending on the language and how your client app works whether both results are available is questionable. Some languages (PowerBuilder) allow you to choose which result set is captured, other languges just accept the first result set.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts