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

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-06521: PL/SQL: Error mapping function

Re: ORA-06521: PL/SQL: Error mapping function

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 08 Apr 2006 08:03:54 +0200
Message-ID: <ugke32d4rhq208l47d7sff034qh1pvksom@4ax.com>


On 7 Apr 2006 19:04:15 -0700, "mukesh bhakta" <mukesh_bhakta_at_hotmail.com> wrote:

>Hi all,
>
>I am writing a C/C++ code using MSDEV 2003 and get the
>
>SQL> exec shell('dir');
>BEGIN shell('dir'); END;
>
>*
>ERROR at line 1:
>ORA-06521: PL/SQL: Error mapping function
>ORA-06522: Unable to load symbol from DLL
>ORA-06512: at "SYS.SHELL", line 1
>ORA-06512: at line 1
>
>when trying to run it from SQL Plus.
>
>Here the dump of my source code -
>
>extern "C"__declspec(dllexport) void shell(const char *cmd)
>{
> printf("test\n");
>}
>
>I have used dependency walker and dumpbin to make sure my call is not
>mangled up.
>
>Here are the SQL statements -
>
>CREATE LIBRARY shell_lib is
>'C:\mbhakta\playground\oraProc\oraProc\Debug\oraProc.dll';
>/
>
>create or replace procedure shell(cmd IN char)
>as external
>library shell_lib
>name "shell"
>language C
>parameters (cmd string);
>/
>
>I have also modifed the Listenrer.Ora to follows -
>
>
>
>
>SID_LIST_LISTENER =
> (SID_LIST =
> (SID_DESC =
> (SID_NAME = PLSExtProc)
> (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
> (PROGRAM = extproc)
> (ENVS="EXTPROC_DLLS=C:\oraProc\Debug\oraProc.dll")
> )
> (SID_DESC =
> (GLOBAL_DBNAME = x)
> (SID_NAME = x)
> )
> )

>CREATE LIBRARY shell_lib is
>'C:\mbhakta\playground\oraProc\oraProc\Debug\oraProc.dll';
doesn't match
> (ENVS="EXTPROC_DLLS=C:\oraProc\Debug\oraProc.dll")
>

--
Sybrand Bakker, Senior Oracle DBA
Received on Sat Apr 08 2006 - 01:03:54 CDT

Original text of this message

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