pvsbandi
asked on
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Thanks for the reply..iam on ASE 12.5.
As you said,the first method asks for a structure of a table to be created first,in order to
populate the data from the stored proc.
Can you tel me another way,which will simply dump the data returned by the
stored proc into a temporary table on the fly,without having to create the table.
Thanks1
Thanks for the reply..iam on ASE 12.5.
As you said,the first method asks for a structure of a table to be created first,in order to
populate the data from the stored proc.
Can you tel me another way,which will simply dump the data returned by the
stored proc into a temporary table on the fly,without having to create the table.
Thanks1
Any temp table that you create in the stored proc does not exist outside the scope of that proc. When the proc finishes executing, then the table is gone.
You could go with my first suggestion and have the first result set in the proc do a SELECT INTO, and all subsequent SELECTs do an INSERT... SELECT. You can use a "persistent" table in tempdb, which unlike #temp tables *will* be visible when the proc is finished...
You could go with my first suggestion and have the first result set in the proc do a SELECT INTO, and all subsequent SELECTs do an INSERT... SELECT. You can use a "persistent" table in tempdb, which unlike #temp tables *will* be visible when the proc is finished...
ASKER