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 > Stored procedure

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-09, 13:35
xotesa xotesa is offline
Registered User
 
Join Date: Jun 2009
Posts: 16
Stored procedure

Hello.

I have a table and i want to take my values from that table and insert to another table.

SELECT * from Table1 where 1=1;


INSERT INTO Table2 VALUES(...The values from Table1)


This is like a for statement.

I have more than 1 rows and i am using a stored procedure.

Are there any for-like statements for stored procedures in Sybase?

Thanks...
Reply With Quote
  #2 (permalink)  
Old 06-24-09, 18:42
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 443
You could just do

select * into Table2
from Table1

or if you need select columns

insert into Table2
select col1, col2, etc from Table1
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

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