Hi everyone,
How to performer a begin/commit/rollback operation for two or more steps in proc sql?
For example:
proc sql;
connect to oracle as ora(...);
**begin transaction
insert into ora.a;
insert into ora.b;
delete from ora.c;
**commit transaction for success
or
**rollback transaction for fail
quit;
Thanks,
...
Hi, LinusH
Thanks for your attention!
I have a linked_people (id_people1, id_people2) table and a history_people (id_people, operation_date) table. Everytime when insert a row in people_linked table, have be inserted two rows in history_people table.
This operation need be atomic.
Just wrap the code you would use in Oracle PL-SQL, including COMMIT and ROLLBACK commands, in an EXECUTE statement:
proc sql;connect to oracle as ora(...);
execute(
**begin transaction
insert into ora.a;
insert into ora.b;
delete from ora.c;
**commit transaction for success
or
**rollback transaction for fail
) by ora;
quit;
Hi SASKiwi,
Thanks for response!
But, the problem is source table is a sas dataset.
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 save with the early bird rate—just $795!
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.