Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Problem with DBI->data_sources()

by ColtsFoot (Chaplain)
on Oct 24, 2003 at 11:57 UTC ( [id://301829]=perlquestion: print w/replies, xml ) Need Help??

ColtsFoot has asked for the wisdom of the Perl Monks concerning the following question:

I have the following code
#!/usr/bin/perl -w use strict; use DBI; my $trace_level=2; DBI->trace($trace_level); my $driver = 'ODBC'; print qq(DRIVER:$driver\n); my @data_sources = DBI->data_sources($driver); foreach my $source (@data_sources) { print qq( SOURCE:$source\n); }
Which generates the following output
DBI 1.13-nothread dispatch trace level set to 2 -> DBI->install_driver(ODBC) for perl=5.00405 pid=29564 ruid=500 e +uid=500 install_driver: DBD::ODBC loaded (version 0.27) <- install_driver= DBI::dr=HASH(0x8144e48) -> data_sources for DBD::ODBC::dr (DBI::dr=HASH(0x8144e48)~0x816ec +8c) Out of memory! -> DBI::END -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x8144e48)~0x816 +ec8c) <- disconnect_all= '' at DBI.pm line 424. <- DBI::END complete -> DESTROY in DBD::_::common for DBD::ODBC::dr (DBI::dr=HASH(0x816 +ec8c)~INNER) <- DESTROY= undef during global destruction. DRIVER:ODBC
What I would like to know is what the "Out of memory!" message is about.
I see from perldoc DBI that

"Note that many drivers have no way of knowing what data
sources might be available for it, and thus typically,
return an empty or incomplete list."

But why should this function call be causing the "Out of Memory"
message?

Replies are listed 'Best First'.
Re: Problem with DBI->data_sources()
by dbwiz (Curate) on Oct 24, 2003 at 12:38 UTC

    data_sources was updated in more recent versions of DBI.

    You are using DBI 1.13, which is four years old.

    Get an upgrade (DBI).
    update Since you seem to be using perl 5.00405, the latest DBI won't install. You may be able to install version 1.20, which still supports that ancient version of Perl. Time to think seriously about upgrading Perl as well!

    Your snippet runs just fine on my machine (with DBI 1.33 and DBI 1.38).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found