hi,
i'm trying to use eval to rebuild some indexes on my Oracle db. everything works fine, but it dies if it comes to an index that doesn't exist.. (ie, it never gets past that point). i know i can query for existing indexes, but i wanted to take them from an existing array, and i'm wondering about catching other errors.
also, i don't really want to fork sqlplus or something.
foreach my $index (@indexes) {
$dbh->do("alter index $index rebuild");
}
};this always dies if index doesn't exist.....so i don't have a chance to check $@
does anyone know how to do this?
i'm trying to use eval to rebuild some indexes on my Oracle db. everything works fine, but it dies if it comes to an index that doesn't exist.. (ie, it never gets past that point). i know i can query for existing indexes, but i wanted to take them from an existing array, and i'm wondering about catching other errors.
also, i don't really want to fork sqlplus or something.
Code:
eval { foreach my $index (@indexes) {
$dbh->do("alter index $index rebuild");
}
};
does anyone know how to do this?