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

I don't believe you. Please show the actual (minimal) code you're running that exhibits the problem. The relevant code should be no longer than 10 lines.

Replies are listed 'Best First'.
Re^8: DBI connect to Oracle
by Anonymous Monk on Feb 23, 2015 at 13:41 UTC

    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" +"

      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.

      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?