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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: calling an external procedure

RE: calling an external procedure

From: Goulet, Dick <DGoulet_at_vicr.com>
Date: Thu, 03 Jul 2003 06:01:22 -0800
Message-ID: <F001.005C336B.20030703060122@fatcity.com>


Jeff,

        You can also get that error if your session can't connect to the extproc listener and spawn a copy of the extproc executable.

Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA

-----Original Message-----
Sent: Thursday, July 03, 2003 9:21 AM
To: Multiple recipients of list ORACLE-L

On Thu, 3 Jul 2003, Foelz.Frank wrote:

> Hi all,
>
> before I smash my head against the wall..........
>
> I am trying to execute an external procedure defined in a C .dll.
>
> I have set up my tnsnames/listener.ora as following :
>

[snip]
> Oracle tells me, that it is not able, to loead the dll.
> Error message is :
>
> ORA-06520: PL/SQL: Error loading external library
> ORA-06522: Unable to load DLL
> ORA-06512: at "SYS.PRINTSTRING", line 0
> ORA-06512: at line 2

Problems can arise due to name mangling in the .DLL Use the Depends.exe utility to open the DLL and look at the entry point name for your function. It probably is not what you expect it is.

What I have found that works in the past is to declare the fuction as

#define ORACMD_API __declspec(dllexport) extern "C" ORACMD_API void RunCommand(char *);

The problem you're going to find is that the 'extern "C"' syntax is only supported in C++, so you will have to convert it to C++. Alternatively use the 'mangled' name in the Oracle definition and try that route

The depends.exe utility comes with Visual Studio and can also be found in the Resource Kit for NT

Cheers

Jeff Herrick

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jeff Herrick
  INET: jherrick_at_igs.net

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Goulet, Dick
  INET: DGoulet_at_vicr.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Jul 03 2003 - 09:01:22 CDT

Original text of this message

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