Hi All,
I am trying to call procedures from external DLL.
I am using Oracle10g and Oracle SQL Devloper with WindowXP to do this.
here what i have done till now
create or replace library libc_l as 'c:\windows\system32\crtdll.dll';
create or replace package random_utl
as
function rand return pls_integer;
pragma restrict_references (rand, WNDS, RNDS, WNPS, RNPS);
procedure srand (seed in pls_integer);
pragma restrict_references (srand, WNDS, RNDS, WNPS, RNPS);
end random_utl;
create or replace package body random_utl
as
function rand return pls_integer
is
external
library libc_l
name "rand"
language c;
procedure srand (seed in pls_integer)
is
external
library libc_l
name "srand"
language c
parameters (seed ub4);
end random_utl;
changes that i have done in listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(ENV = "EXTPROC_DLLS=ANY")
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
(ENV = "EXTPROC_DLLS=ANY")
)
)
environment variable that i have defined for window is as below
EXTPROC_DLLS=C:\windows\system32\crtdll.dll
I m calling all the stuff in below procedure
create or replace procedure external_dll_sp
as
rnd_value pls_integer;
seed pls_integer;
begin
select to_char(sysdate, 'SSSSS') into seed from dual;
random_utl.srand (seed);
for v_cnt in 1 .. 10 loop
rnd_value := random_utl.rand;
dbms_output.put_line ('rand() call #' || v_cnt || ' returns ' ||
rnd_value);
end loop;
end;
After restarting of both oracle and Oracle SQL developer.
When I execute external_dll_sp , I m getting below error....
Connecting to the database new_test.
ORA-28595: Extproc agent : Invalid DLL Path
ORA-06512: at "NEW_TEST.RANDOM_UTL", line 10
ORA-06512: at "NEW_TEST.EXTERNAL_DLL_SP", line 7
ORA-06512: at line 2
Process exited.
Disconnecting from the database new_test.
Please help me where i did wrong.
Thanx in advance.