Oracle exception handling module ideas/suggestions
- From: "mark@xxxxxxxxxxxxx" <mark@xxxxxxxxxxxxx>
- Date: 21 Nov 2005 10:26:57 -0800
I'm experimenting with a Oracle-specific exception handling module. I
wonder if anyone else has done similar things, has suggestions, is
interested, etc.
Looks like this so far (using Error.pm in example, but not required of
course)
use OraErr; # default defines Oralce built-in named exceptions
try {
$sth->execute();
}
catch ORA::DUP_VAL_ON_INDEX with {
...
}
catch ORA with { # all other ora errors
my $e=shift;
printf "got ora number %d", $e->err;
};
or:
use OraErr (942, 1812); # define exceptions based on ora err nums
try {
$sth->execute();
}
catch ORA::00942 with {
...
}
catch ORA::01812 with
...
};
or:
# similar to Oracle exception_init pragma, ie, define your own
exception names
use OraErr { 942 => 'TABLE_NOT_FOUND' };
try {
$sth->execute();
}
catch ORA::TABLE_NOT_FOUND with {
...
}
Comments of any sort welcome. Thanks.
.
- Prev by Date: ANNOUNCE: Rose::DB::Object 0.51 released
- Next by Date: Re: Compiling dbd-oracle on hpux64
- Previous by thread: ANNOUNCE: Rose::DB::Object 0.51 released
- Next by thread: Installation failure on DBD-Oracle 1.16
- Index(es):