Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Tie::DB uninitialized string eq complaint

by gregor-e (Beadle)
on Sep 13, 2006 at 20:43 UTC ( [id://572812]=perlquestion: print w/replies, xml ) Need Help??

gregor-e has asked for the wisdom of the Perl Monks concerning the following question:

I'm getting an 'uninitialized value in string eq' for each column in a DB row fetched using a Tie::DBI tied hash. It appears Tie::DBI has (or thinks it should have) a $types hash where it pays attention to the type of each column. In this case, the primary key is being compared in Tie::DBI to see if it is of DATE type and since $types is empty, Tie::DBI issues a complaint. Here's my test script:
#!/usr/local/bin/perl -w use strict; use DBI; use Tie::DBI; use Carp qw{cluck}; use Data::Dumper; my $crdmdbname = 'dbi:Oracle:production.world'; my $crdmuser = 'ZEEKRIT'; my $crdmpassword = 'UBERZEEKRIT'; my $crdmdbh = DBI->connect ($crdmdbname, $crdmuser, $crdmpassword); tie my %crdmRec,'Tie::DBI', { db => $crdmdbh, table => 'CRDM.CONSUMER_ACCT_HIST_200608', key => 'UNIV_ACCT_ID', CLOBBER => 0, AUTOCOMMIT => 0 }; # this Dumper generates one complaint per column (292) # plus one for the key print Dumper($crdmRec{25788305001}); $crdmdbh->disconnect();
Here's a couple steps in the debugger showing the problem:
Tie::DBI::_quote(/usr/lib/perl5/site_perl/5.8.3/Tie/DBI.pm:523): 523: if ($s->{'driver'} eq 'Oracle' && $types->{$field} eq 'DATE' +) { DB<5> p $field UNIV_ACCT_ID DB<6> use Data::Dumper DB<7> p Dumper($types) $VAR1 = {}; DB<8> s Use of uninitialized value in string eq at /usr/lib/perl5/site_perl/5. +8.3/Tie/DBI.pm line 523. Tie::DBI::_quote('Tie::DBI=HASH(0xa119c94)','UNIV_ACCT_ID',257 +88305001) called at /usr/lib/perl5/site_perl/5.8.3/Tie/DBI.pm line 431 Tie::DBI::_fetch_field('Tie::DBI=HASH(0xa119c94)',25788305001, +'ARRAY(0x9 ee90c8)') called at /usr/lib/perl5/site_perl/5.8.3/Tie/DBI.pm line 585 Tie::DBI::Record::FETCH('Tie::DBI::Record=HASH(0xa0bbda8)','se +curity_scr een') called at /usr/lib/perl5/5.8.3/i386-linux-thread-multi/Data/Dump +er.pm line 158 Data::Dumper::Dump('Data::Dumper','ARRAY(0xa0bbb50)') called a +t /usr/lib/perl5/5.8.3/i386-linux-thread-multi/Data/Dumper.pm line 48 +3 Data::Dumper::Dumper('HASH(0xa094574)') called at test.pl line + 33
Is this a known problem with Tie::DBI when used with Oracle? Is there something I can do to silence the complaint? (The code appears to work okay otherwise, it just complains for every column of every row processed. It also makes me worry that Tie::DBI might not handle DATE columns correctly for me, but I haven't gotten far enough to worry about that yet).

Info:

Linux cmtsas 2.4.22-1.2199.nptl #1 Wed Aug 4 12:21:48 EDT 2004 i686 i6 +86 i386 GNU/Linux This is perl, v5.8.3 built for i386-linux-thread-multi Tie-DBI-1.02 DBD-Oracle-1.18 Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Prod +uction With the Partitioning and Data Mining options

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://572812]
Approved by GrandFather
Front-paged by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-16 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found