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: setting ORACLE_SID within PERL

Re: setting ORACLE_SID within PERL

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Sun, 12 Sep 2004 05:00:07 GMT
Message-ID: <rJQ0d.13564$w%6.4352@newsread1.news.pas.earthlink.net>


Sybrand Bakker wrote:
> hastenthunder" <hastenthunder_at_hotmail.com> wrote:

>>I need to be able to set Linux's environment variable for Oracle within a
>>PERL script.
>>The Linux command to set environment variable is "export".
>>So I tried to set it using the system() command:
>>
>>   system('export ORACLE_SID = TEST');
>>
>>But that did not seem to work [...]

>
> Actually that's not the Linux command but the *kornshell* command.
> You could of course look up the syntax to set an environment variable
> in a Perl manual, as this is not an Oracle issue at all.
> IIRC it, is just $env("ORACLE_SID") = value, but you'll need to verify
> that.

$ENV{ORACLE_SID} = "TEST"; Probably within a BEGIN block (so it happens really early in the Perl processing).

> Please bear in mind questions are answered by volunteers, and RTFM-ing
> yourself usually will provide a quicker answer.

And, if you're using DBD::Oracle (and DBI), you should ask on the dbi-users_at_perl.org mailing list -- but only after RTFM-ing.

http://www.catb.org/~esr/faqs/smart-questions.html

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Received on Sun Sep 12 2004 - 00:00:07 CDT

Original text of this message

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