Wrap an Oracle schema update in a transaction -


i've got program periodically updates database schema. sometimes, 1 of ddl statements might fail , if does, want roll changes. wrap update in transaction so:

begin tran;  create table (pkey int not null identity, newfieldkey int null, constraint pk_a primary key (pkey)); create index a_2 on (newfieldkey); create table b (pkey int not null identity, constraint pk_b primary key (pkey)); alter table add constraint fk_b_a foreign key (newfieldkey) references b (pkey);  commit tran; 

as we're executing, if 1 of statements fail, rollback instead of commit. works great on sql server, doesn't have desired effect on oracle. oracle seems implicit commit after each ddl statement:

is there any way turn off implicit commit?

you can not turn off. easy work around designing scripts drop tables in event exist etc...

you can @ using flashback database, believe can @ schema/object level check docs confirm that. need on 10g work.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -