[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 650
  • Last Modified:

How can I create a text file from an Oracle trigger?

Greetings
I need to urgently create an Oracle trigger that will write a text file every time a table is updated. The Oracle databse is a Unix box, but I need to access the text-file from a Windows box.
I know SQL but I have never written a trigger before.
Please help...many thanks
Eddie
0
eddiecon
Asked:
eddiecon
  • 2
1 Solution
 
EmesCommented:
does the oracle box have a connection to the unix box?

I would have the data saved into a oracle table.

then from there send it to the other box.
0
 
EmesCommented:
here is a sample of a trigger


    CREATE OR REPLACE TRIGGER orders_after_update
    AFTER UPDATE
        ON orders
        FOR EACH ROW

    DECLARE
        v_username varchar2(10);

    BEGIN

        -- Find username of person performing UPDATE into table
        SELECT user INTO v_username
        FROM dual;

        -- Insert record into audit table
        INSERT INTO orders_audit
         ( order_id,
           quantity_before,
           quantity_after,
           username )
        VALUES
         ( :new.order_id,
           :old.quantity,
           :new.quantity,
           v_username );

    END;
0
 
eddieconAuthor Commented:
Good idea, thanks!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now