Tuesday, August 02, 2005

ORACLE_PATH saved me

Recently, I was preparing some scripts for a class, and realized that a lot of the scripts that were already under QA would have to be changed. The problem was, some of the SQL*Plus scripts called other SQL*Plus scripts, that reside in the same directory. That is not a problem usually, but it is a problem when the first script is called from a different directory. So, script a, in dir a_dir, calls script b in b_dir, which called script b2 in b_dir.

When a calls b, it find it, because it can be fully-qualified with no problem. But then, unless the reference to b2 from within b is also fully qualified (which I didn’t think to do since it was in the same directory as b) script b2 will not be found, because the current directory is a_dir.

Instead of messing up the QA process and inflicting change there, I went looking for another solution. I found it in the ORACLE_PATH variable. I set this at the OS level, and SQL*Plus uses it to search for any referenced scripts. It saved me. I could just set this to point to b_dir, when starting up script a, and all works fine.

1 Comments:

Blogger Niall said...

Tom

do you mean ORACLE_PATH of which I am unaware, or SQLPATH which I do know about?

3:46 PM  

Post a Comment

<< Home