Cannot engage in the trigger

Hello

I'm trying to work around the problem of changing table. I have a before trigger on tableA that calls a procedure which creates a global temporary table to store the: new updated on tableA values.

Here is the code of the trigger and the code of procedure...

Someone knows what the problem...

Thank you

create or replace trigger postaladdress_before
before the insert or update
TO ADDRESS1 ADDRESS2 ADDRESS3 ADDRESS4 ADDRESS5, ADDRESS6, ADDRESS7
on tocpostaladdress
for each line
Start
postcode_temp_work ('new',:new.c,: new.i,: new.) Address1,: new. Address2,: new. ADDRESS3,: new. ADDRESS4,: new. ADDRESS5,: new. ADDRESS6,: new. ADDRESS7);
end;
/


Postcode_temp_work of procedure CREATE or REPLACE (tmode IN varchar2, pc in number, piin in numbers, pADDRESS1 IN varchar2, pADDRESS2 IN varchar2, pADDRESS3 IN varchar2, pADDRESS4 IN varchar2, pADDRESS5 IN varchar2, pADDRESS6 IN varchar2, pADDRESS7 IN varchar2)
IS
VC NUMBER: = pc;
VI NUMBER: = piin;
vaddress1 VARCHAR2 (40): = pADDRESS1;
vaddress2 VARCHAR2 (40): = pADDRESS2;
vaddress3 VARCHAR2 (40): = pADDRESS3;
vaddress4 VARCHAR2 (40): = pADDRESS4;
vaddress5 VARCHAR2 (40): = pADDRESS5;
vaddress6 VARCHAR2 (40): = pADDRESS6;
vaddress7 VARCHAR2 (40): = pADDRESS7;
vtmode VARCHAR2 (40): = tmode;


BEGIN
dbms_output.put_line (VC);
dbms_output.put_line (VI);
dbms_output.put_line (vaddress1);

Vtmode = 'new' IF THEN

EXECUTE IMMEDIATE ' CREATE of TABLE TEMPORARY GLOBAL t_my_postcode_update (NUMBER c, I have NUMBER, Address1 VARCHAR2 (40) address2 VARCHAR2 (40), address3 VARCHAR2 (40), address4 VARCHAR2 (40), address5 VARCHAR2 (40), address6 VARCHAR2 (40), address7 VARCHAR2 (40))';

EXECUTE IMMEDIATE (' insert into t_my_postcode_update (C, I, Address1, Address2, ADDRESS3 ADDRESS4 ADDRESS5, ADDRESS6, ADDRESS7) values ("'| vc |)) ''' ,''' || VI. ''',''' || vaddress1 | ''' , ''' || vaddress2 | ''','''|| vaddress3 | " ','' ' || vaddress4 | " ','' ' || vaddress5 | " ','' ' || vaddress6 | " ','' ' || vaddress7 | " ')') ;

END IF;

IF vtmode = "kill" THEN

EXECUTE IMMEDIATE 'DROP TABLE t_my_postcode_update';

END IF;


END;
/
display errors;

DDLS is auto-commettre, and you can not commit in a trigger, except if you use autonomous transactions

Anyway, it isn't a good idea using DDL in triggers. You really need this?

Tags: Database

