Re: Running an executable from a trigger

From: victor <victor_at_PERCOMBANK.KIEV.UA>
Date: 1998/12/15
Message-ID: <01be2828$b3dcfdc0$6b14abcc_at_victor>#1/1


Dave's News <stimpson_at_visionarysoftwareSPAM.com> wrote in article <1Cfc2.33$vu2.2103_at_typhoon.nycap.rr.com>...
> We would like to run a Windows Executable (VC++ app) from a trigger
 within
> Oracle. Does anyone have an idea on how we could do this?
>
> We have Oracle 8.0.4 for NT.
>
> Thanks in advance.
>
>
>
you can use extenal procedures like this

CREATE OR REPLACE LIBRARY VVV_L IS
 'c:/VVV.DLL';

CREATE OR REPLACE FUNCTION V1(X BINARY_INTEGER,s varchar2)  RETURN BINARY_INTEGER AS
 EXTERNAL LIBRARY vvv_L
 NAME VP
 calling standard c;
/
and dll vvv.dll

(in examples on delphi)
library VVV;

{ Important note about DLL memory management: ShareMem must be the   first unit in your library's USES clause AND your project's (select   View-Project Source) USES clause if your DLL exports any procedures or   functions that pass strings as parameters or function results. This   applies to all strings passed to and from your DLL--even those that   are nested in records and classes. ShareMem is the interface unit to   the DELPHIMM.DLL shared memory manager, which must be deployed along   with your DLL. To avoid using DELPHIMM.DLL, pass string information   using PChar or ShortString parameters. }

uses
  SysUtils,
  Classes;

  FUNCTION VP(I : INTEGER;
              s : pchar):INTEGER;cdecl;
  VAR F:TEXTFILE;
  s1:string;
  BEGIN
    ASSIGNFILE(F,'C:\VVV.TXT');
    REWRITE(F);
    s1:=strpas(s);

    WRITELN(F,INTTOSTR(I));
    WRITELN(F,s1);
    CLOSEFILE(F);
    RESULT:=i+1;
  END;   FUNCTION VS(I : INTEGER;
              s : pchar):pchar;cdecl;
  VAR F:TEXTFILE;
  s1:string;
  BEGIN
    ASSIGNFILE(F,'C:\VVV.TXT');
    REWRITE(F);
    s1:=strpas(s);

    WRITELN(F,INTTOSTR(I));
    WRITELN(F,s1);
    CLOSEFILE(F);
    RESULT:=s;
  END;   EXPORTS VP,VS; begin
end.



and in trigger only use function v1 and this all Received on Tue Dec 15 1998 - 00:00:00 CET

Original text of this message