On Sat, 21 Jun 2003 01:55:52 +0530 Biswajeet Padhy <[EMAIL PROTECTED]> wrote:

> can You please suggest why I am getting the error in following code;
> 
> $test_num="500212275";
> $sql='begin CDI1_GETSEQ_PKG.CDI1_GETphoneID_PROC(:test_num); end;'; 
> $sth = $dbh->prepare( $sql);
> $sth->bind_param(":test_num", $test_num);
> 
> $sth->execute();
> print "[EMAIL PROTECTED]";
> $sth->finish()
> 
> when I ran the procedure in sql sheet it is sussessful.
> 
> The error is as below
> DBD::Oracle::st execute failed: ORA-06550: line 1, column 7:
> PLS-00221: 'CDI1_GETPHONEID_PROC' is not a procedure or is undefined
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored (DBD: oexec error) at test.pl line 9.

Possibly the number of the procedure arguments isn't correct.  From
the name of the procedure I suspect it is an OUT or INOUT parameter
which might also cause trouble.

Try something like this to see if that is the case:

   $dbh -> {RaiseError} = 1;
   my $sth = $dbh -> prepare( <<END_SQL );
DECLARE
   test_num NUMBER := :test_num; -- adjust type to fit
BEGIN
   CDI1_GETSEQ_PKG.CDI1_GETphoneID_PROC( test_num );
   :test_num := test_num;
END;
END_SQL
   $sth -> bind_param_inout( ":test_num", \$test_num, 38, );

You might also try adding a bind type argument to bind_param() or
bind_param_inout().

There are examples of Oracle procedure calls in
http://search.cpan.org/src/TIMB/DBD-Oracle-1.14/Oracle.ex/ .

-- 
Mac :})
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to