Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: calling 'C' external procedures from Oracle from HPUX

Re: calling 'C' external procedures from Oracle from HPUX

From: Thomas Kyte <>
Date: 18 Feb 2005 09:56:54 -0800
Message-ID: <>

In article <>, Rauf Sarwar says...
>Thomas Kyte wrote:
>> You do realize the plsql environment will be the SERVERS environment
>-- not the
>> clients in general. So, the environment variables you are accessing
>> really be "constants", inherited from the listener (if you use
>dedicated server
>> over the network), inherited from the user that started the database
>(if you use
>> shared servers), inherited from your client application only when you
>> dedicated server and a fork/exec (bequeath/local) connection -- no
>> And not only that, but the external procedures environment will
>always be
>> inherited from the listener since the listener forks off the extproc
>> So, the environment would be the constant environment of the listner
>process if
>> you used an external procedure.
>> It would be "sketchy" as to whose environment it would be using a
>java stored
>> procedure.
>On Windows, it uses server's SYSTEM environment via Java's Runtime
>class. i.e. Path did not include the USER's path settings... which are
>appended at the end of the system path if you type path from cmd.exe.
>Don't know if this is standard. I used this Java stored procedure,
>public class RuntimeTest {
> public static void Test ( )
> throws Exception {
> Runtime r = Runtime.getRuntime();
> Process p = r.exec("cmd /c echo %path%>C:\\temp\\path.txt",
> p.waitFor();
> }
>Didn't have JServer installed on AIX database so cannot test the Unix

that makes sense since on windows, you don't "fork/exec", it creates a new thread in a process running as a service which gets its environment from there.

(bottom line effect is the same -- the client should pass into the database what it needs to pass in, using the environment is going to be "unpredicable" and won't be the clients environment)

>> The only safe thing I think you should do is have the shell script
>pass the
>> values into the database itself. Formal parameters to your sqlplus
>script if
>> that is what you are using.

Thomas Kyte
Oracle Public Sector
opinions are my own and may not reflect those of Oracle Corporation
Received on Fri Feb 18 2005 - 11:56:54 CST

Original text of this message