Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> External Procedures on Oracle 8.
I am trying to create an external procedure using Oracle 8 on hp-unix 10.2
The entire session was as follows:
Start the extproc process
1) Create a c object file test.o using cc -Aa test.c
2) Create a shared library and store object file: ar -r test_lib.so
test.o
3) enter Sqlplus
4) create library LIB as '/home/keithj/test_lib.so';
5) create or replace procedure test as EXTERNAL
LIBRARY LIB
NAME "test"
LANGUAGE C;
6) exec test
After step 6 I receive the following error messages:
ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
When I look this up using oerr I get the following:
Cause: An error was detected by PL/SQL trying to load the external
library dynamically.
Action: Check the stacked error (if any) for more details;
ORA-06522: Exec format error
ORA-06512: at schema_name.procedure_name, line 0
ORA-06512: at line 1
The c object is insignificant in that all it does is execute a printf
statement.
I include it here for completeness.
void test(void);
#include <stdio.h>
void test(void)
{
printf("Hello Keith\n");
}
I suspect the problem is either
1) You cannot call an External Procedure from SqlPlusd
or/and
2) That the shared library has not been created properly.
Received on Mon Mar 22 1999 - 05:38:09 CST
![]() |
![]() |