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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Calling External Procedures on Oracle 8

Re: Calling External Procedures on Oracle 8

From: Mladen Gogala <mgogala_at_yahoo.com>
Date: Mon, 19 Apr 1999 13:39:29 GMT
Message-ID: <7ffbmf$83e$1@nnrp1.dejanews.com>


In article <7feogl$oes$1_at_nnrp1.dejanews.com>,   xhanin_at_my-dejanews.com wrote:
> Well, I know that this is not really the good group to post this message, but
> my problem is close to the problem described here.
> I am working under HP UX 10.20, and I have to use a shared library (in fact,
> this shared library is to be used with Java Native code).
> The problem is that this shared library must call routines only available in
> static libraries (not compiled in Position Independent code).
> Is it possible to create such a shared library without recompiling the static
> library (we do not have the sources any more !) ?

Yes. If your static library is libxxx.a, then you extract all the routines from it (ar t libxxx.a>/tmp/xxxnames;ar x `cat /tmp/xxxnames`) and then do ld -G libxxx.so `cat /tmp/xxxnames`. Voila, here is your shared library. BTW, I'm using Solaris 7 and I don't know much about HP-UX.

>
> In article <36F7931B.AC17E1C_at_email.mot.com>,
> Keith Jamieson <pdkj02_at_email.mot.com> wrote:
> > <HTML>
> > Okay, sorry for replying to my own post but I think this may be of some
> > use to others out there.
> >
> > <P>Theere were two problems:
> >
> > <P>Problem 1: When compiling the object, you need to create position
> independent
> > object code. This is done by specifying the +z option on HP UX 10.2. It
> > has to be compiled this way so that it can be put into a shared library.
> > <BR>eg cc -Aa +z test.c
> >
> > <P>Problem 2:&nbsp; As I suspected was creating the shared library. The
> > correct command for HP Ux 10.2 is :
> >
> > <P>ld -b -o library_name object_file.
> >
> > <P>Keith Jamieson wrote:
> > <BLOCKQUOTE TYPE=CITE>&nbsp;I am trying to create an external procedure
> > using Oracle 8 on hp-unix 10.2
> > <BR>I have successfully created and registered an external library.
> > <BR>I have also successfully defined a procedure to call the External
library.
> >
> > <P>I am trying to execute the procedure using Sqlplus
> > <BR>&nbsp;
> > <BR>&nbsp;
> >
> > <P>I did start the extproc process, but this didn't make any difference.
> >
> > <P>The corrected session is as follows:
> >
> > <P>1) Create a&nbsp; c object file test.o using cc -Aa +z&nbsp; test.c
> > <BR>2) store it in a library ld -b -o test_lib.so test.o
> > <BR>3) enter Sqlplus
> > <BR>4) create library LIB as '/home/keithj/test_lib.so';
> > <BR>5) create or replace procedure test as EXTERNAL
> > <BR>LIBRARY LIB
> > <BR>NAME "test"
> > <BR>LANGUAGE C;
> >
> > <P>6) exec test
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> >
> > <P>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;
> > <BR>&nbsp;</BLOCKQUOTE>
> > &nbsp;</HTML>
> >
> >
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

--
Mladen Gogala

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Apr 19 1999 - 08:39:29 CDT

Original text of this message

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