If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > create output of strored procedure into a table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Sep 2010
Posts: 4
create output of strored procedure into a table

Hello everyone

please have a look at the code below

create table tab1
(
int1 int null,
int2 int null
)

insert into tab1 values (11,22)
insert into tab1 values (33,44)
insert into tab1 values (55,66)

CREATE PROC test_proc
AS
SELECT int1, int2 from tab1

create table tab2
(
int11 int null,
int22 int null
)

I would like to run test_proc and store the values to tab2. please help witht the query.

Something like insert into tab2 exec test_proc -- which obviously does not work.

I'm using sybase 15

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,348
Create a proxy table on the proc, then insert into the new table by selecting from the proxy table.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Mar 2008
Posts: 95
I am not sure but i guess there is a limitation in SP that DDL commands can't be executed from within a SP.

Regards
Ishu
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On