Why is the release of the trigger on all fields in a table?

I have a trigger, and the text is the following. The trigger should write just the emplid in the PS_DM_ADDR_CHG_EMP table whenever there is an update to the fields
Street1, street.2, STREET3, CITY, STATE, ZIP, COUNTRY in PS_PERSONAL_DATA. But some how it is written emplid in the PS_DM_ADDR_CHG_EMP, when everything starts on any field of the more than 50 fields of the table PS_PERSONAL_DATA. Is there a reason why this happens. I looked in all the other triggers and none of them wrote something on this Board I found a trigger on PS_PERSONAL_DATA for an insert or update or delete on all fields and it uses insert into another table. I couldn't see any other triggers associated with the table PS_PERSONAL_DATA. So, how to diagonize the question of finding what is originally to write the data in the custom table.
CREATE OR REPLACE TRIGGER HT0P. PERSDATA_RAU
AFTER UPGRADING FROM STREET1, STREET.2, STREET3, CITY, STATE, ZIP, COUNTRY
ON PS_PERSONAL_DATA
REFERRING AGAIN AS NINE OLD AND OLD
FOR EACH LINE
DECLARE
v_Emplid ps_personal_data.emplid%type; -Used for the storage of EMPLID
BEGIN
v_Emplid: =: old.emplid;
UPDATE ps_dm_addr_chg_emp one
SET a.emplid = v_Emplid
WHERE (((a.emplid = v_Emplid) and (v_emplid) length = 3))
or ((substr (a.emplid, 1, 3) = substr (v_Emplid, 1, 3)) and (v_emplid) length = 4 and substr (v_emplid,-1, 1) to ("B", "C", "I, 'K', 'P', 'U'))
or ((a.emplid = v_Emplid) and length = 4 (v_emplid))
or ((substr (a.emplid, 1, 4) = substr (v_Emplid, 1, 4)) and length (v_emplid) = 5 and substr (v_emplid,-1, 1) to ("B", "C", "I, 'K', 'P', 'U'))
or ((a.emplid = v_Emplid) and length (v_emplid) = 5)
or ((substr (a.emplid, 1, 5) = substr (v_Emplid, 1, 5)) and length (v_emplid) = substr (v_emplid, 1, -1) and 6 in ("B", "C", "I, 'K', 'P', 'U'))
or ((a.emplid = v_Emplid) and length = 6 (v_emplid))
or ((substr (a.emplid, 1, 6) = substr (v_Emplid, 1, 6)) and length (v_emplid) = 7 and substr (v_emplid,-1, 1) to ("B", "C", "I, 'K', 'P', 'U')));
IF SQL % NOTFOUND THEN
INSERT INTO ps_dm_addr_chg_emp (emplid)
VALUES (v_Emplid);
END IF;
END;

Hello

It would be helpful if you could post code formatted using

 tags. Learn more from FAQ

To test your trigger - You may want to create a temparory table and have an insert statement for the temp table in your trigger and test it by updating other columns of your main table. 

Also you may want to ensure it is not the UPDATE statement which is causing the trouble for you by updating some unintended rows...

Regards,
Rakesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Tags: Database

Similar Questions

  • trigger for update field in a table with the sum of the fields to another table

    My experience in creation of triggers and pl/sql in general can be described in terms of oracle with the null value. I practiced by creating arrays and applications on my personal server at home to help me with some of my work related tasks. Right now I am creating a trigger which will, after insert, update, delete on the update of the table assignment_time_track the area of the time_spent on the table of assignments with the sum of the time_spent on the assignment_time_track table fields. I hope that run on the sentence it is clear to the people other than me. I tried this script on my own using the tool of creation of trigger for Oracle Database Express Edition, but I get the following error:

    Create a trigger failed, for the following reason:
    ORA-06552: PL/SQL: ORA-06553 finished Compilation unit analysis: PLS-320: the declaration of the type of the expression is incomplete or incorrect

    Here is my attempt to create the trigger on my own.

    create or replace trigger "ASSIGNMENT_TIME_TRACK_T1".
    AFTER
    INSERT or update or delete on 'ASSIGNMENT_TIME_TRACK '.
    for each line
    Start
    update assignments
    Set time_spent = (select sum (time_spent)
    of assignment_time_track
    where assignment_time_track.name = assignments.name);

    end;
    /


    If what I posted is not clear or more detail is needed, let me know and I will respond with a full description of tables and my goals for each table. Thanks in advance for any help. I also gladly accepts links to tutorials or lessons that explain how to do this kind of thing.

    Published by: bobonthenet on March 9, 2009 14:01

    I think I understand what you mean :)

    Rather than use a trigger to keep the master table (assignments) in sync with the time spent on the details, it would be much easier to use a query to do this, maybe creating a view.

    Something along the lines of

    SQL> create table assignments
      2  (id number primary key
      3  ,name varchar2(10)
      4  );
    
    Table created.
    
    SQL>
    SQL> create table assignment_time_tbl
      2  (id number primary key
      3  ,assid number references assignments
      4  ,time_spent number
      5  );
    
    Table created.
    
    SQL>
    SQL> insert into assignments
      2  select rownum
      3       , 'a'
      4    from all_objects
      5   where rownum < 5
      6  /
    
    4 rows created.
    
    SQL>
    SQL> insert into assignment_time_tbl
      2  select rownum
      3       , rownum
      4       , rownum * 3
      5    from all_objects
      6   where rownum < 5
      7  /
    
    4 rows created.
    
    SQL>
    SQL> commit;
    
    Commit complete.
    
    SQL>
    SQL>
    SQL> select a.id
      2       , a.name
      3       , (select sum (time_spent)
      4            from assignment_time_tbl
      5           where assid = a.id
      6         )
      7    from assignments a
      8  /
    
            ID NAME       (SELECTSUM(TIME_SPENT)FROMASSIGNMENT_TIME_TBLWHEREASSID=A.ID)
    ---------- ---------- -------------------------------------------------------------
             1 a                                                                      3
             2 a                                                                      6
             3 a                                                                      9
             4 a                                                                     12
    
  • Why is the window display all bookmarks empty even though I still see my favorites in Firefox &gt; bookmarks?

    The window display all bookmarks and bookmark side are empty, even though my booksmarks are always accessible from the Firebox menu > bookmarks. Unfortunately, I can't manage my favorites through this option. How can I fix the windows display all bookmarks and Favorites aside to display my favorites?

    One possible cause is a problem with the places.sqlite file that stores the bookmarks and history.

  • remove the dishes and all references in other table

    Hello
    I want to delete some entries in table1 and all references of this dishes of resistance to other table
    Take as an example
    Table1 (Att1, attr2) attr2 value reference table2(att1-1,att1-2), with the constraint attr2 = att1-1
    I want to know how to do with delete from table1...

    Concerning
    ELYES

    One option is to use the trigger.

    Kind regards.

    LOULOU.

  • Check if all the instances of a field in a table are empty?

    I'm having a problem with the control if all instances of a field in a table are empty. If one is empty I need a message box appears. There is a header line and a line of body with several text fields. The line of the body is set to repeat itself and there are buttons to add and remove lines of the body.

    I had success by checking if all fields are blank in the original line by using the following code:

    if ((this.resolveNode("Page1.Table1.Row3.TextField1").rawValue == null | )) this.resolveNode("Page1.Table1.Row3.TextField1").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField2").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField2").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField3").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField3").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField4").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField4").rawValue == ""))

    {xfa.host.messageBox ("Please complete the table of assessment/implementation." )} , 'Incomplete form' , 1);}

    I guess that in all cases be verified that I have to use the 'resolveNodes' function but I could not make it work. That's what I tried:

    if (( == this.resolveNodes("Page1.Table1.Row3.TextField1").rawValue null | )) this.resolveNodes("Page1.Table1.Row3.TextField1").rawValue == "") || .........)

    Although it works not since .rawValue isn't a function that work with resolveNodes (only resolveNode).

    Should what code I use for this?

    Thanks in advance for any advice.

    Hello

    To be able to check each field in a multiple instances of a table line, you must specify which line you are trying to access to...

    To do this, you must specify the index of the row, this way you can treat each rows in a loop and access each field within this line

    Instead of using resolveNodes, I suggest you use resolveNode... and it should look like this:

    for (var i = 0; i)< page1.table1._row3.count;="">

    If (this.resolveNode ("Page1.Table1.Row3 [" + I.ToString + "]").) TextField1.rawValue == null | this.resolveNode ("Page1.Table1.Row3 [" + I.ToString + "]"). TextField2.rawValue | .......) {

    xfa.host.messageBox ("Please complete the table of assessment/implementation.", "incomplete form", 1);

    break;

    }

    }

    I hope this helps!

  • Why my "Reset form" button didn't reset all fields?

    I use Adobe Acrobat X Pro and added a "Reset form" button on my form to fill out. It clears all fields, despite the fact that all the fields are selected to be cleared in the properties of the button. I deleted and added the button several times and I have the problem on a recurring basis. Any idea?

    What happens if you use the JavaScript code within the mouse event to the top of the button:

    resetForm();

  • Why is the trigger of the DAQ signal works not as I expect?

    Using the DAQ Assistant, I have received a signal at a rate of 100 k Hz and number of samples of 75 k. I would like a light every time that the amplitude of the signal falls below 1. As you can see from my attached graph, the amplitude becomes less than 1. However, the light does not turn. Any suggestions on what I'm doing wrong or misunderstanding, that I might have? This is my first project with the DAQ Assistant, then perhaps there is something simple that I'm missing.

    Hello

    The problem in your VI is that you gain 75 k samples, but you check if the second sample is less than 1V.

    This is because the Index Array node, it will give you only a single element of the array, which means a single sample.

    You should take just a sample at a time, or send the table going into a tunnel of indexing. But that could slow things down when you have so many samples.

  • Why is the chronology not all selected?

    I don't know why it selects only part of the scenario. When I try to add the chronology of another sequence he plays littleScreenshot (14).png

    You must move the out-point (the end of the line must be on the far right.

  • Why firefox did ask to make changes to my computer whenever I open the browser. Why is the screen pixelated all?

    When click on firefox on my desktop that a message appears to ask me if I will allow firefox to make changes to my computer. It happens every time. each page is also all pixelated and barely visible. the Explorer IS NOT to do THIS.

    A possible cause of this message, it is that Firefox is configured to run as administrator.

    Make sure that Firefox is not set to run as administrator.
    Right click on the desktop Firefox shortcut and choose "Properties".

    Make sure that all items are disabled in the tab "Compatibility" in the Properties window.

    • Privilege level: "Run this program as Administrator" should not be selected
    • "Run this program in compatibility mode for:" must not be selected

    Also check the firefox.exe program properties in the program Firefox (C:\Program Files\Mozilla Firefox\) folder.

  • Why is the contents of a field to fill in missing?

    I enter data into the fields to fill and save the document in pdf format. I sent it to someone who opens with an iPhone or iPad and the content of the field is not visible.

    Hello

    Did you send your form as an attachment to e-mail?

    It is highly unlikely that the e-mail recipient opened your PDF form in Apple Mail on an iPhone or an iPad.

    Please note that overview of Apple Mail doesn't show data form or annotations (Sticky Notes, highlighting, Freehand, drawing, etc.) in a PDF document.  This is the limit in Apple Mail, iBooks, and Safari.

    You can request the email recipient to install Adobe Reader for iOS and use the function "open" to open it in Adobe Reader.

    Please take a look at the section of the FAQ documents for instructions on how to use 'open '.

    Please let us know if you have any additional questions.

  • the selection of all colomns_names of a table, with their data types...

    HI :)

    I would like to know, how to select in SQL for all the names of columns in a table with their data types so that I get something like this:

    Table 1: table_name

    the ID of the column has the NUMBER data type
    the name of the column has Datatype Varchar2
    *....*

    --------------------------------------------------------------

    Table 2: table_name

    the check in the column has the NUMBER data type
    the air of the column has Datatype Varchar2
    *....*


    and it must be for all the tables that I own!...

    P. S: I'm trying to do this with java, so it s would be enough if you just tell me how to select all tables_names with all their colums_names and all their data types!...

    Thanks :)



    I've heard this can be done with USER_TABLES... but I have no idea how: (...)

    Edited by: user8865125 the 17.05.2011 12:22

    Hello

    USER_TAB_COLUMNS data dictionary view has a row for each column of each table in your schema. The columns TABLE_NAME, COLUMN_NAME and DATA_TYPE contains all the information you need.
    Another view of data, USER_TABLES dictionary, can be useful, too. He has a line of table pre.

  • With the exception of all columns in a Table?

    Is there a way to do this? Basically, I want between 0 and 9 columns in a table, but most of the time most of the columns will have no data in all. I need to completely exclude these columns in the model, is it possible to do this using conditional formatting (or something else) somehow?

    Use if@column
    Reference http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e12187/T421739T481157.htm#4535373

  • Best way to reset all fields of form with the exception of 1

    Hi, I have a button with the click event:

    xfa.host.resetData ();

    However, there is a field that is associated with the mechanics of form and not the user interface that calculates a number of days.  I want that the calculation to stay after the reset of all fields in the form.  How can I do better?

    Thank you!

    Hello

    A workaround is to declare a variable whose particular field value. Then reset the form. Then reallocate the specific field with the variable:

    var vField = TextField1.rawValue;
    xfa.host.resetData();
    TextField1.rawValue = vField;
    

    Hope that helps,

    Niall

  • 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?

  • trigger error autnomous mutation! Why not allow select in the trigger body?

    case 1. a user updates the table and this user has not committed, even fire user select request, he would get an old result. but no error.

    case 2. We have table x, trigger appears on the table x as soon as the table is updated to trigger fires. inside the body that we select just for table 'x' it throws error error changing table
    can someone please explain why?

    my example as follows:
    case 1:
    CREATE TABLE MyTable
    (NUMBER of c1);

    INSERT INTO myTable VALUES (1);
    commit;
    INSERT INTO myTable VALUES (2);

    Select * from myTable;
    C1
    ------------
    1




    case 2:
    CREATE TABLE myMaxTable
    (maxValue NUMBER);

    CREATE TABLE MyTable
    (NUMBER of c1);

    INSERT INTO myMaxTable VALUES (NULL);
    COMMIT;

    CREATE OR REPLACE TRIGGER myTrigger
    AFTER ON INSERT myTable
    FOR EACH LINE
    BEGIN
    UPDATE myMaxTable
    SET maxValue = (SELECT MAX (c1) FROM MaTable);
    END;
    /
    INSERT INTO myTable VALUES (1);

    INSERT INTO myTable VALUES (1)
    *
    ERROR on line 1:
    ORA-04091: table HUNBUG. MYTABLE is changing, function of triggering/can not see
    ORA-06512: at "HUNBUG. MON_TRIGGER', line 2
    ORA-04088: error during execution of trigger ' HUNBUG. MYTRIGGER'

    Assume that you are doing something like this:
    You have three records in the table:

    INSERT INTO myTable VALUES (1);
    
    INSERT INTO myTable VALUES (2);
    
    INSERT INTO myTable VALUES (3);
    

    Then do you one insert call to do more than three:

    INSERT INTO myTable
    SELECT c1 + 100
    FROM myTable;
    

    This last call insert inserts 3 records in your table - 101, 102 and 103.

    When you have a trigger FOR EACH ROW, which will be called three times, but there is no way to predict in what order, and when the trigger will fire for example at c1 = 102, the table is the "mutation" - it is located in the heart of a change and you don't know if 101 or 103 or both is in the table. Oracle does not allow you to do a select on the table of this mutation.

    When you remove the FOR EACH ROW clause, the trigger only will be called once at the end of this call to insert, moment in which the table is no longer changing and so your code will be located safely c1 max.

