Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Create index only if index not exists in PL/SQL procedure

Re: Create index only if index not exists in PL/SQL procedure

From: Niall Litchfield <niall.litchfield_at_dial.pipex.com>
Date: Wed, 14 Apr 2004 21:18:55 +0100
Message-ID: <407d9caf$0$3309$cc9e4d1f@news-text.dial.pipex.com>


Why on earth are you creating and dropping objects in a stored procedure? This smacks of poor design.

-- 
Niall Litchfield
Oracle DBA
Audit Commission UK
http://www.niall.litchfield.dial.pipex.com
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer
******************************************
"Christian Svensson" <chse30_at_hotmail.com> wrote in message
news:ccc2a7eb.0404140334.2ab01299_at_posting.google.com...

> Greetings all,
>
> In my procedure I do:
>
> 1, Drop index X
> 2, Create table Y as select...
> 3, Create index X for table Y
>
> Sometimes the job(2) fails and the index X will not be created. So I
> want some simple checking in my PL/SQL code when it drops the index at
> step 1.
>
> Of course I can do a select from user_indexes where index_name =
> 'bla...' and then do an exists on this.
>
> But I think I have seen a much easier way to do this in just one line.
> But cant remember.
>
> Any help are much appreciated.
>
> Thanks.
>
> Christian
Received on Wed Apr 14 2004 - 15:18:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US