I've implemented a class to execute host command from pl/sql and the related pl/sql interface to call it.
But now I've this problem testing it.
I connect to SQLPLUS with the same user used to load the class into the DB with loadJava and i call the store procedure to execute the metod in the class.
I simply want to call an exe file but I can't do it because by default the process look for it in ORACLE_HOME/dbs even if i connect to SQL PLUS with the OS owner of the exe file and from the path where it is located.
However before running the Store Procedure i do an !ls from SQL prompt i can see the files in the current work directory including my exe.
But running the Store Procedure it look for it in ORACLE_HOME/dbs.
What is the problem?
Is there any environment variable problem?
Please help me it's URGENT.
If you try to call an executable from pl/sql via your java code, the OS process, which JVM creates for that, does NOT inherit any system variables, paths, settings, e.t.c. from your environment and the process tries to find the executable in the current for the process directory - ORACLE_HOME/dbs.
To call an executable, you have to specify FULL PATH for the executable (for example: d:\oracle\bin\sqlldr.exe) when you call it using java procedure (I guess you use RunProcess, donít you?).
Hope this helps,