Hi Viji,
Here's how I do it:
==============================
my $result;
my $returnCode;
my $isbn = '1234123412';
my $csr_hyphenIsbn = $dbh->prepare ("BEGIN
bkpower.hyphenisbn_proc(?,?,?); END;");
$csr_hyphenIsbn->bind_param(2, $isbn);
$csr_hyphenIsbn->bind_param_inout(1, \$result, 13);
$csr_hyphenIsbn->bind_param_inout(3, \$returnCode, 1);
$csr_hyphenIsbn->execute();
=========================================================================
hyphenIsbn_proc is the stored procedure and it takes 3 parameters. The first
and third are output parameters, the 2nd is an input, hence 3 placeholders.
These placeholders are bound with bind_param & bind_param_inout.
The first argument to bind_param & bind_param_inout is the position of the
stored procedure argument. The second argument is the bound variable (note
that sometimes it's a reference). The third argument is the maximum length
(only needed for bind_param_inout).
There's a great book on DBI written by Tim Bunce (who also created DBI) and
it has the answer to this and most other common questions about DBI. It's
called "Programming the Perl DBI" and is published by O'Reilly.
Other resources:
DBI faq:
http://xmlproj.dyndns.org/cgi-bin/fom
Archive for this mailing list:
http:[EMAIL PROTECTED]/
You can also run perldoc DBI::FAQ.
Good luck!
Tim Helck
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 12:10 AM
To: [EMAIL PROTECTED]
Subject: calling a stored procedure from perl through dbi
Hi:
I am as such new to perl and dbi. Please excuse me on my technical skills
in this.
How do you execute a stored procedure created in Oracle from perl??
Thanx in advance
Viji