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

Being the new guy learning perl, I was curious about what do I need besides Perl,DBI, & DBD::Oracle - to connect to an Oracle DB? My ultimate goal is to have perl read a flat file and insert the contents in to tables on an Oracle DB. I would like to do so in perl, and know that it has been done with CGI, and MySql DBs. But, all that is for another question, for now I'm in the process of just setting up the enviroment. Thank you all in advance, and I apologize if this sounds like something that was previously covered.

Replies are listed 'Best First'.
Re: Connecting to Oracle DB
by Foo::Bar (Acolyte) on Dec 20, 2001 at 05:29 UTC
    Perl, DBI, and DBD::Oracle should be all you need to do the job. Maybe I misunderstood, but if you've already done it once with a MySQL DB, you'll have no problems with this. Most of the code will be the same. That's what DBI tries to accomplish ... sort of a universal DB API for perl. Just add your DBD::Oracle and change your connect string and you're off to the races.
      First of all thank for you input. I would like to clarify on my last post. No, I have not as of yet done anything with any of the modules. I have only read about being able to do what I'm trying to accomplish with Oracle on MySql. So now that I have everything installed, all I have to do is start with the code writing. In fact Ive started and now im getting an error regarding "DBI" and "DBD::Oracle". Everything installed just fine, but the error reads: DBI->connect(T:melchior:dev01) failed: ORA-06401: NETCMN: invalid driver designator (DBD ERROR: OCIServerAttach) at ./insert-LDB_EXTID.pl line 11 Could not connect: ORA-06401: NETCMN: invalid driver designator (DBD ERROR: OCIServerAttach) Now this is obviously an issue with the connect string. I'm fairly familar with Oracle and the Listener, and I can connect to the DB with Sql*Plus just fine. OH!~p.s. The Oracle server instance and client software are both on the same machine that I am trying to run the code on; so everything is local. Let me know what you think. I'm currently going through the docs on DBD::Oracle but haven't found anything specific to this yet. Thanks again.
Re: Connecting to Oracle DB
by runrig (Abbot) on Dec 20, 2001 at 05:55 UTC
    Is Oracle installed on the machine you want to run perl on? Are you having any trouble installing or running perl, DBI, or DBD::Oracle?
      First of all thank for you input. I would like to clarify on my last post. The Oracle server instance and client software are both on the same machine that I am trying to run the code on; so everything is local. Let me know what you think. I'm currently going through the docs on DBD::Oracle but haven't found anything specific to this yet. Thanks again. I have only read about being able to do what I'm trying to accomplish with Oracle on MySql. So now that I have everything installed, all I have to do is start with the code writing. In fact Ive started and now im getting an error regarding "DBI" and "DBD::Oracle". Everything installed just fine, but the error reads: DBI->connect(T:melchior:dev01) failed: ORA-06401: NETCMN: invalid driver designator (DBD ERROR: OCIServerAttach) at ./insert-LDB_EXTID.pl line 11 Could not connect: ORA-06401: NETCMN: invalid driver designator (DBD ERROR: OCIServerAttach) Now this is obviously an issue with the connect string. I'm fairly familar with Oracle and the Listener, and I can connect to the DB with Sql*Plus just fine. Thanks again.
        It sounds like maybe you installed DBI & DBD from an RPM like package, and didn't go through the 'perl Makefile.PL','make','make test' and 'make install'. I find that sometimes these things are best done manually one step at a time, so you can look through the README's in the CPAN distribution as (or before) issues arise) during installation. Unless someone more familiar with Oracle has a clue and can help :-)

        BTW, you don't need to reply to every post in the thread with the same message :)