May 28, 2017, 7:02 AM
Post #1 of 3
Is there a way to set new environment varaibles using perl?
Using the $ENV is not good enough.
Will return an empty string.
print `echo \$ORACLE_SID`;
Which means, the ORACLE_SID variable wasn't set in the system.
The reason I need a way to make it work is because I need to be able to run an Oracle query using sqlplus, and I'm not allowed to use the tnsnames.ora(which will allow me to use the username@InstanceName convention).
So my only option is to set the ORACLE_SID variable and then use the sqlplus as follows:
sqlplus -S user/passwd @"queryFileName.sql"
Thanks for the help.