On Fri, Dec 23, 2011 at 3:08 AM, Charles Jardine <c...@cam.ac.uk> wrote:

> On 22/12/11 20:40, Bill Ward wrote:
>
>> Agreed. Any Oracle initialization environment variables need to be set
>> before your Perl script starts. Another approach is to set them and then
>> re-exec() from within the script ... though be careful to avoid infinitely
>> re-execing the same script!
>>
>
> This is not correct. With the script as written, no Oracle related code
> is executed until connect time, so enviroment variables which are
> interpreted
> by Oracle can be set any time before the first connect.
>
> On the other hand, variables interpreted by the run-time loader, such as
> LD_LIBRARY_PATH, must be set before perl itself is loaded. So, re-execing
> is necessary for a change to LD_LIBRARY_PATH, but not, but not for a
> change of NLS_LANG.
>

Ah yes, this is what I was thinking of.... and often when loading Oracle
you have to make sure LD_LIBRARY_PATH is set properly to the Oracle
location. My apologies.

To make sure that the NLS_LANG (and things like ORACLE_HOME and TWO_TASK as
well) is set properly, it should suffice to load them in a BEGIN block or
via a 'use' statement that loads your own configuration module, prior to
loading DBD::Oracle.

-- 
Check out my LEGO blog at http://www.brickpile.com
Follow/friend me: facebook.com/billward • flickr.com/photos/billward •
twitter.com/williamward

Reply via email to