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 ?
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.