in reply to Passing Arrays from Perl to Stored Procedures
poj# Example 2 # # Now we call a procedure that has 1 IN parameter. # Here we use bind_param # to bind out parameter to the prepared statement just # like you might # do for an INSERT, UPDATE, DELETE, or SELECT statement. # # I could have used positional placeholders # (e.g. :1, :2, etc.) or # ODBC style placeholders (e.g. ?), but I prefer # Oracle's named # placeholders (but few DBI drivers support them so # they're not portable). my $err_code = -20001; $csr = $db->prepare(q{ BEGIN PLSQL_EXAMPLE.PROC_IN(:err_code); END; }); $csr->bind_param(":err_code", $err_code); # PROC_IN will RAISE_APPLICATION_ERROR which will # cause the execute to 'fail'. # Because we set RaiseError, the DBI will croak (die) # so we catch that with eval. eval { $csr->execute; }; print 'After proc_in: $@=',"'$@', errstr=$DBI::errstr, ret_val=$ret_ +val\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing Arrays from Perl to Stored Procedures
by poj (Abbot) on Mar 07, 2003 at 11:30 UTC | |
by TheYoungMonk (Sexton) on Mar 07, 2003 at 12:46 UTC | |
by dragonchild (Archbishop) on Mar 07, 2003 at 15:51 UTC | |
by Anonymous Monk on Mar 07, 2003 at 21:44 UTC | |
|
Re: Re: Passing Arrays from Perl to Stored Procedures
by TheYoungMonk (Sexton) on Mar 07, 2003 at 10:58 UTC | |
by Anonymous Monk on Mar 08, 2003 at 09:18 UTC |