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

Re: Help with my perl scripts of dropping index

From: Yong Huang <yong321_at_yahoo.com>
Date: 15 Jun 2001 13:39:23 -0700
Message-ID: <b3cb12d6.0106151239.6407906c@posting.google.com>

Why not print $DBI::errstr after $dbh->do?

Yong Huang
yong321_at_yahoo.com

"ff" <dbadba62_at_hotmail.com> wrote in message news:<4vlW6.2796$Ua3.600116_at_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 - 15:39:23 CDT

Original text of this message

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