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 -> Help with my perl scripts of dropping index

Help with my perl scripts of dropping index

From: ff <dbadba62_at_hotmail.com>
Date: Fri, 15 Jun 2001 10:32:32 GMT
Message-ID: <4vlW6.2796$Ua3.600116@typhoon2.ba-dsg.net>

I am posting this message to this group because a lot of DBAs are good perl programmers as well. We have a perl scripts, part of it is drop index as follows



my $failure = 1;
while ( $failure != 0 )
{
        my $sql = qq{ drop index index_1};
        $dbh->do ( $sql );
        if ( $dbh->state == 0 )

{
print "index_1 dropped\n"; $failure = 0; } else
{
$failure = 1; print "error dropping index_1= $dbh->errstr and error value $dbh->state\n"; }

}

But the script is not very successful. One out of ten times, the index is not dropped and the scripts will exit the loop and continue to run, which will try to create the same index_1 which is suppose to be droped now.

Could some body help me to improve my script to make sure it will not exit while loop until the the index_1 is dropped for sure?

Thanks Received on Fri Jun 15 2001 - 05:32:32 CDT

Original text of this message

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