I found that were were previously set but I set them in the script according
to the DBD::Oracle docs.  Here is a trimed down script and then the output I
am receiving.
NOTE: I receive a "No such file or directory" for :0 and :1 if I do not
include the "use Data::Dumper;" line.  I am still not sure why.

#!/usr/bin/perl5 -w
print $?."0\n";
print $!.":0\n";
use strict;
use DBI;
use DBD::Oracle qw(:ora_types);
use Data::Dumper;
BEGIN {
        $ENV{ORACLE_HOME} = '/oracle/product/8.1.6';
        $ENV{TWO_TASK} = 'P:DEMO';
}
my $user = shift;
my $pass = shift;

print $!.":1\n";
print "O-0$!\n";
my $dbh = DBI->connect("dbi:Oracle:demo",$user,$pass) || die "connection to
Demo Failed$!";
$dbh->{RaiseError} = 1;
print "O-1$!\n";

my $date;
my $sth = $dbh->prepare(q{
        BEGIN
                select sysdate into :date from dual;
        END;
});
print "O-2$!\n";
$sth->bind_param_inout(":date", \$date,8);
$sth->execute();

print "*************$date*************\n";
print "O-3$!\n";
$dbh->disconnect();
print "O-4$!\n";


Output:

$> perl test-trimed.pl user pass
00
:0
:1
O-0
O-1Operation not applicable
O-2Operation not applicable
*************02-JUL-02*************
O-3Operation not applicable
O-4Operation not applicable

Adam

> -----Original Message-----
> From: Job Miller [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, July 02, 2002 6:46 AM
> To:   Hapworth, Adam
> Subject:      Re: Getting a non fatal error after Connect to Oracle
> 
> have the perl script set the env variables that must
> be normally set in your environment by default
> (otherwise it shouldn't work from the command line
> either)
> 
> ORACLE_HOME most importantly.
> 
> Job
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com

Reply via email to