Link to environment variable in oracle sql files on Linux and Windows

We have sql build script, with oracle 10.2. At the end of the script, we have the following:

@$ORACLE_HOME/rdbms/admin/utlrp.sql

What works on Linux but not Windows. So, we created a second file with this line:

@%ORACLE_HOME%/rdbms/admin/utlrp.sql

Of course, there is a better way. How can I refer to an environment variable in a cross-platform manner? Or, alternatively, is it possible to perform OS detection in the sql file to protect each of the statements with an IF clause?

+3
source share
1 answer

I believe you need this syntax:

@? / RDBMS / admin / utlrp.sql

However, this is only for the variable ORACLE_HOME. I do not know about others ...

Edit:

, SQLPATH. SQL- oracle, PATH - Unix/Windows.

+2

Source: https://habr.com/ru/post/1702138/


All Articles