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 -> Re: External routine call from PL/SQL

Re: External routine call from PL/SQL

From: Finn Ellebaek Nielsen <fen_at_changegroup.dk>
Date: Mon, 28 Jun 1999 21:23:46 +0100
Message-ID: <7l8i4g$4dn$1@news.inet.tele.dk>


Steve B <steve.bright_at_capgemini.co.uk> wrote in message news:7l78hs$6jj$1_at_taliesin.netcom.net.uk...
> As stated above...in Oracle 8 onwards dll's can be called using external
> procedures..
>
> However, in my experience, they MUST be compiled as C code..... not even
C++
> works....
>
>
> Cheers
>
> Steve Bright
>
> steve.bright_at_capgemini.co.uk
>
> C. wrote in message <3775ACF3.470918EA_at_rationalconcepts.com>...
> >Yes, it's possible but I think it's expecting the dll in C or C++.
> >
> >So, here goes:
> >-- Step 1. Create the library that represents the dll in the database.
> >-- the d:... represents the path to the dll (or .so) that is on your
> >database server or
> >-- some mounted (cross mounted) directory visible to the db server.
> >create or replace library x as 'd:\orant\extproc\x.dll';
> >/
> >grant executeon x to public;
> >-- Step 2. Register the dll Note: the param list is the list of params
> >that your
> >-- external library routine is expecting.
> >create or replace procedure xrunner (
> > param1 IN OUT VARCHAR2,
> > .
> > .
> > .
> > ) AS
> > EXTERNAL LIBRARY x
> > NAME "xrunner";
> >/
> >grant execute on xrunner to public;
> >
> >-- Step 3. Your stored procedure that will call the xrunner proc.
> >create or replace test ( param1, param2, param3) AS
> > v_param1 VARCHAR2(40) := param1;
> > v_param2 ...;
> > v_param3 ...;
> >BEGIN
> > xrunner(v_param1...);
> >END;
> >/
> >grant execute on test to public;
> >commit;
> >
> >Hope that helps.
> >Cindy
> >
> >Gennady wrote:
> >
> >> Hello,
> >> Is it possible to create stored procedure in PL/SQL
> >> which calls an external executable or DLL routine written
> >> in Visual Basic?
> >> Please, if it is possible, give me an example.
> >> Thanks,
> >> Gennady

What kind of DLL routine have you written in Visual Basic? To my knowledge you can only create an ActiveX DLL or an ActiveX Document DLL in Visual Basic? The entry points exported from an ActiveX DLL are (not sure wheter it's C or Pascal calling convention):

DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer

and you would have to call the DllGetClassObject with the GUID of the object you're trying to create and do all the OLE stuff. In order to call all that OLE stuff you would have to interface to OLE32.DLL and OEAUT32.DLL at least.

Be aware, that in Oracle8i there's direct support for acessing COM objects (Oracle implemented the stuff mentioned above), is this what you're after?

HTH. Finn Received on Mon Jun 28 1999 - 15:23:46 CDT

Original text of this message

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