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
In article <1108742774.933658.275230_at_l41g2000cwc.googlegroups.com>, Rauf Sarwar
says...
>
>
>Thomas Kyte wrote:
><snip>
>> You do realize the plsql environment will be the SERVERS environment
>-- not the
>> clients in general. So, the environment variables you are accessing
>would
>> 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
>use
>> dedicated server and a fork/exec (bequeath/local) connection -- no
>net.
>>
>>
>> And not only that, but the external procedures environment will
>always be
>> inherited from the listener since the listener forks off the extproc
>process.
>>
>> 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",
>null);
> p.waitFor();
> }
>}
>Didn't have JServer installed on AIX database so cannot test the Unix
>behavior.
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.
>
>Regards
>/Rauf
>
-- Thomas Kyte Oracle Public Sector http://asktom.oracle.com/ opinions are my own and may not reflect those of Oracle CorporationReceived on Fri Feb 18 2005 - 11:56:54 CST