I wish to be able to execute a create statement, and then rollback if there is a problem with any sql that follows. It seems that you cannot rollback? Why is this?
(My problem is that I wish to execute a series of sql statements and run a rollback if anything before it fails, including the creation of the table)
set serveroutput on;
declare
rcount INTEGER;
PRAGMA AUTONOMOUS_TRANSACTION;
begin
execute immediate 'create table bsdconv_s1stc_code (id number)';
dbms_output.put_line('Table created successfully');
rollback;
exception
when others then dbms_output.put_line('Error while creating table. Probably already exists.');
end;