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: environment variables in PL/SQL

Re: environment variables in PL/SQL

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 20 Jul 2002 10:30:25 +0100
Message-ID: <1027158123.29738.0.nnrp-14.9e984b29@news.demon.co.uk>

If you get Tom Kyte's book
(Expert One-on-One Oracle. from Wrox press) the Java chapter has an item on running O/S commands from within PL/SQL. You could
use this method as a basic tool for discovering values of environment variables; and may give you ideas about how to implement your
requirements.

--
Jonathan Lewis
http://www.jlcomp.demon.co.uk

Next Seminars
 UK  Sept
 Australia August
 Malaysia September
 USA x 2  November

http://www.jlcomp.demon.co.uk/seminar.html

LR wrote in message ...

>Hi Oracle gurus,
>
>I do have a problem which should not be too difficult to solve.
>Maybe it is more related to Unix but I am not so proficient in Unix.
>
>We are developing an application which is tested in different
>environments.
>The application uses UTL_FILE to write flat files. The UTL_FILE_DIR
>parameter is in the following form:
>
>/busdata/<DB_NAME>/<ENVIRONMENT>/interface/inbound
>
>where DB_NAME stands for the database name and <ENVIRONMENT> is for
>example DEV, TEST, QA, EDU, PROD.
>
>In addition, we are using a package, CONST_PKG, containing all
>constants with a variable
>
>EDI_ROOT VARCHAR2(255) := '/busdata/<DB_NAME>/<ENVIRONMENT>
>
>with hardcoded values for each environment. Which is a bad design, I
>acknowledge.
>
>Now, how can we make this all dynamic ? I mean, if in UNIX, we do have
>environment variables $DB_NAME and $ENVIRONMENT, is there a way to
>dynamically compile the CONST_PKG, according to the values of $DB_NAME
>and $ENVIRONMENT ?
>
>What any other options would you consider ?
>
>Thanks and regards,
>
>Lalaina RAKOTONIAINA
>ERP Analyst Developer
Received on Sat Jul 20 2002 - 04:30:25 CDT

Original text of this message

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