in reply to Install Oracle DBI DBD

I've never done this myself so take this with a pinch of salt but you'll need to install the Oracle client libraries on your Windows machine first. Instant Client (free from Oracle) is probably the best bet.

Replies are listed 'Best First'.
Re^2: Install Oracle DBI DBD
by breezykatt (Acolyte) on Jun 08, 2010 at 17:26 UTC
    Thanks for the quick response. I did previously install Oracle client 10g. I just assumed all I would need to do is install this module and would work out of the box, so to speak. TNSNames.ora is already setup...
    #!/usr/bin/perl -w use DBI; $dbh = DBI->connect('dbi:oracle:sid','username','password') or die "Connection Error: $DBI::errstr\n"; $sql = "select * from samples"; $sth = $dbh->prepare($sql); $sth->execute or die "SQL Error: $DBI::errstr\n"; while (@row = $sth->fetchrow_array) { print "@row\n"; }
      Looks like it found the correct directory? Do I need to upgrade the perl files within the Oracle directory? Here is the error message:

      C:\>db.pl > db.out Use of :unique is deprecated at C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 39.

      Use of :unique is deprecated at C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 80.

      Perl lib version (v5.8.3) doesn't match executable version (v5.10.1) at C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 32.

      Compilation failed in require at C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib/MSWin32-x86-multi-thread/DynaLoader.pm line 25.

      BEGIN failed--compilation aborted at C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib/MSWin32-x86-multi-thread/DynaLoader.pm line 25.

      Compilation failed in require at C:\oracle\product\10.2.0\db_2\perl\site\5.8.3\lib/MSWin32-x86-multi-thread/DBI.pm line 156.

      BEGIN failed--compilation aborted at C:\oracle\product\10.2.0\db_2\perl\site\5.8.3\lib/MSWin32-x86-multi-thread/DBI.pm line 156.

      Compilation failed in require at C:\Documents and Settings\809271\Desktop\db.pl line 3.

      BEGIN failed--compilation aborted at C:\Documents and Settings\809271\Desktop\db.pl line 3.
        I didn't need to revert back to an older version of ActivePerl. Here is the solution to this problem:

        The PERL5LIB was one oracle which uses 5.8.3 sets up. So I made sure PER5LIB was changed to PERL5LIB=C:\perl\lib;C:\Perl\lib\DBD\Oracle;C:\Perl\lib\auto\DBD\Oracle;

        From site:
        http://community.activestate.com/faq/upgrade-error-version-mis

        Don't forget to reset the env variable or reboot.
        I reverted back to an older version of perl, however I am getting the same error msg. I'm not sure the versions are the actual issue, but from what its indicating that appears to be the problem. You need a business account from the ActivePerl site to download a version older than 5.8.9.

        C:\Documents and Settings\809271\Desktop>db.pl Perl lib version (v5.8.3) doesn't match executable version (v5.8.9) at C:\oracle \product\10.2.0\db_2\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 32. Compilation failed in require at C:\oracle\product\10.2.0\db_2\perl\5.8.3\lib/MS Win32-x86-multi-thread/DynaLoader.pm line 25. BEGIN failed--compilation aborted at C:\oracle\product\10.2.0\db_2\perl\5.8.3\li b/MSWin32-x86-multi-thread/DynaLoader.pm line 25. Compilation failed in require at C:\oracle\product\10.2.0\db_2\perl\site\5.8.3\l ib/MSWin32-x86-multi-thread/DBI.pm line 156. BEGIN failed--compilation aborted at C:\oracle\product\10.2.0\db_2\perl\site\5.8 .3\lib/MSWin32-x86-multi-thread/DBI.pm line 156. Compilation failed in require at C:\oracle\product\10.2.0\db_2\perl\site\5.8.3\l ib/MSWin32-x86-multi-thread/Oraperl.pm line 25. BEGIN failed--compilation aborted at C:\oracle\product\10.2.0\db_2\perl\site\5.8 .3\lib/MSWin32-x86-multi-thread/Oraperl.pm line 25. Compilation failed in require at (eval 1) line 1. BEGIN failed--compilation aborted at (eval 1) line 1.