Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Selecting a long with DBI/DBD Oracle

Selecting a long with DBI/DBD Oracle

From: Brian Lavender <blavender_at_spk.usace.army.mil>
Date: Fri, 30 Apr 1999 00:53:09 GMT
Message-ID: <7gautj$i5l$1@nnrp1.dejanews.com>


I am using the DBI/DBD perl modules to select a long from a database. I can't get it to work. I have seen the bind param and a LongTruncOk command. Here is my code. What do I need to make this work?

Table definition:

 SYNOPSIS                                 LONG
 LOCATION                                 VARCHAR2(64)

PERL code:
#!/usr/local/bin/perl -Tw

use DBI;
use DBD::Oracle qw(:ora_types);

BEGIN {
  $ENV{ORACLE_HOME} = '/opt/app/oracle/product/7.3.4';
  $ENV{TWO_TASK} = 'foo.bar';

}
my $dbh = DBI->connect('dbi:Oracle:','myuserid','mypasswd')

        or die "Unable to connect: $DBI::errstr"; my $query = "select synopsis , location from solicitation"; my $sth= $dbh->prepare($query) or die "Prepare failed: $DBI::errstr";
$sth->execute;

while(@row = $sth->fetchrow() ) {
  print @row, "\n\n";
}
$sth->finish();
$dbh->disconnect();

--
Brian E. Lavender
US Army Corps of Engineers -- Programmer / Systems Analyst Sacramento, CA (916) 557-6623

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Apr 29 1999 - 19:53:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US