in reply to Re^8: DBI connect to Oracle
in thread DBI connect to Oracle

I already have a connection using ODBC Driver, when i use the "Oracle ODBC 32 bit test", i can connect to my remote Oracle Database.

But I have not figured out how I have to do the Perl script. What i need is a script "to see" my ODBC and use it as a bridge to the server with Oracle. After that, i will need use this connection to SELECT the tables from ORACLE.

I have no idea how to do this script.

Replies are listed 'Best First'.
Re^10: DBI connect to Oracle
by Corion (Patriarch) on Feb 24, 2015 at 12:20 UTC

    What is the name of your data source ("DSN")? If you have that, you can simply use DBD::ODBC by giving that name to it:

    $dbh = DBI->connect('dbi:ODBC:DSN=mydsn', 'user', 'password');

    Have you tried that? How did it fail?

      Thanks a lot for the help. My code:

      #!/usr/bin/perl unixy use DBI; my $dbh = DBI->connect('dbi:ODBC:DSN=conexao220', 'CEP', 'a423pa');

      The error message:

      DBI connect('DSN=conexao220','CEP',...) failed: [Microsoft][ODBC Drive +r Manager] Nome da fonte de dados nŅo encontrado e nenhum driver padrŅo especifi +cado (SQL- IM002) at C:\Documents and Settings\administrator\Meus documentos\conn +ectionOrac le.PL line 3

        So ODBC doesn't think that a data source does not exist under that name conexao220.

        If you are really, really sure that the name should exist, then my next guess is that you created the DSN under Windows 32bit ODBC (C:\Windows\System32\odbcad32.exe) but are using a 64bit Perl, or you created the DSN under Windows 64bit ODBC (C:\Windows\SysWOW64\odbcad32.exe), but are using a 32bit Perl.

        I would create two DSNs, conexao220-32 and <c>conexao220-64, using the two different programs and then check using the different Perl versions to find out which one can connect.