Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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:

Hi,

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:

#!/usr/bin/perl

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";
}

exit
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/DynaLoader.pm line 207.
Compilation failed in require at (eval 26) line 3.

 at ./dbcheck.pl line 13
Any ideas? Many thanks in advance!

Comment on perl with dbd::odbc - error "Unable to get DBI state"
Re: perl with dbd::odbc - error "Unable to get DBI state"
by PerlSufi (Friar) on Jan 13, 2014 at 20:07 UTC
    Hi,
    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 libODBC.so in your perl tree and run ldd on it so we can see the output.

      Hi,

      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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2014-12-21 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls