Calling advapi32.dll from stored procedures

From: Dutchy <pim.spierenburg_at_cmg.nl>
Date: Sat, 21 Jul 2001 21:55:40 GMT
Message-ID: <86aaf91f.0106200156.6b272ffb_at_posting.google.com>


Hi,

I am trying to call the function RegOpenKeyExA, which is in the ADVAPI32.DLL, from a stored procedure.

I did the following.

  1. I created a library like: CREATE LIBRARY ADVAPI AS 'C:\WINNT\SYSTEM32\ADVAPI32.DLL'
  2. I created the following function: CREATE OR REPLACE function API_regopenkeyEX( hkey binary_integer, lpSubkey varchar2, ulOptions binary_integer, samDesired binary_integer, phkResult in out binary_integer) return binary_integer as external library advapi name regopenkeyexa parameters ( hkey long, lpSubkey string, ulOptions long, samDesired long, phkResult long, ) ;
  3. Then I created the following procedure to test this: CREATE OR REPLACE procedure test_reg as dummy binary_integer; bla_test binary_integer; begin dummy := API_regopenkeyEX(2147483650,'SOFTWARE\ORACLE',0,131072, bla_test); dbms_output.put_line(dummy); end;

Upon execution of TEST_REG i get the following error message: BEGIN test_reg; END;

*
[Quoted] ERROR at line 1:

ORA-01426: numeric overflow
ORA-06512: at "PIM.TEST_REG", line 6
ORA-06512: at line 1

What am I doing wrong?

Cheers
Pim Received on Sat Jul 21 2001 - 23:55:40 CEST

Original text of this message