Maybe you are looking for

  • APPCRASH explorer.exe hpswp_BHO.dll

    Signature of the problem Additional information about the problem Bucket ID: 1048022001 Problem event name: APPCRASH Application name: explorer.exe Application version: 6.0.6001.18164 Application timestamp: 4907e242 Fault Module name: hpswp_BHO.dll F

  • Scanner HP 3570c Photo and imaging Director does not

    Being out of warranty, HP help is not cheap. I've uninstalled and reinstalled the driver disc and online, but still the HP Director will not work. This does not seriously affect the operation of the program, it's basically a big thing pop of menu wit

  • Unable to access most of the WVC80N sites on the internet

    I installed the WVC80N on my home network. Of the House, I can access the video camera using the URL standard xxxx.mylinksyscam.com:1024. However when I'm in my workplace firewall, I can't connect using this URL. At work, I have no difficulties to vi

  • How to: Restore my back of laptop for buying condition, remove Google and all add ons

    Original title: Restore my back of laptop for buying condition, remove Google and all add ons VistaInspiron 1525Centrino InsideReference DellLaptop2008Delete all the shortcuts, folders, data of the necessary United Nationssystem restore

  • Load library failed with error 126

    Occurs with programs: TrackIRv5.   UltimateDefrag 2008 and Radar ScreenSaver; all the progs re-installed-clean registry-install as admin... someone at - it a nail? TKS Jan