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

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?

Replies are listed 'Best First'.
Re^11: DBI connect to Oracle
by Anonymous Monk on Feb 24, 2015 at 12:29 UTC

    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.

        Great. Got my mistake: I was creating "archive data source". The correct is create a "user" or "system data source".

        Now, I have to create a table on mySQL, and I think that I have to use a Federated table, but I don“t know how. Maybe something like:

        create table CEP3 (ID varchar(100) not null, MATRICULA varchar(200)) engine = federated connection = '????';