Triggers on tables

hi,
consider a table z_table.It has 5 existing fields.I added 3 more fields to it.These 3 fields are present in different tables.
i wrote a program to update the data of those 3 fields bsed on the 5 fields which are already existing.
it is fine upto this part.
user enters the data of the existing 5 fields only.
whenever user enters the data of those 5 fields,data of the added 3 fields should get updated.
my idea is
when a new row is inserted or updated in a table it should trigger an event (how and where the trigger code is written) and that event should call a report which updates data of those three fields.
how to achieve this idea.
thanks in advance.
regards,
srinivas.

And to trigger an event on record insert you should create a TMG for that and write the logic in events.
Otherwise while updating/inserting records to the table through ABAP you should calculate and supply the other field values before inserting into the database.
Regards
Karthik D

Similar Messages

  • Can not view the code for views, triggers or table definition

    Hello Gurus,
    I can not see the code for any of the triggers, views, tables etc. in sql developer. For instance a view code will be
    "create or replace" and then nothing, I could see the code in the past.
    When clicking on SQL tab for table I get following errors
    1. Ora-00904 Invalid Column name
    2. Ora-31600: invalid input value emit_schema for parameter name in function SET_TRANSFORM_PARAMORA-06512: at SYs.DBMS_SYS_ERROR............................
    please advice.
    Thanks

    Sqldev was only certified starting from 9.0.2, so it's possible that's the culprit. The latest update in the certification document even omits 9i entirely.
    Did it start happening after upgrading sqldev? What version are you on?
    K.

  • Support for triggers for tables with clustered column-store indexes

    Hello,
    We are very excited about the new clustered column-store indexes in SQL 2014 and our performance tests shows significant performance gains.  However, our existing functionality relies on triggers and they are not allowed on tables with column-store
    indexes.  Does anybody have information as to whether allowing triggers on tables with column-store indexes is anywhere on the radar?
    Thank you!
    P.S.  We spent a lot of time considering various work-around to avoid triggers, but the amount of work we would have to do is simply overwhelming, so we are considering delaying our upgrade until such functionality hopefully becomes available.

    My gut reaction is that this restriction is likely to remain for the forseeable future. Columnstore indexes are intended for data warehouses, and while I don't do data warehouses myself, I cannot say that a fact table is where I expect to find a trigger.
    But if you think that there is a good business case for permitting triggers on columnstore tables, submit a suggestion on
    https://connect.microsoft.com/sqlserver/feedback
    Note that if you give some business-oriented explantion why this is a great benefit, it is more likely that Microsoft is likely to listen.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Triggers on tables in the Oracle BAM DataObjects

    Hi there.
    I am using Monitor Express in Oracle BAM 11.1.1.4 (PS3) and the field LATEST from dataobject BIdefault_composite_component is working as desired.
    I want to use the same solution in Oracle BAM 11.1.1.3, but the field "_LATEST" was not filled automatically as other fields.
    So, I tried to write a trigger to update _LATEST manually, but when I added a new register, using BAM Architect, an error message was shown:
    BAM-01265: An error (ORA-04091: table DEV_ORABAM._BI_DEFAULT_BPMFormalisticaBND is mutating, trigger/function may not see it ORA-06512: at "DEV_ORABAM.ATUALIZALATEST", line 4 ORA-04088: error during execution of trigger 'DEV_ORABAM.ATUALIZALATEST' ) has occurred in the Active Data Cache storage system.
    But bam_server.log don't show nothing related to this error.
    Do I can not add triggers to BAM's dataobjects?
    Thanks.
    Luciano

    Problem solved.
    I had formulated my trigger incorrectly (I rewrote it after to see http://www.techonthenet.com/oracle/errors/ora04091.php).
    After to fix my trigger, i had the same result (or similar) that was expected with PS3 installed: atualization of field LATEST of the dataobject BIDEFAULT_...
    Luciano

  • Select event not triggered in table with only one row

    Hi all,
    I am building a BI VC application where query data is displayed in a table. When the user clicks on a table row another query is then triggered and output in a second table. The output from table 1 is linked to the input of query2/table2 with a select event.
    The problem that I am facing is that if there is only one row in table 1, the select event is never triggered. If, however there are two or more rows in the table the select event is triggered and query 2 is executed. I have searched the forums but all I could find on select event problems was how to avoid the initial select event.
    Has anyone else experienced this issue and what is the workaround or is this a bug in Visual Composer? We are on VC 7.0 SP19.
    Cheers,
    Astein Meland

    Thanks Chittya,
    Yes we have considered this option as well. But as we have more than one table linked together we would like to avoid having to manually click several buttons.
    In the end I found Note 1364334 describing bugfixes released in VC 7.0 SP20:
    "Normally, when a Visual Composer table is populated from a data service, the first row is selected by default. However, we have found that if only one data row is returned from the data service, this row is not selected by default and cannot be manually selected by clicking on it either."
    So I think we will just have to upgrade our Portal to the latest support packs to solve this problem.
    Thanks,
    Astein

  • Apple Pay triggered by Table Tracker at StoneFire BBQ restaurant

    While waiting for my food at StoneFire BBQ (a mediocre BBQ pit in SoCal), I noticed that their "table-tracker" device triggered my Apple pay on my 6+. Never noticed this happening before. Is this an 8.3 thing?

    While waiting for my food at StoneFire BBQ (a mediocre BBQ pit in SoCal), I noticed that their "table-tracker" device triggered my Apple pay on my 6+. Never noticed this happening before. Is this an 8.3 thing?

  • Triggers affecting tables??

    Hello guys
    I would like to know the order in which triggers are fired between row-level triggers, statement-level triggers, before and after triggers, instead of triggers, schema triggers and database-level triggers.
    Also how could you know when a trigger is affecting operations for any user specified table????
    Thanks
    Andres

    Hallo,
    before statements,
    before for each row,
    after for each row
    after statements
    http://asktom.oracle.com/pls/ask/f?p=4950:8:5179946795975971945::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:50388450774416
    Order makes sense only in context of DML- Triggers.
    DDL- triggers are fired by system event (startup, logond and so on).
    Instead of trigger is for views and also haven't any orders.
    Regards
    Dmytro

  • Preventing textchanged event from triggering on table adapter update?

    Hello fellow humans
    I have a listbox populated from an MS Access database file. The user can select different values and textboxes and richtextboxes will display corresponding  strings from the same database file.
    All of these textboxes and richtextboxes will trigger on text changed event. And here's the deal: I want it to trigger when the user inputs something in the textboxes, but I *dont* want it to trigger when I call the .update on the table adapter.
    Is this possible somehow?

    Make a global bool and set it before you update and then test it in the textbox event ie:
    Sub Textbox1_textchanged event
        If allowtextboxchange then
           ' do the text box code
        end if
    End sub

  • Null value in detail table's primary key

    I use Business Components Data Form to define a master-detail java panel.
    I don't display the primary key column in the detail grid control.
    Then I click on "+" to add a row, enter a value (the 2nd part of the detail table's primary key) and click commit.
    I get an error saying that the primary key column that's not displayed is null and the row cann't be committed.
    How do I fix this error?

    My fields are varchar2's.
    -- simplified to protect the guilty:
    -- (made up from memory, so sql keywords may --be misspelled, but you get the idea)
    create table proj (
    proj varchar2(10) not null,
    constraint proj_pk
    primary key(proj)
    insert into proj values ('abc');
    commit;
    -- this table has legal values for -- the master.legal field.
    -- in master, legal was changed to a -- ComboBoxControl control from -- TextFieldControl that the wizard -- generated.
    create table legal_values (
    proj varchar2(10) not null,
    legal varchar2(10) not null,
    display_order integer not null,
    constraint legal_values_pk
    primary key (proj, legal)
    insert into legal_values
    values ('abc', 'one', 1);
    insert into legal_values
    values ('abc', 'two', 2);
    insert into legal_values
    values ('abc', 'three', 3);
    commit;
    create table master (
    proj varchar2(10) not null,
    masterKey varchar2(15) not null,
    legal varchar2(10) not null,
    constraint master_pk
    primary key (proj, masterKey)
    create table detail (
    proj varchar(10) not null,
    masterKey varchar(15) not null,
    detailkey varchar(10) not null,
    display_order integer not null,
    status varchar2(12) not null, -- user can only update this field
    constraint detail_pk
    primary key(proj, masterkey, detailkey)
    -- legal rows for detail table
    create table detail_values (
    proj varchar2(10) not null,
    detailkey varchar2(10) not null,
    display_order integer not null,
    constraint detail_values_pk
    primary key(proj, detailkey)
    insert into detail_values values
    ('abc', 'status a', 1);
    insert into detail_values values
    ('abc', 'status b', 2);
    commit;
    -- if their is a foriegn key on details back
    -- to master, then you get the
    -- "mutating table" error when trigger
    -- occurs.
    create or replace trigger master_tr
    after insert on master
    for each row
    begin
    insert into detail
    (masterKey, detailKey, status, display_order, status)
    select :new.masterkey, detail_key, display_order, ' '
    from detail_values;
    end;
    -- detail.status is a comboboxControl getting --its values of of another db table too.
    -- there's also "after update" triggers on master and detail tables that copy the record to master_history and "detail_history" tables if the corresponding table is modified. Thus we have a history of the changes made to the records. The 2 history tables have 2 additional fields than their parents, "modified_date date default sysdate not null" and "modified_by varchar2(30) default user not null" that record when and who made the change. There's also a change type field that records where the change is an insert, delete or update (there 3 triggers per table , so we can correctly record change type as being insert, delete or update into the change_type field).
    If you want to make it more real to life, the status value is initially blank, then can be changed to a legal status value (complete or not complete), but can not be changed back to blank.
    ***P.S. I have to have this ready for production by monday.****
    P.P.S After you reply and change to ComboBoxControls in 2 places, try changing the table names and/or the column names (say to follow the DBA's naming convention) or add another field to the composite primary key (and unstated foriegn key) (using drop table/create table). Now try getting the existing code to run. No writing down the old/new table (or column) name pair names. Just run the code and try to fix the code based on the error messages. Are the error messages giving you adequate information to find the problem?

  • Commit not allowed in Trigger  then how to store the values in table

    Hi,
    Database trigger not allowed to COMMIT in it (directly) or in procedure which is calling from the Trigger. it gives error.
    so my question is:-
    1)How Database internally store the INSERT AND UPDATE value in table which is written in procedure without COMMIT?
    2) Is it necessary to write COMMIT in procedure using PRAGAMA AUTONOMOUS TRANSACTION to store inserted or updated value in table?
    Thanks in advance.

    Hi,
    A trigger is designed to be a part of a transaction, not it's end.
    It is like following these steps (not really accurate, but should give an idea):
    1. programA issues INSERT statement on tableA
    2. 'control' goes over to the database
    3. constraint checks happen
    4. the associated triggers on tableA do their work (e.g. fetching a sequence value for a primary key)
    5. 'control' goes back to programA
    6. programA decides if a commit (no error occurred) or a rollback (error case) has to be issued.
    Did this help? Probably not, I'm not happy with what I wrote, but anyway... :)

  • How to make screen field enable when table control gives an error

    Hi,
        I had a scneario like when table control data wrong then one parameter of the screen should be enabled for the input, i knew that screen-name will not work since it will have always table control fields only when table control gives an error.
    How to make the other parameter enable when table control throws an error.
    Regards,
    Jaya

    Hi Gobi,
         Thanks for your response, but issue is - how to make other screen fields enable when there was an error in the table control data.
    For table control - lets say we will use the code as i mentioned above.i am sure that we cant write the code for field enable in between loop & endloop.
    as you said if we right outside the loop-endloop, the module wont be triggered when table control throws an error, because that statement was not there in the loop-endloop.
    please let me know if you need any more information on the issue. I hope there is alternative for this in SAP.
    Thanks
    Jaya

  • How to create database triggers in ABAP Dictionary

    Hi,
    How can i create database triggers on tables, like the update, delete and insert triggers which we used to create in SQL sever and other databases, is there any transaction for doing the same from ABAP dictionary. or should it be done at the raw database level.
    Thanks
    Akila.R

    Hi,
    please check out the following link it might help you
    http://help.sap.com/saphelp_nw2004s/helpdata/en/71/a8a77955bc11d194aa0000e8353423/content.htm
    *************please reward points if the information is helpful to you******************

  • How to justify the values in table using report generation tool kit

    Hi
    How can we align the values in excel table using report generation toolkit.
    like left,right,center.
    Regards,
    hari
    Attachments:
    Report_excel.vi ‏34 KB
    New Bitmap Image.JPG ‏134 KB

    Hi,
    A trigger is designed to be a part of a transaction, not it's end.
    It is like following these steps (not really accurate, but should give an idea):
    1. programA issues INSERT statement on tableA
    2. 'control' goes over to the database
    3. constraint checks happen
    4. the associated triggers on tableA do their work (e.g. fetching a sequence value for a primary key)
    5. 'control' goes back to programA
    6. programA decides if a commit (no error occurred) or a rollback (error case) has to be issued.
    Did this help? Probably not, I'm not happy with what I wrote, but anyway... :)

  • How to reset table in Status "Replicate - Error'?

    Hi,
    we have a HANA sidecar scenario (HANA revision 82) where we replicate tables from ECC non-HANA towards HANA with SLT for operational reporting (using DMIS_2011_1_731 SP7).
    In total we have about 550 tables that are being replicated fine. There are however 2 tables that went into status "Replicate - Error": for instance table KONV. There are other large tables that replicate fine. When I have a look at the transaction LTRC, I find the following message:
    - Error while generating runtime objects for Z_KONV_002
    - Syntax error in function module /1CADMC/ACS_00100000000240
    - Error message: Method "ADJUST_INTERVAL_LOWER_BOUNDARY" is unknown or private or protected
    In attempt to solve this, we will load SAP notes 2041240 + 2016512 and test again.
    But how can we reset a single table as if it has not been selected for replication before? Is this via a specific expert function in transaction LTRC and a physical deletion in RS-tables on HANA? This is needed to be able to start replication again for that single table, right?
    Thanks in advance!
    Stijn

    Hi,
    I'm assuming that you want to reload table KONV completely into HANA? Through transaction LTRC, once in the required mass transfer ID/Configuration, on the Table Overview Tab, press the Data Provisioning button and then enter the table name in the appropriate field. Select the 'Stop Load/Replication' option and execute (make sure the master job is running).
    This will remove the triggers/logging tables in ECC and set the appropriate status for the table in HANA. You can check progress on the Table Overview tab...once KONV disappears, press the use the Data Provisioning button again and change the option to 'Start Replication' for KONV and execute. This will drop the data in HANA and then create the logging table and triggers again, then start the initial load phase and when the load is complete, the table should switch to 'replicate'.
    Word of caution, you might want to maintain any required performance options/filters before you reload.
    Hope this helps.
    Kris

  • Oracle 8i, Views and Triggers

    Our application uses Views, which are essentially mirrors of the tables to perform all updates. A GRANT ALL to PUBLIC is given to the views. These updates fire Triggers on the Tables which has worked great until we attempted to run our application at a new client running 8i on Unix. I noticed the INSTEAD_OF option on triggers for 8i, but is it a definite requirement for 8i. I can't believe the old normal trigger code now fails on 8i (by disconnecting); or is it something else. Please advise.
    null

    We asked our developers and here is the answer...and a follow up question.
    The INSTEAD OF is a new option on triggers to work over views. This has absolutely no impact on existing triggers on tables. If you have a view defined over a table (or set of tables) and then perform any DML over the
    view, in the regular case, the DML will translate to operations on the base tables and the appropriate triggers on the base table will fire.
    With the new INSTEAD OF option since Oracle8.0, you can define a trigger over
    a view itself, (particular if the view is complex enough that the system cannot handle inserts/updates/deletes on the view), and the trigger body will handle the DML by firing appropriate statements.
    The problem you are seeing is probably something else.
    What do you mean by "disconnecting"??
    Are you getting some sort of error or something when using the old triggers??
    -John
    null

Maybe you are looking for