Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Perl used for Oracle?
> On 23 Nov 1999 19:26:25 PST, NJN <ibm_97_at_yahoo.com> wrote:
>
>> I will write some perl script to do Oracle admin job. I'm new to Perl. My
>> questions:
>>
>> 1. In perl, how can I call OS(in Unix) command, such as 'sqlplus'?
>> 2. Also, how can I 'select * from v$database' after I enter 'sqlplus' in
>> perl?
The simplest way for you to use sqlplus as a subprocess will probably be something like:
open(SQLPLUS, 'sqlplus user/pass_at_host @script.sql |');
while (<SQLPLUS>) {
process output
}
However this could be quite hard to do, sqlplus doesn't print particularly predictable output.
I strongly suggest you spend the time to set up DBI and DBD::Oracle as the other person suggested.
"rdw2 at mindspring dot com"@test.com (Richard Warkentin) writes:
> Using the "DBI" interface to the Oracle DBD drivers is a more elegant
> solution to your problem. The DBI & DBD modules are not part of the
> perl distribution so you'll need to download them from CPAN. I
> normally do my development on an NT system at home and move them to a
> unix system without trouble.
more information can be found at:
http://www.symbolstone.org/technology/perl/DBI
Mailing list archives are at:
http://www.rosat.mpe-garching.mpg.de/mailing-lists/PerlDB-Interest/ http://www.xray.mpe.mpg.de/mailing-lists/#dbi http://outside.organic.com/mail-archives/dbi-users/ http://www.coe.missouri.edu/~faq/lists/dbi.html And you can subscribe to the mailing list at: http://www.isc.org/dbi-lists.html
--
greg
Received on Wed Nov 24 1999 - 01:46:10 CST