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: External Procedures on Oracle 8.

Re: External Procedures on Oracle 8.

From: <rangelot_at_my-dejanews.com>
Date: Tue, 30 Mar 1999 18:34:30 GMT
Message-ID: <7dr5fl$uar$1@nnrp1.dejanews.com>


In article <36F62BA1.8CAB456A_at_email.mot.com>,   Keith Jamieson <pdkj02_at_email.mot.com> wrote:
> <HTML>
> 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.
> <BR>I am trying to execute the procedure using Sqlplus
>
> <P>The entire session was as follows:
> <BR>&nbsp;
> <BR>Start the extproc process
>
> <P>1) Create a&nbsp; c object file test.o using <B>cc -Aa test.c</B>
> <BR>2) Create a shared library and store object file: <B>ar -r test_lib.so
> test.o</B>
> <BR>3) enter Sqlplus
> <BR>4) <B>create library LIB as '/home/keithj/test_lib.so';</B>
> <BR>5) c<B>reate or replace procedure test as EXTERNAL</B>
> <BR><B>LIBRARY LIB</B>
> <BR><B>NAME "test"</B>
> <BR><B>LANGUAGE C;</B>
> <BR>6) <B>exec test</B>
> <BR>&nbsp;
> <BR>After step 6 I receive the following error messages:
> <BR>ERROR at line 1:
> <BR>ORA-06520: PL/SQL: Error loading external library
>
> <P>When I look this up using oerr I get the following:
> <BR>Cause: An error was detected by PL/SQL trying to load the external
> library dynamically.
> <BR>Action: Check the stacked error (if any) for more details;
> <BR>ORA-06522: Exec format error
> <BR>ORA-06512: at schema_name.procedure_name, line 0
> <BR>ORA-06512: at line 1
>
> <P>The c object is insignificant in that all it does is execute a printf
> statement.
> <BR>I include it here for completeness.
> <BR>void test(void);
> <BR>#include &lt;stdio.h>
> <BR>void test(void)
> <BR>{
> <BR>&nbsp;&nbsp;&nbsp;&nbsp; printf("Hello Keith\n");
> <BR>}
>
> <P>I suspect the problem is either
> <BR>1) You cannot call an External Procedure from SqlPlusd
> <BR>or/and
> <BR>2) That the shared library has not been created properly.</HTML>
>
>

Keith,

You CAN call an external procedure from SQLPLUS. Make sure you have configured NET8 correctly and that you are not having any permission problems at the UNIX file system level.

Regards.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Mar 30 1999 - 12:34:30 CST

Original text of this message

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