Personal tools
You are here: Home DB2 How To's How to execute a DB2 script with begin atomic
Navigation
Log in


Forgot your password?
 
Document Actions

How to execute a DB2 script with begin atomic

Example1:

begin atomic
declare x char;
set x=(select nome from db2inst1.x0 where nome='a');
insert into db2inst1.x0  (nome) values (x);
end@

 

Example2:

begin atomic
insert into db2inst1.x0 (nome) values ('cd');
insert into db2inst1.x1  (cod) values (select identity_val_local() from sysibm.sysdummy1);
end@

 

To execute theses scripts via command line:

db2 -td@ -vf <scriptname>
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls