Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

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 <tkyte_at_oracle.com>
Date: 18 Feb 2005 06:51:04 -0800
Message-ID: <118738264.00000daa.014@drn.newsguy.com>


In article <4cc447fb.0502172039.28820f02_at_posting.google.com>, Chris Clark says...
>
>Within PL/SQL we want to be able to access external data within shell
>variables for use within database triggers.
>
>Is the use of an external function/procedure written in 'C' and called
>via PL/SQL the best/only way to go? (use of GETENV).
>
>If so, could someone show us the compile and link scripts required and
>also the details configuring Oracle (listener?, publishing).
>Note: we have written 'C' procedures required but are having
>difficulty tying it all together.
>
>Can HPUX, as distinct from LINUX or SOLARIS, even achieve this?

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.

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
http://asktom.oracle.com/
opinions are my own and may not reflect those of Oracle Corporation
Received on Fri Feb 18 2005 - 08:51:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US