Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

perl with dbd::odbc - error "Unable to get DBI state"

by wolfipa (Initiate)
on Jan 13, 2014 at 18:32 UTC ( #1070448=perlquestion: print w/replies, xml ) Need Help??
wolfipa has asked for the wisdom of the Perl Monks concerning the following question:


I have a small perl script that downloads data from an ODBC source. I'm running perl on debian 7.3 / powerpc with libdbd-odbc-perl. The system should be apt-to-date.

The ODBC driver itself seems to work fine as I can successfully connect to my datasources using isql, unfortunately the perl script fails.

I have found a small test script on the web that just checks the installed modules and this one also shows the error:


use DBI;

my @drivers = DBI->available_drivers();

die "No drivers found. \n" unless @drivers;

# list the data sources
foreach my $driver ( @drivers )
    print "Driver: $driver\n";
    my @dataSources = DBI->data_sources( $driver );
    foreach my $dataSource ( @dataSources )
        print "\tData Source: $dataSource\n";
    print "\n";

The resulting error:
Driver: ODBC
install_driver(ODBC) failed: Unable to get DBI state from DBI::_dbistate at 106e6d30. DBI not loaded. at /usr/lib/perl/5.14/ line 207.
Compilation failed in require at (eval 26) line 3.

 at ./ line 13
Any ideas? Many thanks in advance!
  • Comment on perl with dbd::odbc - error "Unable to get DBI state"

Replies are listed 'Best First'.
Re: perl with dbd::odbc - error "Unable to get DBI state"
by PerlSufi (Friar) on Jan 13, 2014 at 20:07 UTC
    Have you installed a perl version over an existing one? This can cause problems with packages..
      No, I just used apt-get to install perl, libdbd-odbc-perl,... and all other required modules.
        Check your apt-get logs to see what went wrong, then try apt-get again, and one more time, and if the problem persists, report it to the apt-get people :)

        When folks (repository admins ... ) package stuff for binary packagers (apt-get, ppm, whatever), sometimes they make mistakes and conflicting something gets packaged with conflicting something or something file doesn't get overwritten with the correct new one ....

        the packages are supposed to catch this kind of error but they don't some times

Re: perl with dbd::odbc - error "Unable to get DBI state"
by mje (Curate) on Jan 14, 2014 at 10:05 UTC

    Just run the script:

    #!/usr/bin/perl use DBD::ODBC;

    and tell us what the output is? If it fails then find in your perl tree and run ldd on it so we can see the output.


      after digging around for 3 days finding the cause of the issue I have turned on the testing apt-source which allowed me to update libdbd-odbc-perl to version 1.45 (also included a new version of perl -> v5.18).

      After that all my testscripts as well as the original scripts ran without any issue.

      So for now the issue is solved, unfortunately I cannot do any testing on the "original" setup.

      But many thanks for your responses!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1070448]
Approved by boftx
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2017-07-23 09:49 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (346 votes). Check out past polls.