Question : Insert rows in a table

Hi,

I want to insert rows in a table (nammed "Ta"), coming from another table (nammed "Tb").

In fact, I would like to do that in a Sybase script to use only one command INSERT in a WHILE loop. I must initially make a SELECT in the "Tb" table and for each row found, make an INSERT in the "Ta" table.

Please, can you give me the syntax for a Sybase script.

Thank's
Stdt

Answer : Insert rows in a table

why do need a while loop when u can simply run the following sql

insert into Ta
select col1 = colA,
col2 = colB ..

from Tb
where Tb.colA = ...
and ..

Thanks.
Random Solutions  
 
programming4us programming4us