For testing I have created a simple DLL which I know works.
#define DllExport __declspec( dllexport )
DllExport int Test()
{
return 12;
}
Then in Oracle done the following
create or replace library planet_utils as 'c:\winnt\pldll.dll';
/
CREATE OR REPLACE FUNCTION Test RETURN BINARY_INTEGER AS EXTERNAL
LIBRARY planet_utils
NAME "Test"
LANGUAGE C;
/
create or replace procedure test_dll as
l_count binary_integer;
begin
l_count := Test;
end;
/
exec test_dll
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06522: Unable to load symbol from DLL
ORA-06512: at "TACCHI.TEST", line 0
ORA-06512: at "TACCHI.TEST_DLL", line 4
ORA-06512: at line 1
Does anybody have any ideas on what the problem is
Cheers
Andrew Tacchi
I am having problems trying to run a simple external procedure as I need to
run stuff on the server that is not possible within PLSQL alone.
For testing I have made a simple DLL that I know works.
#define DllExport __declspec( dllexport )
DllExport int Test()
{
return 12;
}
Then in Oracle done the following,
SQL> create or replace library planet_utils as 'c:\winnt\pldll.dll'
2 ;
3 /
Library created.
SQL> CREATE OR REPLACE FUNCTION Test RETURN BINARY_INTEGER AS EXTERNAL
2 LIBRARY planet_utils
3 NAME "Test"
4 LANGUAGE C;
5 /
Function created.
SQL> create or replace procedure test_dll as
2 l_count binary_integer;
3 begin
4 l_count := Test;
5 end;
6 /
Procedure created.
SQL> exec test_dll
begin test_dll; end;
*
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06522: Unable to load symbol from DLL
ORA-06512: at "TACCHI.TEST", line 0
ORA-06512: at "TACCHI.TEST_DLL", line 4
ORA-06512: at line 1
Any ideas ore solutions?
Cheers
Andrew Tacchi
CREATE OR REPLACE FUNCTION Test RETURN BINARY_INTEGER AS EXTERNAL
LIBRARY planet_utils
NAME "_Test"
LANGUAGE C;
/
Jan
Andrew Tacchi wrote:
> I am having problems with using external procedures.
>
> For testing I have created a simple DLL which I know works.
>
> #define DllExport __declspec( dllexport )
>
> DllExport int Test()
> {
> return 12;
> }
>
> Then in Oracle done the following
>
> create or replace library planet_utils as 'c:\winnt\pldll.dll';
> /
>
> CREATE OR REPLACE FUNCTION Test RETURN BINARY_INTEGER AS EXTERNAL
> LIBRARY planet_utils
> NAME "Test"
> LANGUAGE C;
> /
>
> create or replace procedure test_dll as
> l_count binary_integer;
> begin
> l_count := Test;
> end;
> /
>
> exec test_dll
>
> ERROR at line 1:
> ORA-06521: PL/SQL: Error mapping function
> ORA-06522: Unable to load symbol from DLL
> ORA-06512: at "TACCHI.TEST", line 0
> ORA-06512: at "TACCHI.TEST_DLL", line 4
> ORA-06512: at line 1
>