Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

DB2 error: "Can't bind unknown parameter marker ':p4'"

by shanknbake (Initiate)
on Jan 18, 2013 at 03:56 UTC ( #1013945=perlquestion: print w/ replies, xml ) Need Help??
shanknbake has asked for the wisdom of the Perl Monks concerning the following question:

Error: Can't bind unknown parameter marker ':p4' My code:
my $returnValue; $sth = $self->GetDatabase()->prepare( "CALL mySchema.myStoredProcedure +(?,?,?)" ); $sth->bind_param(1,$p1); $sth->bind_param(2,$p2); $sth->bind_param(3,0); $sth->bind_param_inout(4,\$returnValue,20); $sth->execute(); $sth->finish();
I'm not sure what the problem could be... everything (AFAIK) seems right. Anyone have any ideas?

Comment on DB2 error: "Can't bind unknown parameter marker ':p4'"
Select or Download Code
Re: DB2 error: "Can't bind unknown parameter marker ':p4'"
by Anonymous Monk on Jan 18, 2013 at 04:02 UTC

    I'm not sure what the problem could be... everything (AFAIK) seems right. Anyone have any ideas?

    Sure you are :) Can't bind unknown parameter marker is a very specific error message, and since :p4 doesn't occur in the cod you posted, it must occur in the stored procedure

      I'm thinking that the error is in the way that I'm calling the stored procedure... does that look okay?
        The stored procedure looks to be working fine - I tested it manually using the Data Studio tool. So it must be something funky with the way that I'm calling it...
Re: DB2 error: "Can't bind unknown parameter marker ':p4'"
by runrig (Abbot) on Jan 19, 2013 at 17:15 UTC
    AnonyMonk above has it right...you have 3 ?'s, and 4 binds. If you are trying to get the return value from the stored procedure, try using the $sth->{db2_call_return} attribute.
      $sth->{db2_call_return}; is EXACTLY the thing I've been missing!!! Thank you so much! I've not ONCE seen an example where someone uses that! TYVM!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1013945]
Approved by herveus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-08-30 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls