Hello,
I need to use an external dll with a method in C. In order to do that, I've done the following steps:
1.- Generate the DLL with the export function inside:
__declspec(dllexport) int __cdecl CFunc(int seed)
{
...
}
2.- Create a PL/SQL Library
CREATE OR REPLACE LIBRARY mylib IS
'C:\ORANT\PLSQL80\MyDLL.dll';
3.- Create a script to call external functions:
CREATE or REPLACE FUNCTION rand (
seed INTEGER)
RETURN INTEGER AS EXTERNAL
LIBRARY mylib
NAME "CFunct"
LANGUAGE C;
/
CREATE or REPLACE PROCEDURE run_demo IS
al INTEGER;
BEGIN
begin
al := rand(100);
...
exception when others
then
dbms_output.put_line('SQL Error: ' || sqlerrm);
end;
end;
/
But when I call the procedure an error occur:
SQL> execute run_demo;
SQL Error: ORA-28575: no se ha podido abrir la conexión RPC con el agente de procedimiento externo
If necessary change something to file tnsnames.ora?¿
Thanks a lot,
Silvia
I need to use an external dll with a method in C. In order to do that, I've done the following steps:
1.- Generate the DLL with the export function inside:
__declspec(dllexport) int __cdecl CFunc(int seed)
{
...
}
2.- Create a PL/SQL Library
CREATE OR REPLACE LIBRARY mylib IS
'C:\ORANT\PLSQL80\MyDLL.dll';
3.- Create a script to call external functions:
CREATE or REPLACE FUNCTION rand (
seed INTEGER)
RETURN INTEGER AS EXTERNAL
LIBRARY mylib
NAME "CFunct"
LANGUAGE C;
/
CREATE or REPLACE PROCEDURE run_demo IS
al INTEGER;
BEGIN
begin
al := rand(100);
...
exception when others
then
dbms_output.put_line('SQL Error: ' || sqlerrm);
end;
end;
/
But when I call the procedure an error occur:
SQL> execute run_demo;
SQL Error: ORA-28575: no se ha podido abrir la conexión RPC con el agente de procedimiento externo
If necessary change something to file tnsnames.ora?¿
Thanks a lot,
Silvia