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

As I said, I´m just starting on Perl.

All the code I have is this:

#!/usr/bin/perl unixy use DBI; my $dbh = DBI->connect('dbi:ODBC:host=172.16.90.220;sid=WEBDB;port=152 +1','CEP','a423pa');

I don´t know if I had to have more code than this. I´m using this on Windows and Padre.

Again, the message error:

DBI connect('host=172.16.90.220;sid=WEBDB;port=1521','CEP',...) failed +: [Microsoft][ODBC Driver Manager] Nome da fonte de dados não encontr +ado e nenhum driver padrão especificado (SQL-IM002) at C:\Documents a +nd Settings\administrator\Meus documentos\connectionOracle.PL line 3" +"

Replies are listed 'Best First'.
Re^9: DBI connect to Oracle
by Corion (Patriarch) on Feb 23, 2015 at 13:49 UTC

    You will note that the error message is distinctly different from the previous error message. Why do you claim that they are the same error message?

    Please see http://www.connectionstrings.com/ for how to construct the proper ODBC connection string to connect to your data source. Personally, I like to start out with a plain DSN as created through odbcad32.exe instead of trying to construct a complicated connection string manually.

    Traditionally, to use a DSN-less connection string, you need to find the proper name of the ODBC driver, which likely is in Portuguese, and likely is what is shown when creating a new data source.

Re^9: DBI connect to Oracle
by Anonymous Monk on Feb 24, 2015 at 12:18 UTC
    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.

      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