Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Calling an external DLL from pl/sql hangs

Calling an external DLL from pl/sql hangs

From: Brian Pacitti <brian.pacitti_at_infotechnics.co.uk>
Date: Wed, 24 Jul 2002 12:08:02 +0000 (UTC)
Message-ID: <ahm5b1$72o$1@knossos.btinternet.com>


Hi there,

I am using and external function to call a method in a DLL. I did not wite the DLL but I understand it is written in C++ and has the EXTERN "C" declaration. The C++ function I call then makes calls to a Visual Basic DLL. Basically we had a VB DLL but read that oracle external functions could only handle C so we put the C++ wrapper round the VB DLL.

The problem is my SQL hange at the point I make the call to the function. I have tested my set up by calling a system DLL that returns the curent user and it works so my environment is set up OK.

Below I have included the test that works and the code for my DLL which hangs. Does anyone have any ideas? Is there some specific things I need to do in compiling/linking the C++ DLL?

Any help would be much appreciated.

CREATE OR REPLACE function test_f (V IN CHAR) return number AS  external library test_library
 name "test_procedure"
 language C;
/

declare

   ll_rtn number;
   ls_char char(40) := 'aaa';
begin

   ll_rtn := test_f (ls_char); -- ****this hangs ***    dbms_output.put_line ('returned '||ll_rtn); end;
/

CREATE OR REPLACE LIBRARY DLLTEST_L AS 'c:\winnt\system32\ADVAPI32.DLL'
/

CREATE OR REPLACE function dlltest_p
(V IN OUT CHAR, W IN OUT long) return boolean AS  external name "GetUserNameA"
 library dlltest_L;
/

declare

   ll_rtn boolean;
   ll_long long;
   ls_user char(20);

begin
   ls_user := 'ddddd';
   ll_long := 5;
   ll_rtn := dlltest_p (ls_user, ll_long);
   dbms_output.put_line ('returned name '|| ls_user); end;
/
Received on Wed Jul 24 2002 - 07:08:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US