Click to See Complete Forum and Search --> : PL/SQL code


nour
05-12-2003, 10:17 AM
Hello,

Suppose that you have the following PL/SQL code :

begin
EXECUTE IMMEDIATE 'CREATE BITMAP INDEX zi1 on z_tst(c1)';
EXECUTE IMMEDIATE 'CREATE BITMAPE INDEX zi2 on z_tst(c2)';
EXECUTE IMMEDIATE 'CREATE BITMAP INDEX zi3 on z_tst(c3)';
end;

After executing this procedure, only the first index will be created (a systax problem for zi2 index). The third index will not ba created.

How can I do create the thrid index even if I have a problem with creating the second (so, let Oracle not exiting the program ...).

Think in advance

andrejm
05-12-2003, 10:22 AM
MAYBE YOU MUST REMOVE ONE 'E' FROM SECOND INDEX...
EXECUTE IMMEDIATE 'CREATE BITMAPE INDEX zi2 on z_tst(c2)';

set serveroutput on
begin
begin
EXECUTE IMMEDIATE 'CREATE BITMAP INDEX zi1 on z_tst(c1)';
exception when others then
dbms_output.put_line('blabla1');
end;
begin
EXECUTE IMMEDIATE 'CREATE BITMAPE INDEX zi2 on z_tst(c2)';
exception when others then
dbms_output.put_line('blabla2');
end;
begin
EXECUTE IMMEDIATE 'CREATE BITMAP INDEX zi3 on z_tst(c3)';
exception when others then
dbms_output.put_line('blabla3');
end;
end;

DaPi
05-12-2003, 10:40 AM
Put each one in its own block:

begin
execute . . . ;
exception when others then NULL;
end;
begin
execute . . . ;
exception when others then NULL;
end;

nour
05-13-2003, 05:13 AM
hello,

Thanks a lot andrejm & DaPi.

Nour