Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: environment variables in PL/SQL
On 19 Jul 2002 05:20:12 -0700, lrako_at_hotmail.com (LR) wrote:
>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
In Oracle for Unix the @ is a shortcut for $ORACLE_SID and in a properly setup system this equates your $DB_NAME. ? is a shortcut for $ORACLE_HOME.
constants are constants.
Hth
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Fri Jul 19 2002 - 12:52:21 CDT