Please do me a favour , I am trying to insert multiple rows in the table in db2 database via sas but i am not able to insert multiple rows at a time.
when i use
insert into table_name (a,b,c)
values('a',2,3);
it works but when i use
insert into table_name
select a,b,c
from table2.
then it is not working.
i am getting the error.
I am using SAS EG 6.0.
I think your syntax might be wrong:
proc sql;
insert into table_name(a,b,c)
select a,b,c from table2;
quit;
I used the same syntax as you wrote(correct one) but i am getting the error when i am trying to insert multiple rows at a time but not for a single row.
try adding the clause values before select clause
Hi,
If your table structures are the same, have you tried something like the following (untested):
insert into want
select * from have;
Regards,
Amir.
It seems variables in table_name and table2 have different attributes. Try Proc contents to make sure both tables have same type of variables.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.