Question : Populate a Temporary Table

Hi,
 iam new to Sybase.
 I have a stored procedure,which returns a data set.I'd like to dump the results of this stored procedure,into a temporary table.
  How can i do that?
Thanks.

Answer : Populate a Temporary Table

Which Sybase product and version? There are three major Sybase databases.

The easiest way, and this will work in all Sybase products, is simply to redirect the result sets of all queries in the procedure into a temp table. (ie. turn all SELECTs into INSERT... SELECTs)

If you do this, you will want to create the temp table in the parent calling environment first.

If you are using ASE of at least 11.5 or above, you could also create a proxy table mapped to the stored procedure, so that issuing a SELECT on the proxt table executes the procedure and displays its result set. It would then be trivial to put this into a temp table.

This second method is complicated so I'll hold off until you confirm the first method isn't sufficient.

Good luck!
Random Solutions  
 
programming4us programming4us