----- Original Message -----
From: "Adam Gent" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 15:02
Subject: Oracle Stored Procedures and Packages
> I am trying to run an oracle stored procedure through the DBI the
> procedure is stored in a package.
>
> In the DBI faq it say that this is possible but I can not seem to get
> it working.
>
> This is the code I am using
>
> #!/usr/local/bin/perl
>
> use DBI;
> use CGI;
>
> print "Content-Type: text/html\n\n";
>
> BEGIN {
> $ENV{ORACLE_HOME} = '/u04/app/oracle/product/OraHome1';
> $ENV{TWO_TASK} = 'DB';
> }
>
> $dbh = DBI->connect("dbi:Oracle:host=delphi;sid=cs2000", "*******",
> "*******");
> $sth = $dbh->prepare("BEGIN sess.make(:1,:2); END;");
> $sth->bind_param(1, 'meep');
> $sth->bind_param(2, '110183');
>
> $rc = $sth->execute;
> print "test";
> }
>
> $dbh->disconnect;
>
> Could you please tell me where I am going wrong as I need to get this
> working.
1. You didn't include '-w' in the '#!' line.
2. You didn't 'use strict;'.
3. You didn't set $dbh -> {RaiseError} = 1 or check the individual method
calls for errors.
4. You didn't make any provision for seeing error messages by either using
CGI::Carp or writing the individual errors to a file somewhere.
You also didn't tell us why you don't think it is working. If you just
don't see the results in a table afterwards, you may need to call
$dbh->commit.
What happens when you run this from the command line?
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.htm
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.