Home
Web CMS (TeamSite)
Not able to execute an sql command from wf
krishna_kumar
Hi
There is a jar file called "xyz.jar" . This xyz.jar will in turn call Oracle's 'sqlldr' command in one of its methods. We are able to execute this jar when we run it from the cmd line. But when the same jar is called from a wf script, it does not execute but gives an error- "Cannot run program "sqlldr": error=2, No such file or directory".
We figured out that this issue is related to the missing of the required oracle env variables. We have set the variables in the /etc/.profile but still we are not able to execute the xyz.jar from wf.
After setting the variables in /etc/.profile all the users were able to exectute the jar but when we try and print the env variable while the wf is running, the oracle related variables are missing (this happens even though the task is owned by the user and not root).
These are the variables we have set :
export ORACLE_HOME=/oracle/product/10.2.0/client_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Please throw in your valuable comments and advice.
Thanks
$IW_USER.
Find more posts tagged with
Comments
Adam Stoller
Is this being run as an External Task, URL Task or CGI Task?
If run as a CGI Task, and possibly as a URL Task - you could modify the iwwebd.conf[.template] to use the
PassEnv
directive.
If run as an External Task, and possibly as a URL Task - you would have to hard code the environment setting within the code itself (in Perl this is done with a
BEGIN{...};
block)
krishna_kumar
Thanks ghoti for your help.
Yes, we are using an External Task and we tried to set the env values through script before the jar is actually called only to find that the varaibles are not being set.
After setting, we tried to print the env from the script and it shows a whole different list of values like
IWAUTH=52616e646f6d495644039dfaf44b0f78928eff61757d70f494e550d659fb2036e005a9d745c07c4368afa9c678a145b2
IW_HOME=/usr2/Interwoven/TeamSite
IW_MOUNT=/iwmnt
IW_MOUNT_PRIVATE=/.iwmnt
IW_RELBINDIR=/usr2/Interwoven/TeamSite/bin
IW_STORE=/content
LC_COLLATE=en_US.ISO8859-1
LC_CTYPE=en_US.ISO8859-1
LC_MESSAGES=C
LC_MONETARY=en_US.ISO8859-1
LC_NUMERIC=en_US.ISO8859-1
LC_TIME=en_US.ISO8859-1
PATH=/usr2/Interwoven/TeamSite/bin:/bin:/usr/bin:/sbin:/usr/sbin
RESULT=0
TRACEFILE=/usr2/Interwoven/TeamSite/local/logs/iwtrace.log
TZ=US/Central
_INIT_NET_STRATEGY _INIT_PREV_LEVEL _INIT_RUN_LEVEL _INIT_RUN_NPREV _INIT_UTS_ISA _INIT_UTS_MACHINE _INIT_UTS_NODENAME
_INIT_UTS_PLATFORM= _INIT_UTS_RELEASE _INIT_UTS_SYSNAME _INIT_UTS_VERSION
_INIT_ZONENAME
I believe the oracle related variables should also appear in the list. But when we set them through the script they are not set.
Thank You.
ISCBorisB
...we tried to set the env values through script...
As Ghoti already noted, for the External Task you will have to set Environment Variables in the Task code itself.
The reason is that regardless of User's .profile or prior exporting, WF Engine sets it's own Environment in certain execution threads.
If your External Task is coded in Perl, make sure that you set Variables within BEGIN{} Block prior to "use This_Or_That" directives.
krishna_kumar
Thank You ISCBorisB and Ghoti.
I have got the issue resolved by setting the environmental variables in the BEGIN block. Earlier I was setting it using export command which did not work.
(I am an amatuer learner of PERL)
Now I have used $ENV{variable}="value" in the begin block of my perl script. Thanks again for your help and, as always, INTERWOVEN ROCKS!!!