Zo has asked for the wisdom of the Perl Monks concerning the following question:
#!perl -w ######################################################### # This perl script will go to the oracle database, run the stored proc +edure # LINES_EXTRACT and update the ...... # This will also take each line data and run so that R.R. will exec +ute. # # October 17, 2001 ######################################################### use strict; use DBI; #make the oracle connection my $dbh = DBI->connect('dbi:Oracle:Db001','developer','developer2', { RaiseError => 1, AutoCommit => 0 } ) || die "Database connection not made: $DBI::errstr"; my $rv; eval { my $func = $dbh->prepare(q{ BEGIN :rv := jb_function( parameter1_in => :parameter1); END; }); $func->bind_param(":parameter1", 'pizza'); $func->bind_param_inout(":rv", \$rv, 256); $func->execute; $dbh->commit; }; if( $@ ) { warn "Execution of stored procedure failed: $DBI::errstr\n"; $dbh->rollback; } print "Execution of stored procedure returned $rv\n"; $dbh->disconnect;
C:\Perl>connect_4.pl Execution of stored procedure failed: ORA-06550: line 3, column 15: PLS-00201: identifier 'JB_FUNCTION' must be declared ORA-06550: line 3, column 8: PL/SQL: Statement ignored (DBD ERROR: OCIStmtExecute) Use of uninitialized value in concatenation (.) or string at C:\Perl\c +onnect_4.p l line 43. Execution of stored procedure returned
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling a Stored Procedure (Oracle) from Perl
by tommyw (Hermit) on Oct 18, 2001 at 03:15 UTC | |
|
Re: Calling a Stored Procedure (Oracle) from Perl
by rrwo (Friar) on Oct 18, 2001 at 02:45 UTC |