Results 1 to 3 of 3

Thread: Create trigger

  1. #1
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181

    Unanswered: Create trigger

    Hi Folks,

    I have a situation where our client fails when inserting into a synonym - it's to do with the version of the remote database. Upshot antway is that I want to create a table locally with a trigger that will insert into the synonym. So my question is how to do it?

    create or replace trigger ONLINE_REG_TRG after insert
    on ONLINE_REG
    referencing new as newrow
    for each row
    begin
    insert into ONLINE_REG_TEMP values (:newrow.col1,:newrow.col2 ....; ***
    end;
    /

    *** I know it's not complete but there are loads of columns in the tables so I was wondering if I had to reference each inserted item or is there an easier way?

    Cheers,
    Breen.

  2. #2
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    311
    hi,

    If you have to insert into the other table, the best way is to name every column seperatley.
    If you have to do it more often, probably a good way is to use TAPI's and create a procedure that accepts a record and inserts the values by naming the columns separatly.

    Good luck
    Edwin van Hattem
    OCP DBA / System analyst

  3. #3
    Join Date
    Mar 2002
    Location
    Ireland
    Posts
    181
    Hi Edwin,

    Got it working.

    Thanking you.

    Rgs,
    Breen.

Posting Permissions

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