develooper Front page | perl.dbi.users | Postings from February 2001

DBI:Oracle Oracle8 IIS problem at prepare

Thread Next
From:
Mark Zimmerman
Date:
February 9, 2001 16:30
Subject:
DBI:Oracle Oracle8 IIS problem at prepare
Message ID:
003601c092f8$a674c8b0$0305a8c0@Boromir
my system:
    dual 933, 256 ram, 108gigs hd, win2k pro, IIS 5.0, ActivePerl 5.6.0,
latest DBI, latest DBD-Oracle
my problem:
    my script works in dos, but in IE 5.0 and NS 3.04 it dies at the prepare
statement (my $sth = $dbh->prepare($query))

I have tried everything I can think of.
If I change the DBD driver to ODBC it works, but I would rather use
DBI/Native Oracle drivers.
Since it gets past the ->connect statement, it is connecting to the Oracle
db.
Why is the ->prepare statement causing it to drop?
Is there another method of sending the query to the db that I can try?

Example of my script:

 use DBI;

 print "Content-type:  text/html\n\n";


 my $dbh = DBI->connect('DBI:Oracle:prd.world','username','password',
 RaiseError => 1 } )
  or die "Couldn't connect to database: " . DBI->errstr;

 $query='SELECT * FROM oracle_table WHERE last_name = ?';

 print "This prints fine!";

 my $sth = $dbh->prepare($query)
  or die "Couldn't prepare statement: " . $dbh->errstr;

 print "This prints in dos, but not to a web browser!";

 $lastname= "Lastname";
 my @data;
 chomp $lastname;
 $sth->execute($lastname)
  or die "Couldn't execute statement: " . $sth->errstr;

 while (@data = $sth->fetchrow_array())
 {
  my $id = $data[1];
  my $firstname = $data[2];
  print "\t$id: $firstname $lastname\n";
 }

 $dbh->disconnect;
____________________________________



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About