Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-Oracle CPAN distribution.

Report information
The Basics
Id: 51594
Status: resolved
Priority: 0/
Queue: DBD-Oracle

People
Owner: Nobody in particular
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.23
Fixed in:
  • 1.24
  • 1.24a
  • 1.24b



Subject: type_info and type_info_all miss vital information
type_info () and type_info_all miss info for BLOB and CLOB (and maybe more). When writing portable scripts, you want to rely upon valid data in that! --8<--- use strict; use warnings; use DBI; my $dbh = DBI->connect ("dbi:Oracle:", (split m{/}, $ENV {ORACLE_USERID}), { RaiseError => 1, PrintError => 1, ShowErrorStatement => 1, AutoCommit => 1, ChopBlanks => 1, # InhibitNULL => 9, FetchHashKeyName => "NAME_lc", }) or die "Cannot connect: $!\n"; $dbh->do (q; create table test_foo ( i integer, n3 numeric (3), n52 numeric (5, 2), d decimal, ch4 char (4), vc4 varchar2 (4), cl clob, bl blob, fl float );); my $sth = $dbh->prepare ("select * from test_foo"); $sth->execute; my @nm = @{$sth->{NAME_lc}}; my @tp = @{$sth->{TYPE}}; my @pr = @{$sth->{PRECISION}}; my @sc = @{$sth->{SCALE}}; foreach my $i (0 .. $#nm) { my @ti = $dbh->type_info ($tp[$i]); my $st = @ti == 1 ? $ti[0]{TYPE_NAME} : "?"; printf "%d: %-5s %3d:%-20s (%3d, %2d)\n", $i, $nm[$i], $tp[$i], $st, $pr[$i], $sc[$i]; } $sth->finish; $dbh->do ("drop table test_foo"); -->8--- => 0: i 3:DECIMAL ( 38, 0) 1: n3 3:DECIMAL ( 3, 0) 2: n52 3:DECIMAL ( 5, 2) 3: d 3:DECIMAL ( 38, 0) 4: ch4 1:CHAR ( 4, 0) 5: vc4 12:VARCHAR2 ( 4, 0) 6: cl 40:? ( 0, 0) 7: bl 30:? ( 0, 0) 8: fl 8:DOUBLE PRECISION (126, 0)
Ok I managed eventually to fix it. Seem it is a real old one it should return the correct values for Clob and Blob now as well as BFile You can find the fix here http://svn.perl.org/modules/dbd-oracle/trunk