Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: running an SQL script via Perl 5.003

Re: running an SQL script via Perl 5.003

From: Johnny Chan <j4ychan_at_PROBLEM_WITH_INEWS_GATEWAY_FILE>
Date: 1997/03/21
Message-ID: <5gukct$ce8@gw.PacBell.COM>#1/1

> Greetings all -
 

> I am running Oracle 7.3.2 and would like to use a Perl script to run an SQL
> script.
 

> Currently, the Unix shell script simply says the following (or close to it) -
 

> sqlplus username/password < myscript.sql
 

> (1) I don't like the username/password in the script, but this user only has
> select access against one table. Any ideas on how to hide it ?

one way to hide it is to have the connect username/password in the sql script itself. but what you need to set up a separate username/password with only create session privilege, which is the one you use as the sqlplus uid/pwd argument.

> (2) How do I rewrite the above line for Perl 5.003 ? I tried using
> the OPEN(blah,|blah) (this is from memory so don't quote me) but
> it didn't work. Does anyone have any ideas ?

you will need to find and link in DBI interface for perl and the DBD::Oracle interface for using Oracle calls in perl scripts. Once you link them in, the actual command to login is via the &ora_login() call. Once you link in DBD::Oracle, check out the README for documentation on using oraperl.

Johnny Chan
Independent Oracle Specialist Received on Fri Mar 21 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US