DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: PL/SQL code

  1. #1
    Join Date
    Feb 2003
    Posts
    23

    PL/SQL code

    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

  2. #2
    Join Date
    Jul 2002
    Location
    Slovenia
    Posts
    42
    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;
    Last edited by andrejm; 05-14-2003 at 04:18 AM.
    Andrej

  3. #3
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Put each one in its own block:

    begin
    execute . . . ;
    exception when others then NULL;
    end;
    begin
    execute . . . ;
    exception when others then NULL;
    end;
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  4. #4
    Join Date
    Feb 2003
    Posts
    23
    hello,

    Thanks a lot andrejm & DaPi.

    Nour

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width