Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Question Unanswered: How to write a trigger in Oracle 8 to call a .dll (COM)?

    Dear Friends,

    I would like to know how to write a trigger in Oracle 8(not 8i) to call a COM(.dll) for doing some real-time jobs when the db system adding a new record, please help me. I'd searched a lot of articles but can not get any help.

    Thank you for any of your answer and assistance.

    Toby

  2. #2
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    Hi,

    First tell Oracle about your DLL...

    PHP Code:
    CREATE OR REPLACE LIBRARY MY_DLL_LIB AS 'C:\ORACLE\ORA81\MY_DLL.DLL'
    Then create a 'wrapper' function for each function within the DLL.

    PHP Code:
    FUNCTION TestFun RETURN VARCHAR2 IS
       EXTERNAL   LIBRARY MY_DLL_LIB
       NAME       
    "DllTestFun"   -- this is the dll function
       
    LANGUAGE   C
    You will have to ensure that EXTPROC is correctly configured, and of course write the DLL. You can then call the DLL function as if it were a PL/SQL function...

    PHP Code:
       Result := MY_DLL_LIB.TestFun
    Check otn.oracle.com for calling conventions etc.

    Hth
    Bill
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •