Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ORA-06521: PL/SQL: Error mapping function
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)
)
)
Received on Fri Apr 07 2006 - 21:04:15 CDT