Hi,
I have the following Perl script which basically should take a string, run a plsql function using that string and return an ID number. I would like to pass the string as a bind variable into the plsql and retrieve the ID number as another out bind variable.
use DBI;
my $dbh;
my $sth;
my $plsql;
my $id=0;
my $l_chime = qw(HZgrDAwAPB5QvcatrY);
connect_db();
eval{
$plsql = $dbh->prepare(q{
BEGIN
:id := Pkg.search_string(:l_chime);
END;
});
$plsql->bind_param_inout(":id",\$id,16);
$plsql->bind_param_inout(":l_chime",\$l_chime,4000);
$plsql->execute;
$plsql->finish;
};
print "returned: id: $id \n";
$id always returns null and i get a 'use of unitialised variable in string or concatenation (.)' error. I followed the steps in this perlmonks post, but still no luck.
You will see above that i have used bind_param_inout for id but i have tried bind_param, and it does the same thing.
Any ideas would be appeciated.
Thanks.
Joe.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.