Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I´m just starting in Perl, so I don´t any experience how to develop and how is the flow of the code.

What I´m trying to do is: Connect my MySQL database to an Oracle database.

I need to do a SELECT from MySQL and get the data from Oracle.

I find a tutorial that shows that this is possible: http://ftp.nchu.edu.tw/MySQL/tech-resources/articles/dbixmyserver.html

But, as I said, I don´t have experience how to develop. So, I have in my Windows machine the following:

a) padre-on-strawberry

b) DBD-Oracle-1.74.tar.gz

c) ActivePerl-5.20.1.2000-MSWin32-x86

d) DBI-1.633.tar

e) DBD-mysql-4.029.tar.gz (this, i cannot install. Got the error: mysqladmin.exe was not found in your PATH).

What I think that I have to do now, is to configure the proxy. I tried to open Padre, paste this code: use DBI

$dbh = DBI->connect('dbi:Oracle:host=172.16.90.220;sid=WEBDB;port=1521 +', 'CEP', 'a423pa');

and run the Script, but I got the error: "No execution mode was defined for this doecument type:text/plain"

Replies are listed 'Best First'.
Re: DBI connect to Oracle
by Ea (Chaplain) on Feb 20, 2015 at 16:58 UTC
    Looking at the error message, I found this which suggests that Padre doesn't think the file is a Perl script, so that might be the very first thing to look at. The Padre site has instructions on how to get in touch with them over IRC, if you don't find the answer here.

    Sometimes I can think of 6 impossible LDAP attributes before breakfast.
Re: DBI connect to Oracle
by Ea (Chaplain) on Feb 20, 2015 at 15:25 UTC
    In my Linux setup, the two things I need are the $ENV{ORACLE_HOME} = '/path/to/oracle'; and the following database handle
    my $dbh = DBI->connect("dbi:Oracle:$database_name", $username, $passwo +rd);
    with the SID information placed in the network/admin/tnsnames.ora file

    Sometimes I can think of 6 impossible LDAP attributes before breakfast.
      Ok, but I have the Oracle installed in other server. And I´m doing all the configuration on the server that I have MySQL installed.
        Ok, that's one thing that you'll need - Oracle libraries on the Mysql machine to make DBD::Oracle work (unless the Windows installation comes with its own Oracle libraries). How did you install DBD::Oracle and what did the test results say?

        Sorry - I don't have the experience with Windows and Oracle, so I'm guessing.

        Another possibility would be to put the script on the Oracle machine and write to the Mysql machine, if it's easier to get DBD::mysql running on that machine.

        Sometimes I can think of 6 impossible LDAP attributes before breakfast.
Re: DBI connect to Oracle
by Anonymous Monk on Feb 21, 2015 at 00:44 UTC

    learn to run perl programs outside of padre, its where 99% of the perl world lives