Similar Questions

  • Engage in the trigger?

    With the help of AUTONOMOUS_TRANSACTIONS we can use COMMIT, ROLLBACK or point registration in database level triggers. So can we use form level triggers?

    You can use Commit, Rollback in your form triggers level without specifying AUTONOMOUS_TRANSACTIONS. And SAVE point can be set programmatically using set_form_property.

  • ASP - function Remote - error: cannot run the trigger

    Hello

    I tried to get my macros being run by a remote server.

    It's my function file remote named "remote_test_pc.asp":

    framework integrated; then

    conf t

    interface $INTERFACE

    Description macro $TRIGGER

    PC-VoIP-Port Description

    switchport access vlan $ACCESS_VLAN

    switchport mode access

    switchport vlan voice $VOICE_VLAN

    broadcast storm control level 1 k pps

    multicast storm-control level 2 k pps

    Storm-control action trap

    no event log status link

    bandwidth share SRR-queue 10 10 5 75

    form of bandwidth SRR-queue 10 0 0 0

    priority queue

    MLS qos trust dscp

    no link-status of snmp trap

    spanning tree portfast

    spanning tree enable bpduguard

    service-policy input PO_TRUST-PHONE

    output

    end

    FI

    framework integrated; then

    conf t

    interface $INTERFACE

    No description of macro

    Description by DEFAULT-CONFIG

    switchport mode access

    switchport access vlan 999

    broadcast storm control level 1 k pps

    multicast storm-control level 2 k pps

    Storm-control action trap

    spanning tree portfast

    No switchport voice vlan $VOICE_VLAN

    bandwidth share SRR-queue 10 10 5 75

    form of bandwidth SRR-queue 10 0 0 0

    priority queue

    MLS qos trust dscp

    no service-policy input PO_TRUST-PHONE

    FI

    output

    end

    FI

    And this is my config on the switch to mac-group and the macro:

    !

    macro auto Test group address-mac-PC

    Mac 0019.9990.5509 address list

    !

    comprehensive treatment of the auto macro

    macro auto control global detection mac address

    !

    automatic macro execution Test-PC remote ftp://192.168.1.11/remote_test_pc.asp ACCESS_VLAN = 123 VOICE_VLAN = 127

    !

    When I plug this workstation for the following syslog messages:

    Switch #.

    Remote_test_pc.asp loading!

    [OK - 1702/4096 bytes]

    Enter configuration commands, one per line.  End with CNTL/Z.

    Switch con0 is now available

    Press RETURN to get started.

    Error: Cannot run the trigger Test-PC, please check trigger exists and corresponds to the valid function

    26 September 11:45:37.755: % SYS-5-CONFIG_I: configured from console by console

    26 September 11:45:37.772: % AUTOSMARTPORT-5-INSERT: tty0(user id:): dispositif avec adresse mac 0019.9990.5509 détectées sur l'interface FastEthernet0/3, exécuté le Test-PC) Message

    Switch #.

    The port works as it should, but I wonder about the error message.

    The switch is 2960 with IOS 12.2 (58) SE2.

    Can someone explain what this means?

    Thank you very much!

    Sven

    Hi Sven,

    I think that you are not constantly getting this message... Ignore it for now... That have no functional impact... This has been supported in 15.0 (1) SE.

    Thank you

    Ankur-

  • At the launch of Warcraft III I get "cannot engage the directx '.

    at the launch of warcraft III using windows 7 Professional (64 bit), I get message "cannot engage the directx '. I reinstalled directx 11 and my video drivers without success.  I also tried to reinstall warcraft III.  This game has launched and has worked well for more than two months and then started to do this.  In a first time, if I restarted my computer it would start the game, but now it does not work.  What can I do?

    Obviously with the game running properly for a while, it is compatible with Win7.
    The game is fully patched?
    You have all the updates of Windows Installer? KB976264 is an important
    Update for older games.

    If the problem is actually a Direct X issue then the files that uses the game can somehow are damaged. In this case use Web Direct X Setup will fix the problem not as the Web Installer does not overwrite the DX files. It only installs files DX "missing."
    Try the redistributable of Direct X Installer, as it will overwrite the original files-
    Download details - Microsoft Download Center - DirectX Redist (June 2010)

    If you have other games that run properly then try reinstalling the game.  You can save your backups to be used after the relocation.
    If you don't have any other games using a PC with a graphics card, it may be worth re - a corner of your graphics card.
    Feeding offshore and disconnected (wait for the LED on the motherboard turns off, or wait more than 30 seconds if there is no LED) disconnect the cable from the monitor and remove the card from its location (do not handle map of the Strip).
    Clean the crack with a small clean brush and hand over the card.

    Without all the above, you can test the card in another machine, or another card in your machine.

    .

  • Cannot undo the Trigger on DAQmx task configuration

    Hello

    I'm running into a DAQmx problem where the type of trigger for departure does not properly get sent to the material in the case following (using X with DAQmx 9.5.1 series):

    1 set up and run an output meter task finished with a trigger digital start (I have not tested other channel or other types of triggers).

    2. stop the task before a trigger is sent to hardware (I have not tested what happens that if you send the trigger first - hardware in my real application, the task is redeclenchables anyway).

    3 try to configure the task to use no trigger to start and start the task.

    4 do the trigger type queries in the software at this point says 'none', but the material is still configured to use the trigger to start.  It seems to be a way to configure the hardware to do not use the trigger at this point.

    It is an embarrassment to me because I would have liked to keep the same task autour handle, but in order to switch between the modes of trigger and no trigger I have to erase the task completely and re - initialize everything that's embarrassing for me since in my application, I have at least 2 son can stop the task and I can provide is no longer simply the task manage for each thread during the launch it.

    A simple way to reproduce the problem, just try to start the VI below:

    You can tell that the trigger is always configured as none pulse is generated, and the loop is not closed until a trigger is provided on PFI0.  Re-reading the trigger type using a property node you find it inconsistent with what really material.

    I don't need really workaround (I should be able to lead a myself who is to clear the task each time that trigger properties are task parameters changed and storage myself rather than relying on DAQmx) but I wanted to just report it as a bug.  The solution is, but it adds a lot of complexity to my request and is as ineffective as it is clearing unnecessarily and re-creating a task.

    Best regards

    Hey John,

    Good to hear from you.

    I've reproduced the problem and filed the application of Corrective Action (365307) to follow up the matter.

    Thank you.

  • Cannot change the size of the trigger

    whenever I try to change the size of the trigger, it returns to its original state as soon as I let go of the mouse. This is a problem because now all my goals are overlapping.

    I don't know if this is necessary, but it is a picture with a smooth rolling inside the trigger that is connected to a composition of light-box with a slide show placed inside that.

    any help?

    I'm assuming you are trying to set the trigger smaller, if you do this make sure that there is nothing else inside the trigger that is greater than to be the trigger. most of the time for me, I have a text box in mine

  • the trigger for camera AVT Pike-based software

    Hello

    I'm using labview 8.5, as well as the acquisition of vision (IMAQ-dx, latest version) software, to control a cross beam motion detector and AVT pike camera using a high speed cable IEEE 1934 (800mbps) b.

    I wish to have a trigger internal (software) control system and have no problem to get Boolean cross beam sensor signal or run indepedently of the camera (about 300 FPS).

    The problem is the trigger.  I have a problem with where to put the camera vi in the relation to the probe wiring diagram.  In the image as an attachment, I have the sensor in a loop and the camera, in a nested loop.  However, when I trigger the camera manually with a push button, the sensor stops running.  And when I try to control it with the sensor instead of the push button, I can boot, but cannot stop the camera.

    Basically, I just want to know if there is a method of internal trigger to control camera image recording.

    Thank you for your time,

    Veritas

    Ah yes! just before I read your reply I tried... and it certainly helped.

    Thank you!

  • Task Scheduler ignoring "expires" field of the trigger

    I have set up a task to run a simple command (rundll32.exe with some settings) on Windows 7. The task is triggered by workstation unlock, has an expiration time/date (checked = active) and is enabled.  I set the timeout at 11:25 August 1, 2012, the time current 11:20 1 August 2012 and locked the workstation, then unlocked it. The evnt triggered very well. But when I blocked the workstation after 11:25, it triggered yet, even if the HELP says "expires: this parameter allows to set the date and time of the trigger to expire." When a trigger is expired, it cannot cause the task to run'.

    The task history indicates for each time I've unlocked the workstation: task triggered unlocking > engine message received task to start the task > task started > Action began > created the task process > completed > completed.

    It does not show errors or other messages, and the final message is stamped the same second as the first journal, so it is running and completed in less than a second.  So why is it always triggered when the present time > timeout?

    Any help appreciated, it's weird.

    I have no way of telling if this is relevant to your case, but TechNet explains that, for the parameters of expiration - time is relative the time zone set on the computer that runs the task. Check the universal check box to make the time from universal time coordinated (UTC) instead of the time zone set on the computer that runs the task.  Did you accidentally check universal, perhaps?

  • How to hide the trigger on the top layer

    Hello

    can someone help me with this problem?

    Each icon is a trigger in the other layer.

    When I clicked on the icon, it will display the target (white box), but somehow the other icon is always on display.

    I tried to move the layer to the trigger, but it cannot be moved anywhere on the layer.

    I thought to create another separate page for each icon, but it will not reach the design I wanted.

    Can someone help me how to get the icon disappear please?

    IM using muse CC 2015.2 Release

    Thank you

    Raydi

    Screen Shot 2016-09-20 at 6.55.jpg

    Check the options in the widget settings. If it is enabled, clear the triggers on the top .

    David

    Creative muse

  • Field containing average function works only when the data are engaged on the same page. Does not work for fields on other pages.

    I'm having a problem with a field defined to calculate the average of eleven points fields (points 1 to 8 on page 1-9-11 on page 2). My original question was that it could exclude fields of points when they do not have information entered and adjust the average calculation (number of "divided by") accordingly.

    I had someone write JavaScript code for him, but I just found a small problem I don't know if it's something in the code or what the person who originally wrote the script cannot understand it either and suggested that I have post here.

    The middle area (located on the 2nd page of the pdf page two) seems to work exclusively with precision if at least one of the points of the fields on the 2nd page, 9, 10 (and 11) are engaged with the data. No values entered on the first page and only the first page, are for some reason any dividing by a more than expected. For example, if I fill the boxes 1, 2 and 3, it divides the total by four. If I filled just box 7, it halves. If I fill all 8 boxes on the 1st page, it divides by nine. It is corrected as soon as I get the points in one or more of the three boxes on the 2nd page points, suddenly the overall average is accurate. But if boxes 9, 10 and 11 contain no points, then the average is still inaccurate because the number of ' divide by "he uses is one more than what it should. I can't understand how to attach the form to this post, so I downloaded on Dropbox: Dropbox - used Evaluation.pdf.

    Under the direction of State: javascript came work to exclude the empty boxes when the points are entered in one of the three points of fields on the 2nd page (and more), but the average function is not accurate because it adds 1 to the number of ' divide by "in the calculation of the average If the points are only entered into the fields on the 1st page.

    Here's the code I entered in the 'Custom calculation Script' box in the 'Calculate' tab of the Properties menu of Test field:

    Initialize variables

    var num = 0;

    var sum = 0;

    Browse the input fields

    for (var i = 1; i < 12; i ++) {}

    var f = getField ("points." + i);

    If {(f.valueAsString)

    increment the counter to non-empty field

    NUM ++;

    Add the value of the running total field

    sum += + f.value;

    }

    }

    Calculate the average

    If {(num)

    Event.Value = sum / num;

    } else {}

    All fields are empty, then the empty value

    Event.Value = "";

    }

    I do not see that. Add the code of script debugging will display the results that each field is completed:

    Initialize variables
    var num = 0;
    var sum = 0;

    Browse the input fields
    for (var i = 1; i)< 12;="" i++)="">
    var f = getField ("points." + i);
    If {(f.valueAsString)
    increment the counter to non-empty field
    NUM ++;
    Add the value of the running total field
    sum += + f.value;
    }
    }
    Debug - display results as the form is filled;
    Console.Show
    Console.println (sum + "/" + num + "=" + sum/num);
    end of debugging;
    Calculate the average
    If {(num)
    Event.Value = sum / num;
    } else {}
    All fields are empty, then the empty value
    Event.Value = "";
    }

  • Why control statements such a ROLLBACK or COMMIT of the Transaction are not written in the trigger?


    Hello world

    Why the ROLLBACK statement or COMMIT are not allowed in the trigger? and if I then use this problem may happen?

    IndiMinds wrote:

    Hello world

    Why the ROLLBACK statement or COMMIT are not allowed in the trigger? and if I then use this problem may happen?

    Because a trigger is NOT a transaction. This is a SINGLE STATEMENT, which is part of another transaction.

    What is the problem? Well, if the trigger does not use the pragma AUTONOMOUS_TRANSACTION to the 'problem' that occurs is an Oracle exception, since you cannot use commit or rollback in the standard triggers.

    If a trigger contained a VALIDATION you wouldn't be able to write a transaction that contained multiple measures correctly.

    What happens if you insert rows in multiple tables and you want to perform a COMMIT ONLY if all three insertions succeed?

    This is not possible if one of the tables had a trigger with a posting in it.

    What do you want to learn more about?

  • need, update the message after inserting the trigger data

    Hi all

    CREATE OR REPLACE TRIGGER xxc_student

    AFTER INSERTION

    WE raise

    BEGIN

    Dbms_output.put_line ('end of Inserted');

    END;

    And I want to insert data into the table:

    INSERT INTO student (name) VALUES ("ABC");

    INSERT INTO student (name) VALUES ("CCC");

    INSERT INTO student (name) VALUES ('DDD');

    INSERT INTO student (name) VALUES ("EEA").

    COMMIT;

    I have the following results:

    1 row inserted

    end of Inserted

    1 row inserted

    end of Inserted

    1 row inserted

    end of Inserted

    1 row inserted

    end of Inserted

    ENGAGE

    And I would have

    1 row inserted

    1 row inserted

    1 row inserted

    1 row inserted

    end of Inserted

    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    Thank you

    No, this isn't possible; e by a trigger.  Relax, you have created is a statement after trigger, so it fires after the insert statement is complete.  In the first example, you have 4 separate SQL statements, so the trigger is activated after each statement.  In your second example, you have a single SQL statement that affects the 4 lines, if the trigger is activated once the end of the statement.

    The number of inserted rows is reported since sqlplus (the client), based on what the engine SQL in the database said he did.  Since there is only a single statement engine SQL reports 4 lines inserted at the client, not four row insertions.

    What problem are you trying to solve with this approach?  In General, dbms_output is not much used in production code, except occasioanlly as a simple debugging tool.

    John

  • the value of overflow from the stage of the trigger code

    Cannot find out how to change the value of the trigger code overflow. I can't read yet.


    Alert (sym.getComposition () .getStage (). CSS ("overflow"));

    No code of the trigger after the above line will run. Lines before running.

    By using this link as a reference, I thought that I could do:

    sym.getComposition () .getStage () .css ("overflow", "visible");


    I tried to use an intermediate variable. No dice. Any ideas?

    Use like this:

    sym.getComposition () .getStage (). getSymbolElement().css ("overflow", "visible");

    HTH,

    Vivekuma

  • It does not work when you use the trigger to check the data of the other table.

    Please help me with this, I put a trigger on a table, but it can not work as I expect.

    case study: a class has many students, one of them is going to match.
    The purpose of this trigger is to check when to choose a student going to match, this student has in his class where it belongs to.
    Oracle version is 10.2.0.1.0.
    --table:
    DROP TABLE STU;
    DROP TABLE CLASS;
    
    create table CLASS(
    CID     VARCHAR2(5)   PRIMARY KEY,
    CNAME   VARCHAR2(20)  NOT NULL,
    SCHOSEN VARCHAR2(5));
     
    create table STU(
    SID     VARCHAR2(5)   PRIMARY KEY,
    SNAME   VARCHAR2(20)  NOT NULL,
    CID     VARCHAR2(5)   NOT NULL REFERENCES CLASS(CID) ON DELETE CASCADE);
    
    --data:
    --CLASS
    INSERT INTO CLASS(CID,CNAME) VALUES(1,'SUN');
    INSERT INTO CLASS(CID,CNAME) VALUES(2,'MOON');
    INSERT INTO CLASS(CID,CNAME) VALUES(3,'EARTH');
    --STU
    INSERT INTO STU VALUES(1,'JACK',1);
    INSERT INTO STU VALUES(2,'TOM',1);
    INSERT INTO STU VALUES(3,'LILY',2);
    INSERT INTO STU VALUES(4,'DUSTIN',3);
    
    --TRIGGER
    CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    
    DECLARE
    DUMMY INTEGER;
    INVALID_STU EXCEPTION;
    VALID_STU EXCEPTION;
    MUTATING_TABLE EXCEPTION;
    PRAGMA EXCEPTION_INIT(MUTATING_TABLE, -4091);
    
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
      SELECT SID FROM STU, CLASS
      WHERE STU.SID=ST AND STU.CID=CLASS.CID AND CLASS.CID=CL
        FOR UPDATE OF CLASS.SCHOSEN;
    
    BEGIN
      OPEN DUMMY_CURSOR(:NEW.SCHOSEN, :NEW.CID);
      FETCH DUMMY_CURSOR INTO DUMMY;
      IF DUMMY_CURSOR%NOTFOUND THEN
        RAISE INVALID_STU;
      ELSE
        RAISE VALID_STU;
      END IF;
      CLOSE DUMMY_CURSOR;
    EXCEPTION
      WHEN INVALID_STU THEN
        CLOSE DUMMY_CURSOR;
        DBMS_OUTPUT.PUT_LINE('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
      WHEN VALID_STU THEN
        CLOSE DUMMY_CURSOR;
        DBMS_OUTPUT.PUT_LINE('STUDENT CHOOSE SUCCEFULLY!');
      WHEN MUTATING_TABLE THEN
        NULL;
    END;
    /
    Just copy and paste on it and try to run next:
    UPDATE CLASS
    SET SCHOSEN = 3
    WHERE CID = 1;
    Clearly, you can't student who is 3 as to Member of class 1. Please help me. Thank you.

    Published by: 991096 on March 1st, 2013 02:36

    Published by: 991096 on March 1st, 2013 03:03

    Published by: 991096 on March 1st, 2013 03:11

    Hello

    991096 wrote:
    1. the purpose of this trigger is to check when to choose a student going to match, this student has in his class where it belongs to. Then, when I try to choose 3 student-member of correspondence of class 1, should give me "PLEASE RE-ENTER ID AND STUDENT ID AS CLASS or STUDENT not IS NOT VALID."

    Then do something like this:

    CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
        sid_found     stu.sid%TYPE;
    BEGIN
        dbms_output.put_line (:NEW.schosen || ' = schosen entering check_schosen');             SELECT  sid
             INTO    sid_found
         FROM      stu
         WHERE     sid     = :NEW.schosen
         AND     cid     = :NEW.cid
         AND     ROWNUM     = 1     -- to avoid TOO_MANY_ROWS
         ;
    EXCEPTION
        WHEN  NO_DATA_FOUND
        THEN
         RAISE_APPLICATION_ERROR ( -20000
                        , 'Please re-enter class id and student id as class ('
                          || :NEW.cid
                          || ') or student ('
                          || :NEW.schosen
                          || ') is not valid.'
                        );
    end;
    /
    

    DBMS_OUTPUT creates only a message. The message may not be displayed, and if this is the case, then the user cannot see it. The DML will still take place.
    I used instead, RAISE_APPLICATION_ERROR to keep the DML does not happen. It displays a message like

    ORA-20000: Please re-enter class id and student id as class (1) or student (3) is not valid.
    

    ' 2 ' game ' means ' an official competition in which two several people or teams competing.

    What individuals or teams are competing in this case?
    In any case, the question wasn't 'that 'game' means', but

    Frank Kulash wrote:
    What do you mean when you say "going to match?

    I think that now you're saying that the new values of (class.cid, class.schosen) must be equal to (or "fit") some existing (stu.cid, stu.sid).

    3. thanks for your tip, I learned how to use '{code} '.

    4. it's really goes with the exception of MUTATING_TABLE. So, how do to fix the trigger to show me INVALID_STU EXCEPTION when I try to choose a student does not belong
    a class?

    Don't refer to the table of class in the trigger, and the error table mutation occur. All the information you need are in the stu table, so there is no need to query the table of class, anyway.

  • DB trigger error - update even table in the script of the trigger

    Hi all
    I have a table tab1, whenever any update is done on this table on column col1 and col2 also needs to get the update. (These are related to user forms can be updated only col1 form frontend)
    So I created a trigger as follows.
    ----------------
    CREATE OR REPLACE TRIGGER tri1
    AFTER UPDATE
    ON tab1
    FOR EACH LINE
    WHERE (NEW.col1 = 'YES')
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    Tab1 SET col2 = 1 UPDATE
    WHERE transaction_id =: OLD.transaction_id;
    COMMIT;
    END;
    --------
    When there is no update on this table, I get following error. Please let me know if I'm missing something.
    ORA-00060: Deadlock detected while you wait resource
    ORA-06512: at "user1.tab1", line 5
    ORA-04088: error during execution of trigger 'user1.tab1 '.
    Please let me know if I'm not clear. Thank you

    Published by: DharV on August 23, 2011 05:17

    Your transaction_id is unique?

    If this is the case, then you could perhaps use AFTER UPDATE BEFORE UPDATE:

    CREATE OR REPLACE TRIGGER tri1
    BEFORE UPDATE
    ON tab1
    FOR EACH ROW
    WHEN (NEW.col1 = 'YES')
    BEGIN
       :NEW.col2 := 1;
    END;
    

    If your transaction_id is not unique - if you really want to update more than one line in tab1 - your update cannot update the same line that the trigger has responded, even with the use of an autonomous transaction. Then you could combine the BEFORE UPDATE trigger above with your own AFTER UPDATE, but then add ROWID! =: OLD. ROWID to where clause, but it would be a bad idea because some of your lines will be updated in a single transaction and others in another transaction.

    In general the autonomous transaction is not a great way to solve the problem of changing table within a trigger. I hope that you have a unique transaction_id and can do BEFORE the UPDATE - if it is then a better way is to save the update id in an overall picture in FOR EACH ROW triggers, and only then AFTER an UPDATE fire is NOT "for each line" update the list of saved IDs

Maybe you are looking for