Problem retrieving Number Data (Oracle)
From: Jason White (jewhite_at_umd.edu)
Date: 11/01/04
- Next message: Lubomir G. Vassilev: "RE: Error: Can't load '/cygdrive/c/Oracle/Ora81/bin/Oracle' for module DBD::Oracle..."
- Previous message: Andy Hassall: "RE: Error: Can't load '/cygdrive/c/Oracle/Ora81/bin/Oracle' for module DBD::Oracle..."
- Next in thread: Tim Bunce: "Re: Problem retrieving Number Data (Oracle)"
- Reply: Tim Bunce: "Re: Problem retrieving Number Data (Oracle)"
- Maybe reply: Ron Reidy: "RE: Problem retrieving Number Data (Oracle)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: dbi-users@perl.org Date: Mon, 1 Nov 2004 16:13:42 -0500
All:
While I have some experience with the perl DBI, Oracle is new to me and
this current problem has me stumped.
Here's the client environment I'm working with ...
perl 5.6.1
DBI 1.42
DBD 1.06
SQL*Plus: Release 8.1.5.0.0
Oracle8i Enterprise Edition Release 8.1.7.4.50
In perl I do something like this ...
# already connected at this point ...
my $sql=q{select * from myDataView where fld1='value' and fld2 LIKE
'VALUE2%'};
my $seats;
my $sth = $dbh->prepare($sql);
while ($row_ref = $sth->fetchrow_hashref()) {
....
my $STS_ISS = $row_ref->{STS_ISS};
...
}
# then I print the output out ...
print "....
STS_ISS - $STS_ISS
....";
All the other values come out OK .. and they are all VARCHAR2, but the
STS_ISS field is a NUMBER(3)
I get (what seems like) the raw binary back from the oracle sever ...
something like:
STS_ISS - ^V
Someone suggested I might need to 'unpack' the data from Oracle. I
tried a number of the standard unpack templates, but nothing seemed to
give me consistent data back although it did give me some 'numbers'
back.
OR
If I use sqlplus, it comes back fine. If anyone has a clue as to why
or how to get the correct data back, many thanks in advance. That, or
if someone has a good functioning shell script running sqlplus from
there and reading the output back. Most examples I've seen are Korn
shells ... not my strong point. Well ... the main hang up is setting
the oracle home from within ksh ... I'm more familiar with tcsh.
Again .. thanks in advance,
Jason
- Next message: Lubomir G. Vassilev: "RE: Error: Can't load '/cygdrive/c/Oracle/Ora81/bin/Oracle' for module DBD::Oracle..."
- Previous message: Andy Hassall: "RE: Error: Can't load '/cygdrive/c/Oracle/Ora81/bin/Oracle' for module DBD::Oracle..."
- Next in thread: Tim Bunce: "Re: Problem retrieving Number Data (Oracle)"
- Reply: Tim Bunce: "Re: Problem retrieving Number Data (Oracle)"
- Maybe reply: Ron Reidy: "RE: Problem retrieving Number Data (Oracle)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|