
Executing DEL and UPDT PL/SQL stored procedures from PERL
Quote:
> Hi,
> i was wondering whether it is possible (and more importantly how!) to
> execute some PL/SQL stored procedures on Oracle (stprocs) from PERL.
> I know using DBI, perl can execute SELECT stprocs but what about
> DELETE and UPDATES? Also can those DELETE and UPDATES stprocs return a
> value to PERL (say number of rows deleted or updated)?
> In these codes, im actually calling a stproc found in a Package and it
> simply select date from dual.
> use DBI qw(:sql_types);
> my $today;
> $csr = $dbh->prepare(q{
> BEGIN
> PACK_TEST.TEST_PROC (:today);
> END;
> });
> $csr->bind_param_inout(":today", \$today, 20);
> $csr->execute;
> print "Today is $today\n";
> $dbh->disconnect;
> Is there some equivalent codes for DELETE and UPDATE?
> Thanks,
> GC.
It depends on how the PL/SQL is written. If you want to return values,
then write the procedure/function so values will be returned. There are
plenty of examples in the DBD::Oracle docs on using PL/SQL from Perl.
If you are up to the challenge, try building and working with
Oracle::OCI. It gic\ves direct access to low level Oracle functions
(just like C/C++ OCI programming) as well as internal function directly
from Perl.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.