Compound trigger for mutating

hi guys,
Need you mastery about mutating table.
how can I rewrite sample trigger below, in compound trigger to avoid mutating table?
oracle version:
Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
"CORE 11.1.0.7.0 Production"
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Table1 has (col1,col2,col3,col4)
Table2 has(col1,col2,col3,col4,col5)
Table3 has(col1,col2,col3,col4,col5)
Table4 has(col1,col2,col3,col4)
Create or replace trigger tble1_after_insert
after insert on tabl1
referencing old as old new as new
for each row
Begin
Insert into table4
( select table1.col1,table1.col2,table2.col3,table3.col4
where table1.col1 = table2.col1 (+)
and table2.col3 = table3.col3(+)
and table.col1 = :new.table1.col1)
End;
Mutating problem will occur on table1, that's why I need to convert the script on compound trigger.
If there will be a better way rather than compound trigger kindly share your ideas.
thank you in advance

zacky wrote:
Hi Guys,
Thanks for the references.
@ Paul thanks for the idea, follow up question I have another condition on where clause; below is the actual script
(part of insert into Table select statement)
SELECT O.order_id,
COALESCE (dl.isbn, cl.isbn, ol.product_id) eisbn,
CO.organisation_id,
O.order_status,
O.order_type,
CL.collection_id,
DECODE(cl.concurrency_flag, 0, 0, 1, cb.concurrency_limit) access_limit
FROM ebook_order O,
ebook_isbn_data_load DL,
ebook_order_line OL,
ebook_collection_list CL,
ebook_concurrency_band CB,
consortium_organisation CO,
ebook_order O
WHERE o.order_id = ol.order_id
AND ol.product_id = cl.collection_id(+)
AND cl.isbn = dl.ean13_of_set(+)
AND o.concurrency_band_code = cb.concurrency_band_code
AND o.body_id = co.consortium_id
AND o.order_status = '4'
AND o.order_type IN ('P','G','S')
AND o.order_id = 10020743
since I created the trigger on ebook_order, then I need to remove that table in order to avoid mutating it is possible
to do something like script below
SELECT :new.order_id,
COALESCE (dl.isbn, cl.isbn, ol.product_id) eisbn,
CO.organisation_id,
:new.order_status,
:new.order_type,
CL.collection_id,
DECODE(cl.concurrency_flag, 0, 0, 1, cb.concurrency_limit) access_limit
FROM
ebook_isbn_data_load DL,
ebook_order_line OL,
ebook_collection_list CL,
ebook_concurrency_band CB,
consortium_organisation CO,
ebook_order O
WHERE :new.order_id = ol.order_id
AND ol.product_id = cl.collection_id(+)
AND cl.isbn = dl.ean13_of_set(+)
AND :new:concurrency_band_code = cb.concurrency_band_code
AND :new.body_id = co.consortium_id
how about on this part? I'm not sure with this one
AND o.order_status = '4'
AND o.order_type IN ('P','G','S')
AND o.order_id = 10020743
unless I can put IF THEN statement if something like below code
If :new.order_status = 4 and (:new.order_type ='P' or :new.:new.order_type ='G' or :new.order_type='S') then
thanks in advanceHow about:
and :new.order_status = 4
and :new.order_type in ('P','G','S')
and :new.order_id = 10020743Though it strikes me as unusual to have a trigger that only does something when a particular order id is inserted.
BTW Please read {message:id=9360002} and follow the advice there. In particular
the bit about formatting your code and putting it between tags.
Also, try to get out of the habit of upper casing your SQL - it's very COBOL (i.e. old-fashioned and not much use).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Trigger in mutation - Update another rows in the same table with a trigger

    Hi ,
    I try to do a before update trigger on a table , but the trigger is in mutation. I understand why it do that but my question is :
    How can I update other rows in the same table when a UPDATE is made on my table??????
    Here is my trigger :
    CREATE OR REPLACE TRIGGER GDE_COMPS_BRU_5 BEFORE
    UPDATE OF DEPARTEMENT--, DISCIPLINE, DEG_DEMANDE, CE_ETAB
    ON GDEM.COMPOSITION_SUBV
    FOR EACH ROW
    Organisme : FQRNT-FQRSC
    Date de création : 14-07-2011
    Date de modification :
    Modifié par :
    Auteur : Johanne Plamondon
    Description : Ce déclencheur s'executera lors de la modification
    du responsable dans la table COMPOSITION_SUBV
    DECLARE
    V_OSUSER V$SESSION.OSUSER%TYPE;
    V_PROGRAM V$SESSION.PROGRAM%TYPE;
    V_TERMINAL V$SESSION.TERMINAL%TYPE;
    V_MACHINE V$SESSION.MACHINE%TYPE;
    V_MODULE V$SESSION.MODULE%TYPE;
    V_LOGON_TIME V$SESSION.LOGON_TIME%TYPE;
    V_AUDIT_ID NUMBER;
    vSEQ NUMBER;
    i NUMBER;
    vID DEMANDE.ID%TYPE;
    BEGIN
    begin
    SELECT OSUSER, PROGRAM, TERMINAL,MACHINE,MODULE, LOGON_TIME
    INTO V_OSUSER,V_PROGRAM,V_TERMINAL,V_MACHINE,
    V_MODULE,V_LOGON_TIME
    FROM V$SESSION
    WHERE TYPE = 'USER'
    AND USERNAME = USER
    AND LAST_CALL_ET IN (0,1)
    AND ROWNUM < 2;
    exception when others then null; end;
    IF NVL(:NEW.SC_PART,' ') = 'CHC' THEN
    SELECT COUNT(*)
    INTO i
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    IF i = 1 THEN
    SELECT ID
    INTO vID
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    UPDATE COMPOSITION_SUBV
    SET --CE_ETAB     = :NEW.CE_ETAB,
    --DISCIPLINE  = :NEW.DISCIPLINE,
    DEPARTEMENT = :NEW.DEPARTEMENT,
    --DEG_DEMANDE = :NEW.DEG_DEMANDE,
    DATE_MODIF = SYSDATE,
    USER_MODIF = V_OSUSER
    WHERE DEM_ID = vID
    AND PER_NIP = :NEW.PER_NIP
    AND ANNEE = :NEW.ANNEE;
    END IF;
    END IF;
    /*EXCEPTION
    WHEN OTHERS THEN
    NULL;*/
    END;

    A standard disclaimer, the mutating trigger error is telling you that you really, really, really don't want to be doing this. It generally indicates a major data model problem when you find yourself in a situation where the data in one row of a table depends on the data in another row of that same table. In the vast majority of cases, you're far better off fixing the data model than in working around the problem.
    If you are absolutely sure that you cannot fix the data model and must work around the problem, you'll need
    - A package with a collection (or global temporary table) to store the keys that are modified
    - A before statement trigger that initializes the collection
    - A row-level trigger that adds the keys that were updated to the collection
    - An after statement trigger that iterates over the data in the collection and updates whatever rows need to be updated.
    If you're on 11g, this can be simplified somewhat by using a compound trigger with separate before statement, row-level, and after statement sections.
    Obviously, though, this is a substantial increase in complexity over the single trigger you have here. That's one of the reasons that it's generally a bad idea to work around mutating table exceptions.
    Justin

  • Compound trigger returns too many lines

    Hi all.
    I have created a compound trigger which executes a procedure. Although the trigger now runs (I was getting a mutating table error before), it returns multiple lines where I am expecting only one line. When I run the procedure by itself, without the trigger, it runs as expected. Truth is, I created the trigger based on an example I found online, and I am not sure how to modify it to my needs. I don't need the data I am generating in the AFTER EACH ROW section. It exists because the trigger doesn't seem to run otherwise. Any help would be highly appreciated.
    create or replace trigger test.requisitions_trigger
      FOR INSERT OR UPDATE ON test.supply_items
    COMPOUND TRIGGER
    TYPE t_change_tab IS TABLE OF test.tab1_audit%ROWTYPE; g_change_tab t_change_tab := t_change_tab();
    AFTER EACH ROW IS
    BEGIN
      g_change_tab.extend;
      IF INSERTING THEN
        g_change_tab(g_change_tab.last).action := 'INSERT';
      ELSE
        g_change_tab(g_change_tab.last).action := 'UPDATE';
      END IF;
      g_change_tab(g_change_tab.last).created_time := SYSTIMESTAMP;
    END AFTER EACH ROW;
    AFTER STATEMENT IS
    BEGIN
      test.Requisitions;
    END AFTER STATEMENT;
    END requisitions_trigger;

    In your Re: Mutating Table error - Compound Trigger, the REQUISITIONS procedure was taking an argument that was taken from the row being inserted or updated. In this version, there is no argument. If the REQUISITIONS procedure takes no arguments (and just to harp on it, I'll reiterate that having a table and a procedure with the same name is more than a bit confusing), then you just need a statement level trigger. A statement level trigger is free to query the table being modified all it likes without raising any mutating table concerns (because the current statements changes are either guaranteed to have not been applied or to have been completely applied, there is no risk of seeing data in an inconsistent state).
    Justin

  • Some :New values are null in compound trigger

    <h4>
    Hello everybody,
    I use Oracle 11g R2.
    My problem is: Why certain :New.values are Null in the before statement only if I have an after statement (that do nothing) ?
    My test case:
    </h4>
    create table TEST
    ID Number,
    CODE char(10),
    SUBJECT varchar2(60)
    alter table TEST add constraint TEST_PK primary key (CODE);
    insert into TEST (CODE, SUBJECT, ID) values ('AAA ', 'Subject AAA', 1);
    insert into TEST (CODE, SUBJECT, ID) values ('BBB ', 'Subject BBB', 2);
    commit;
    <h4>My problem:</h4>
    create or replace trigger Test_Trg
    for insert or update on Test
    compound trigger
    before each row is
    begin
    dbms_output.put_line( 'Before Each Row, New values= Id: '||:New.Id||', Code: '||:New.Code||', Subject: '||:New.Subject );
    dbms_output.put_line( 'Before Each Row, Old values= Id: '||:Old.Id||', Code: '||:Old.Code||', Subject: '||:Old.Subject );
    :New.Code := Nvl(:New.Code, 'CODE'||:New.Id);
    end before each row;
    after statement is
    begin
    dbms_output.put_line( 'After Statement' );
    end after statement;
    end Test_Trg;
    <h4>Now if I do that:</h4>
    update Test set Subject = 'The New Subject' where ID = 1;
    commit;
    <h4>The dbms_output is :</h4>
    Before Each Row, New values= Id: 1, Code: , Subject:
    Before Each Row, Old values= Id: 1, Code: USER1 , Subject: The New Subject
    After Statement
    <h4> (You can see that in the before each row, :New.Code and :New.Subject are Null!)
    And the Data are:</h4>
    select * from Test where Id = 1;
    Id Code Subject
    1 CODE1 The New Subject
    <h4>Why the column Code is changed?
    Now if I change my trigger (just removing the after statement)</h4>
    create or replace trigger Test_Trg
    for insert or update on Test
    compound trigger
    before each row is
    begin
    dbms_output.put_line( 'Before Each Row, New values= Id: '||:New.Id||', Code: '||:New.Code||', Subject: '||:New.Subject );
    dbms_output.put_line( 'Before Each Row, Old values= Id: '||:Old.Id||', Code: '||:Old.Code||', Subject: '||:Old.Subject );
    :New.Code := Nvl(:New.Code, 'CODE'||:New.Id);
    end before each row;
    end Test_Trg;
    <h4>All work perfect!
    My question is: Why certain :New.values are Null in the before statement only if I have an after statement that do nothing ?
    Thanks in advance,
    </h4>

    I've got two 11.2.0.2 environments - one where this is reproducible, one where it doesn't seem to be.
    I assume it must be a bug and one of these environments is patched.
    I had a quick look at metalink and couldn't see an obvious match.
    I might see if I can figure out differences between environments later.
    There are a number of bugs around compound triggers.
    I've been bitten before with a different compound trigger bug.
    http://orastory.wordpress.com/2009/01/20/beware-the-compound-trigger/
    Shame - nice way to neaten up multiple triggers but too many issues.

  • Compound Trigger and Exceptions

    Hi,
    I'm using 11gR2. It seems to be impossible writing a compound trigger including an exception handler. But I need one.
    Code is
    create or replace trigger testtrg
    for delete or insert or update on BTK.AVALTYP compound trigger
    anyerr exception;
    pragma exception_init(anyerr, -20005);
    before each row is
    begin
      null;
      raise anyerr;
      exception
        when anyerr then
           null;
    end before each row;
    after statement is
    begin
      null;
       EXCEPTION
         when others then
          null;
    end after statement;
    end;any suggestions?
    regards Wilko

    wilkohelms wrote:
    I'm using 11gR2. It seems to be impossible writing a compound trigger including an exception handler. But I need one.I have no issues with it:
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> create or replace
      2    trigger emp_cbiud
      3    for delete
      4     or insert
      5     or update
      6    on emp
      7    compound trigger
      8      anyerr exception;
      9      pragma exception_init(anyerr, -20005);
    10 
    11    before each row is
    12      begin
    13          null;
    14          raise anyerr;
    15        exception
    16          when anyerr then
    17            null;
    18    end before each row;
    19 
    20    after statement is
    21      begin
    22          null;
    23        EXCEPTION
    24          when others then
    25            null;
    26    end after statement;
    27 
    28  end;
    29  /
    Trigger created.
    SQL>  SY.

  • Compound trigger support

    Hello
    Are compound triggers allready supported in sql developer?
    Kind Regards Erik

    Hi Erik,
    The Create Trigger dialog does not support compound triggers yet. You may want to add a feature request for this on the SQL Developer Exchange.
    Otherwise, if the compound trigger already exists or is created via Run Script in the worksheet, then the object viewer works as expected for triggers of that type.
    Regards,
    Gary Graham
    SQL Developer Team

  • One trigger for Multiple tables

    Hi all,
    I want write a trigger for mutiple tables.
    For Example,
    In database schema,some user update one table.I want to capture what the table and capture old value and new value.
    the above example for all insert and delete also.
    Regards
    Fame

    Hi, Fame,
    Sorry, a trigger only works on one table, so you need a separate trigger on each separate table.
    All of those triggers can call a common procedure.
    If you'd like to give a more detailed description of what you want to do, using two or three tables, then someone can give you more detailed instructions on how to do it.
    Always say which version of Oracle you're using.

  • Creation of sequence and trigger for each table!!!!!!!1

    Hi
    I am new to trigger and Sequence field. In one of my database we have many tables with fields for specifing ID numbers. Iam planning to insert the ID field with help of a Sequence and trigger...that trigger fires by adding the sequence value from the dual table. Now the point is here we r having around *60* table with ID field. And i am planning use the above process for each table by creating sequences and trigger for each table.
    Will this affects the performance of database.
    Is there any other option other than the above process, I mean other than creating sequences and trigger for each table.
    PLzz help to resolve this issuee......
    Shiyas
    Edited by: user13170361 on Jun 7, 2010 12:37 AM

    Tiger, I didn't mind about your comment, but the point is try to use
    select NVL(max(a) + 1,1) into i from p1_temp;This line in your trigger code and see what is happening. The problem is with your trigger. You are using group by function and you will not get no_data_found !
    For more help, this is some modification of your code.
    SQL> create table p1_temp (a number(10) primary key, b number(10));
    Table created.
    SQL> create or replace trigger trg_p1_temp
      2  before insert on p1_temp for each row
      3  declare
      4  i number(10);
      5  begin
      6  begin
      7  select NVL(max(a) + 1,1) into i from p1_temp;
      8  exception
      9  when no_data_found then
    10  i := 1;
    11  end;
    12  :new.a := i;
    13  end;
    14  /
    Trigger created.
    SQL> insert into p1_temp(b) values (1);
    1 row created.
    SQL> insert into p1_temp(b) values (2);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from p1_temp;
             A          B
             1          1
             2          2
    SQL> Edited by: Saubhik on Jun 7, 2010 2:30 AM

  • Analog start trigger for x series card gives an error?

    Hi everyone,
    I am having some trouble setting up an analog start trigger for DAQ using an x series PCIe card (6351)... Attached is my configuration... After reading the manual (http://digital.ni.com/manuals.nsf/websearch/08B4B2E1B5373B94862579BA006E6BAB), my understanding is that AFPI0 is a compatable analog trigger for the device; however, the vi will not run and I get an error... Although if I change the soruce to "Force" (which is ai0) it works..
    Also, the device document says (pg 11-8):
    "To improve trigger accuracy, do the following:
    • Use an AI channel (with a small input range) instead of APFI <0,1> as your trigger source. The DAQ device does not amplify the APFI <0, 1> signals. When using an AI channel, the NI-PGIA amplifies the AI channel signal before driving the analog trigger circuitry. If you configure the AI channel to have a small input range,"
    To me, this implies that I probably should use "Force" as the trigger soruce anyway (note that the instrunment is used to acquire data load cell data generated from human muscle contractions; so slew rates are relatively low compared to signals acquired from industrial tests).
    Could someone please comment on these issues for me?
    Regards,
    Jack
    LV2010
    Attachments:
    Untitled 1.vi ‏22 KB

    Ok... I think I have answered by own question... APFI0 needs a low impedence signal to drive the terminal... I mistakenly thought this was an internal terminal or trigger...
    So I should stick with using the first analog signal acquired in my DAQ device (e.g. ai0) as the trigger source?
    Regards,
    Jack
    LV2010

  • How to user Error Trigger for mapping - trying to catch row-based errors

    Hello everyone,
    Has anyone managed to use the error trigger for a mapping?
    I created a row based map with the right parameters (i set the error trigger procedure which I already created in the database).
    For this map after run i have 5 warnings which appear in the interface but the error trigger procedure is not executed.
    I set the max errors to 3 so after run the map should end with errors instead of warnings.
    Still not executing the error trigger procedure.
    What am i doing wrong?
    Please help as i really need a way to "catch" row based errors - having multiple target tables sucks.
    Thank you,
    Irina
    Edited by: Irina on Jul 30, 2009 1:32 PM
    Edited by: Irina on Jul 30, 2009 3:38 PM

    It seems nobody knows what I'm talking about - no documentation on it either ... not even in the user guide ... not even on google ... well, just saying what it is doesn't count :D

  • How can i write the trigger for Global Temporary Table

    Hi Grus,
    How can i write the trigger for Global Temporary Table.
    I was created the GTT with trigger using the below script .
    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    EMP_C_NAME VARCHAR2(20 BYTE)
    ON COMMIT PRESERVE ROWS;
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    trigger was create successfully, but the wouldn't insert into to EMPNAME Table..
    Please guide whether am correct or not? if not kindly give a correct syntax with example
    Thanks in Advance,
    Arun M M

    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    you are referencing old value in insert stmt.
    BEGIN
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    END;then run ur application it works fine...
    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    EMP_C_NAME VARCHAR2(20 BYTE)
    ON COMMIT PRESERVE ROWS;
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    dbms_output.put_line(:OLD.EMP_C_NAME||'yahoo');
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    dbms_output.put_line(:OLD.EMP_C_NAME);
    END;
    create table EMPNAME as select * from GLOBAL_TEMP where 1=2
    insert into GLOBAL_TEMP values('fgfdgd');
    commit;
    select * from GLOBAL_TEMP;
    select * from EMPNAME;
    output:
    1 rows inserted
    commit succeeded.
    EMP_C_NAME          
    fgfdgd              
    1 rows selected
    EMP_C_NAME          
    fgfdgd              
    1 rows selectedgot it Arun
    Edited by: OraclePLSQL on Dec 28, 2010 6:07 PM

  • Using LabVIEW to program a Pattern Trigger for the PCI-5112

    I am trying to program a pattern trigger for the PCI-5112.  Has anyone ever done this?  I am trying to use the the "Fetch forever" example as a base, then use the software trigger when there is a pattern match.
    Any help or advice with this would be very appreciated.
    PS as an example, I want to trigger when the pre-trigger data matches the pattern, say a 8 bit word such as 1010 0000.  Maybe I can try to do like my Tektonix TS5104B scope and try to program a timeout trigger.

    Good morning Andronicus,
    Thanks for contacting National Instruments with your issue, we'll try our best to resolve it for you as quickly and efficiently as possible.
    Unfortunately, there is no easy way to do what you're trying to accomplish with simply a Scope alone. The trigger input and PFI lines have no buffer and are only capable of looking for a single edge, and the standard CH0 and CH1 inputs strictly represent signals in analog. 
    So your current approach may be best, of using the Fetch Forever to acquire the signal into a prebuffer and then analyzing it and sending a software trigger.  So the best you can do in terms of response will be software-time, which is not ideal.  There is also the very tricky matter of interpreting that analog signal as a digital signal.  You'd have to know the clock rate of the incoming pattern and then also the phase in order to correctly assess the incoming pattern.  No easy task, and certainly nothing that would be super reliable or recommended.
    Your best bet would be to purchase one of our  HSDIO cards, such as the PCI-653x that inherently does pattern triggering in the hardware domain, and then route the start trigger (i.e. when the pattern has been matched) via a RTSI cable to the Scope card which can then simply use the digital edge trigger to begin it's acquisition.  This will be far more robust, easier to code and have a much quicker response time. 
    Best of luck with your project.
    Sincerely,
    Minh Tran
    Applications Engineering
    National Instruments

  • Writing trigger for DML tracking on three table

    Hello,
    I need help on how can i write a trigger for updating backup table on DML changes on source table.
    I have source table named APP_SOURCE and backup table name APP_BACKUP with same data and structure.
    On any DML on source table APP_SOURCE it corresponding backup table APP_BACKUP should also be updated with same number of record changes on any DML
    (insert/update/delete) to maintain data consistency on both tables
    For cross refernce all changed DML records on source table APP_SOURCE should be tracked and stored within third table APP_SOURCEDMLTRACK storing old value and new value data before and after dml changes on source table APP_SOURCE
    source table create script:
    CREATE TABLE APP_SOURCE
    RCN_ID VARCHAR2(23 BYTE),
    CRD_NUM VARCHAR2(23 BYTE),
    TRN_TYP VARCHAR2(10 BYTE),
    TRN_DTE DATE,
    REF_NUM VARCHAR2(23 BYTE),
    TRN_CRR VARCHAR2(3 BYTE),
    TRN_AMT NUMBER(24,6),
    BLL_CRR VARCHAR2(3 BYTE),
    BLL_AMT NUMBER(16,2),
    BSN_DTE DATE,
    BRN_S VARCHAR2(10 BYTE),
    ACC_NUM_S VARCHAR2(24 BYTE),
    BRN_D VARCHAR2(10 BYTE),
    ACC_NUM_D VARCHAR2(24 BYTE),
    SRL_NUM VARCHAR2(12 BYTE),
    DVI_TYP VARCHAR2(8 BYTE),
    ORG_MSG_TYP VARCHAR2(6 BYTE),
    ACQ_CDE VARCHAR2(15 BYTE),
    ACQ_BIN VARCHAR2(11 BYTE),
    REV VARCHAR2(1 BYTE),
    DBCR_FLG VARCHAR2(1 BYTE),
    ATM_FEE NUMBER(16,2),
    ATM_ID VARCHAR2(16 BYTE),
    INT_FEE NUMBER(16,2),
    TRM_ID VARCHAR2(10 BYTE),
    MCN_CDE VARCHAR2(40 BYTE),
    MCN_INF VARCHAR2(40 BYTE),
    PNT_RCN_ID NUMBER(12),
    FGN_KEY VARCHAR2(23 BYTE),
    ERR_CDE VARCHAR2(200 BYTE),
    JNK VARCHAR2(50 BYTE),
    CRD_USED VARCHAR2(10 BYTE),
    RES_CDE VARCHAR2(3 BYTE),
    REA_CDE VARCHAR2(4 BYTE),
    PRC_CDE VARCHAR2(10 BYTE),
    MCC VARCHAR2(4 BYTE),
    APP_CDE VARCHAR2(8 BYTE),
    ISS_INS_ID VARCHAR2(11 BYTE),
    ACQ_INS_ID VARCHAR2(11 BYTE),
    ACQ_NET_CDE VARCHAR2(20 BYTE),
    ISS_NET_CDE VARCHAR2(20 BYTE),
    INST_ID VARCHAR2(60 BYTE),
    FIID1 VARCHAR2(20 BYTE),
    FIID2 VARCHAR2(20 BYTE),
    SWT_FLE VARCHAR2(50 BYTE),
    VIS_FLE VARCHAR2(50 BYTE),
    VIS_FLE_MCHDTE DATE,
    VIS_FLE_EODDTE DATE,
    VIS_FLE_RCNTYP NUMBER(2),
    VIS_FLE_ACNTID VARCHAR2(35 BYTE),
    MAS_FLE VARCHAR2(50 BYTE),
    MAS_FLE_MCHDTE DATE,
    MAS_FLE_EODDTE DATE,
    MAS_FLE_RCNTYP NUMBER(2),
    MAS_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE1_FLE VARCHAR2(50 BYTE),
    TIE1_FLE_SRC VARCHAR2(50 BYTE),
    TIE1_FLE_MCHDTE DATE,
    TIE1_FLE_EODDTE DATE,
    TIE1_FLE_RCNTYP NUMBER(2),
    TIE1_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE2_FLE VARCHAR2(50 BYTE),
    TIE2_FLE_SRC VARCHAR2(50 BYTE),
    TIE2_FLE_MCHDTE DATE,
    TIE2_FLE_EODDTE DATE,
    TIE2_FLE_RCNTYP NUMBER(2),
    TIE2_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE3_FLE VARCHAR2(50 BYTE),
    TIE3_FLE_SRC VARCHAR2(50 BYTE),
    TIE3_FLE_MCHDTE DATE,
    TIE3_FLE_EODDTE DATE,
    TIE3_FLE_RCNTYP NUMBER(2),
    TIE3_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE4_FLE VARCHAR2(50 BYTE),
    TIE4_FLE_SRC VARCHAR2(50 BYTE),
    TIE4_FLE_MCHDTE DATE,
    TIE4_FLE_EODDTE DATE,
    TIE4_FLE_RCNTYP NUMBER(2),
    TIE4_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE5_FLE VARCHAR2(50 BYTE),
    TIE5_FLE_SRC VARCHAR2(50 BYTE),
    TIE5_FLE_MCHDTE DATE,
    TIE5_FLE_EODDTE DATE,
    TIE5_FLE_RCNTYP NUMBER(2),
    TIE5_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE6_FLE VARCHAR2(50 BYTE),
    TIE6_FLE_SRC VARCHAR2(50 BYTE),
    TIE6_FLE_MCHDTE DATE,
    TIE6_FLE_EODDTE DATE,
    TIE6_FLE_RCNTYP NUMBER(2),
    TIE6_FLE_ACNTID VARCHAR2(35 BYTE),
    EJ_FLE VARCHAR2(50 BYTE),
    EJ_FLE_MCHDTE DATE,
    EJ_FLE_EODDTE DATE,
    EJ_FLE_RCNTYP NUMBER(2),
    EJ_FLE_ACNTID VARCHAR2(35 BYTE),
    BTH_FLE VARCHAR2(50 BYTE),
    BTH_FLE_MCHDTE DATE,
    BTH_FLE_EODDTE DATE,
    BTH_FLE_RCNTYP NUMBER(2),
    BTH_FLE_ACNTID VARCHAR2(35 BYTE),
    BRN_ISS_FLE VARCHAR2(50 BYTE),
    BRN_ISS_FLE_MCHDTE DATE,
    BRN_ISS_FLE_EODDTE DATE,
    BRN_ISS_FLE_RCNTYP NUMBER(2),
    BRN_ISS_FLE_ACNTID VARCHAR2(35 BYTE),
    BRN_ACQ_FLE VARCHAR2(50 BYTE),
    BRN_ACQ_FLE_MCHDTE DATE,
    BRN_ACQ_FLE_EODDTE DATE,
    BRN_ACQ_FLE_RCNTYP NUMBER(2),
    BRN_ACQ_FLE_ACNTID VARCHAR2(35 BYTE),
    TRNACC_ID VARCHAR2(21 BYTE),
    PRT_TRNACC_ID VARCHAR2(35 BYTE),
    PROCESS_ID VARCHAR2(20 BYTE),
    SWT_VCH1_NUM VARCHAR2(100 BYTE),
    SWT_VCH2_NUM VARCHAR2(100 BYTE),
    SWT_VCH3_NUM VARCHAR2(100 BYTE),
    SWT_VCH4_NUM VARCHAR2(100 BYTE),
    SWT_VCH5_NUM VARCHAR2(100 BYTE),
    SWT_VCH1A_NUM VARCHAR2(100 BYTE),
    SWT_VCH2A_NUM VARCHAR2(100 BYTE),
    SWT_VCH3A_NUM VARCHAR2(100 BYTE),
    SWT_VCH4A_NUM VARCHAR2(100 BYTE),
    SWT_VCH5A_NUM VARCHAR2(100 BYTE),
    SWT_VCH1B_NUM VARCHAR2(100 BYTE),
    SWT_VCH2B_NUM VARCHAR2(100 BYTE),
    SWT_VCH3B_NUM VARCHAR2(100 BYTE),
    SWT_VCH4B_NUM VARCHAR2(100 BYTE),
    SWT_VCH5B_NUM VARCHAR2(100 BYTE),
    SWT_VCH1C_NUM VARCHAR2(100 BYTE),
    SWT_VCH2C_NUM VARCHAR2(100 BYTE),
    SWT_VCH3C_NUM VARCHAR2(100 BYTE),
    SWT_VCH4C_NUM VARCHAR2(100 BYTE),
    SWT_VCH5C_NUM VARCHAR2(100 BYTE),
    SWT_VCH1D_NUM VARCHAR2(100 BYTE),
    SWT_VCH2D_NUM VARCHAR2(100 BYTE),
    SWT_VCH3D_NUM VARCHAR2(100 BYTE),
    SWT_VCH4D_NUM VARCHAR2(100 BYTE),
    SWT_VCH5D_NUM VARCHAR2(100 BYTE),
    SWT_VCH1E_NUM VARCHAR2(100 BYTE),
    SWT_VCH2E_NUM VARCHAR2(100 BYTE),
    SWT_VCH3E_NUM VARCHAR2(100 BYTE),
    SWT_VCH4E_NUM VARCHAR2(100 BYTE),
    SWT_VCH5E_NUM VARCHAR2(100 BYTE),
    SWT_VCH1F_NUM VARCHAR2(100 BYTE),
    SWT_VCH2F_NUM VARCHAR2(100 BYTE),
    SWT_VCH3F_NUM VARCHAR2(100 BYTE),
    SWT_VCH4F_NUM VARCHAR2(100 BYTE),
    SWT_VCH5F_NUM VARCHAR2(100 BYTE),
    SWT_VCH1G_NUM VARCHAR2(100 BYTE),
    SWT_VCH2G_NUM VARCHAR2(100 BYTE),
    SWT_VCH3G_NUM VARCHAR2(100 BYTE),
    SWT_VCH4G_NUM VARCHAR2(100 BYTE),
    SWT_VCH5G_NUM VARCHAR2(100 BYTE),
    SWT_VCH1H_NUM VARCHAR2(100 BYTE),
    SWT_VCH2H_NUM VARCHAR2(100 BYTE),
    SWT_VCH3H_NUM VARCHAR2(100 BYTE),
    SWT_VCH4H_NUM VARCHAR2(100 BYTE),
    SWT_VCH5H_NUM VARCHAR2(100 BYTE),
    SWT_VCH1I_NUM VARCHAR2(100 BYTE),
    SWT_VCH2I_NUM VARCHAR2(100 BYTE),
    SWT_VCH3I_NUM VARCHAR2(100 BYTE),
    SWT_VCH4I_NUM VARCHAR2(100 BYTE),
    SWT_VCH5I_NUM VARCHAR2(100 BYTE),
    VIS_VCH_NUM VARCHAR2(100 BYTE),
    MAS_VCH_NUM VARCHAR2(100 BYTE),
    TIE1_VCH_NUM VARCHAR2(100 BYTE),
    TIE2_VCH_NUM VARCHAR2(100 BYTE),
    TIE3_VCH_NUM VARCHAR2(100 BYTE),
    TIE4_VCH_NUM VARCHAR2(100 BYTE),
    TIE5_VCH_NUM VARCHAR2(100 BYTE),
    TIE6_VCH_NUM VARCHAR2(100 BYTE),
    EJ_VCH_NUM VARCHAR2(100 BYTE),
    BTH_VCH_NUM VARCHAR2(100 BYTE),
    BRN_ISS_VCH_NUM VARCHAR2(100 BYTE),
    BRN_ACQ_VCH_NUM VARCHAR2(100 BYTE),
    PAR_DTE DATE,
    EOD_DTE1 DATE,
    EOD_DTE2 DATE,
    FILLER1 VARCHAR2(4000 BYTE),
    FILLER2 VARCHAR2(4000 BYTE),
    FILLER3 VARCHAR2(4000 BYTE),
    BRM_LINKID1 VARCHAR2(20 BYTE),
    BRM_LINKID2 VARCHAR2(20 BYTE),
    BRN_ACQ_FLE_ORG VARCHAR2(50 BYTE),
    CRM_TRACK_FLAG VARCHAR2(20 BYTE),
    DIFF_AMT NUMBER(16,2),
    IS_RCN NUMBER(1),
    MCH_DTE DATE,
    MIGRATION_FLAG VARCHAR2(50 BYTE),
    NET_CDE VARCHAR2(20 BYTE),
    TRACK_FLAG VARCHAR2(100 BYTE),
    TRN_MM VARCHAR2(2 BYTE),
    TRN_YY VARCHAR2(4 BYTE),
    MOVE_FLAG VARCHAR2(15 BYTE),
    PURGE_FLAG NUMBER(2),
    REV_FLAG NUMBER(1),
    TEMPVCH_LOCK_DTE DATE
    Please provide me any refernce on web or document which i can implement or code on how to code the required trgger.
    Regards,
    Ganesh

    Perhaps you should consider using Materialized View Replication.
    http://docs.oracle.com/cd/E11882_01/server.112/e10706/repoverview.htm#autoId9
    Instead of writing triggers, you put a materialized view log on your source table. Then you can turn your backup table into a materialized view that is based on the source table. When you perform a fast refresh of the backup table MV, it will read the MV log on the source table. Refreshes should take almost no time at all to process.
    If the data must be absolutely up-to-date at all times, you can use refresh on commit so that the MV is always in synch with the table. Normally I recommend against using refresh on commit, and instead recommend a short refresh interval.
    You can use triggers as you suggest, but it seems simpler to use something like MVs to create a shadow table.

  • Multiple logon trigger for a user

    Hi,
    can I create two (or more) distinct logon trigger for a user? If yes, this situation is "clean"? Both triggers are executed on logon time?

    If you don't know what the wrapped source does
    and you don't care about the order
    then
    clean := false ;-)
    You filter access, but what if the unknkown wrapped source logs database access in some table on a user before your trigger DENIES access for that user/program?
    You would try to find out what the already existing trigger does (third party software?), if you really want to be clean.

  • Is it possible raise a trigger for particular user

    hi,
    i have oracle user zil,i want to write trigger for this user..
    with out writting trigger for each table .
    for ex:
    i have 2 tables in this user
    1.emp
    2.audit_log
    suppose i m inserting values into emp table at the same time insert into audit_log with action as insert,like that suppose i m updating any row in emp then insert one row into audit_log with action as modify,
    my question is is it possible to write a trigger for the user zil,not for table emp
    so i can maintain audit_log..
    pls give me a solution
    regards
    singh

    It depends upon how you are connecting to the Oracle database, if you are connecting through CITRIX then it is difficult to identify the user or the other option for you is to have a field USER in each table and pass the user name form the front end.
    To captures the changes in the table EMP and insert into the AUDIT table you may need to write a trigger in the EMP table and before you INSERT into AUDIT check the user.
    Or why dont you use AUDITING provied by Oracle.
    Thanks

Maybe you are looking for

  • CD/DVD Drivers Missing msg when starting newly installed iTunes 11.1.4

    I saw this error posted for other versions but none of the solutions have fixed the problem. The error msg is: The registry settings used by the iTunes drivers for Importing & Burning CD's & DVD's are missing.  This can happen as a result of installi

  • PO Order acknowledgment using Idoc

    Hi All, Some question about the PO Order acknowledgement. Anybody know that, if i use the idoc for order confirmation, is it possible to keep each time or record in the PO item confirmation tab? Because i tested, when i regenerated the idoc, that PO

  • Third Party Sales Order Issue

    Hi All, Created a sale order with five line items and in the line item 30 and 50 I had forced the Order for Rejection “90” and observed in  schedule line that Preq(PR) is not getting created for the line item 30 and 50 whereas for other line items 10

  • Aggregation Level on Multiprovider

    Hi All, I have a planning function on aggregation level built on multiprovider. When I try to Execute the planning function,the report is throwing an error as below- *InfoProvider YF2_OTIFA is being used in manual planning or in a planning function.

  • I want the predefine tables

    Hi , i am new to bw ,i want predefine tables in SD,MM.. where it is in R/3 system.so,plz tell the transcation code for it. with regards, goodyear.