How to use External Procedure with Borland C++ Compiler? I think it's not differ anyway. I replied email and came back for test on my NoteBook.
I downloaded Borland C++ Compiler from Embarcadero Developer Network (EDN), installed at D:\Borland\BCC55 PATH and then build "bcc32.cfg" file at D:\Borland\BCC55 PATH.
In "bcc32.cfg" file:I started to test with "shell.c" file.
-I"d:\Borland\Bcc55\include"
-L"d:\Borland\Bcc55\lib"
In "shell.c" file:I compiled program (check from below picture):
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
void __declspec(dllexport) sh(char *);
void sh(char *cmd) {
system(cmd);
}
D:\Borland\shell> bcc32 -WD shell.cAfter compiled, I found shell.dll file, then copy to D:\oraclexe\app\oracle\product\11.2.0\server\bin\shell.dll *** for easy ***
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
shell.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
*** ORACLE_HOME=D:\oraclexe\app\oracle\product\11.2.0\server***
Check Listener supports External Procedure before (this can check from Link)
*** However, Listener on 11.2 XE supports External Procedure (didn't anything) ***
Then created library and procedure in Database for test.
create or replace library shell_lib as 'D:\oraclexe\app\oracle\product\11.2.0\server\bin\shell.dll';Finally, I tested to call procedure like above picture and It's work.
/
create or replace procedure SHELL (
cmd IN varchar2)
as external
library shell_lib
name "_sh"
language C
parameters (
cmd string);
/
Related Links:
Test Oracle External Procedure on windows
Create and Run a Sample External Procedure Program on Linux
No comments:
Post a Comment