dbTalk Databases Forums  

Putting result set of stored procedure into temporary table

comp.databases.sybase comp.databases.sybase


Discuss Putting result set of stored procedure into temporary table in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ed Avis
 
Posts: n/a

Default Putting result set of stored procedure into temporary table - 12-16-2003 , 11:15 AM






I can execute a stored procedure and get some rows as results. For
example sp_spaceused returns one row with six columns, and then a row
with one column containing the stored procedure exit status.

I would like to get the rows returned by the stored procedure (though
not the exit status) into a temporary table. Something like

exec sp_spaceused 'whatever' into #foo

The table #foo would then have a single row containing the results
from sp_spaceused. Is this possible? (ASE 11.9.2)

--
Ed Avis <ed (AT) membled (DOT) com>


Reply With Quote
  #2  
Old   
Michael Peppler
 
Posts: n/a

Default Re: Putting result set of stored procedure into temporary table - 12-16-2003 , 12:22 PM






On Tue, 16 Dec 2003 17:15:16 +0000, Ed Avis wrote:

Quote:
I can execute a stored procedure and get some rows as results. For
example sp_spaceused returns one row with six columns, and then a row with
one column containing the stored procedure exit status.

I would like to get the rows returned by the stored procedure (though not
the exit status) into a temporary table. Something like

exec sp_spaceused 'whatever' into #foo

The table #foo would then have a single row containing the results from
sp_spaceused. Is this possible? (ASE 11.9.2)
Not directly.

However, by using CIS you can map an RPC call to a proxy table, and then
use a normal SELECT over the proxy table to execute the RPC. I'm not sure
how that would work with multiple result sets. Look for the "create
existing table" command in the docs.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler (AT) peppler (DOT) org http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html



Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.