About trigger **URGENT**

How many trigger we can create on a table?

So, your senior developer asked you a question, presumably(*) to either a) test your knowledge or b) test your searching capabilities and you decide to ask here, without searching first?
You should search the concepts document. I'll even give you the link to the relevant part: http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/triggers.htm
It's up to you to research it.
(*) I'm assuming that the senior developer is not asking because they don't know the answer...!

Similar Messages

  • Whats is the use of SM64 Tcode?? and about Trigger Event???

    Hi
    Whats is the use of SM64 Tcode?? and about Trigger Event???
    Can anyone tell me??
    Thanks & Regards
    Senthil

    Hi,
    When scheduling a background job, you can specify it to start "after event".
    If you do so, you'll have to create an event in SM62.
    If a job is scheduled after event event and you trigger the event with SM64, the job will start.
    Events can be raised by external systems in SAP by sending a command to a SAP application server. You can also raise event in any program using function mosule BP_EVENT_RAISE.
    hope this helps....
    Olivier.

  • How can I get/Catch the information about Trigger firing?

    How can I get/Catch the information about Trigger firing?

    I am running one application (backend is Oracle) and have written one trigger, which will insert one row in two tables depending on user event (After Update Trigger).
    I want know last fired Trigger Information.
    Thanks

  • Help on creating update trigger(urgent)

    Hii all,
    I have a situation like this
    I have 10 different tables like a,b,c,d,e,f
    But i have same columns in all tables
    like
    updated_by,
    updated_date
    I need to create a procedure and call that procedure in update triggers for all tables
    Can anybody help
    In creating Procedure and trigger
    Thanks

    There is nothing wrong with the trigger, but the procedure is another story. You cannot do DML on the table that is firing the trigger inside the trigger, that is the mutating table error.
    I am not really sure why you are doing the DML anyway. you have defined a BEFORE UPDATE trigger on k_constituent, and the procedure checks for the existence of a row in the same table where the currt_user_id field is the same as the id of the user making the update. Without knowing anything about the application, this implies one of two things to me. Either you are trying to make sure the row to be updated does exist, or, this is some kind of security check.
    If it is the first, then it is unneccessary, since the before update trigger will only fire if the row to be updated exists viz.
    SQL> CREATE OR REPLACE TRIGGER jt_bu
      2  BEFORE UPDATE ON JTEST
      3  FOR EACH ROW
      4
      5  BEGIN
      6     :new.updby := USER;
      7     :new.updon := SYSDATE;
      8     DBMS_OUTPUT.Put_Line('Trigger fired ok');
      9  END;
    10  /
    Trigger created.
    SQL> SELECT * FROM jtest;
            ID DESCR      UPDBY                     UPDON
             1 YES        OPS$ORACLE                24-APR-03
             2 NEWDES     OPS$ORACLE                23-APR-03
             3 ORACLE     OPS$ORACLE                23-APR-03
    SQL> UPDATE jtest SET descr = 'NO' WHERE id = 1;
    Trigger fired ok
    1 row updated.
    SQL>  UPDATE jtest SET descr = 'NO' WHERE id = 5;
    0 rows updated.If you are doing this for security, then you are way too late. The user should not be in the database doing updates if they are not a valid user (whatever valid user means to you).
    As a side note, you do realize that if there is more than one record in k_constituent with currt_user_id = updating user, then the procedure will not set update_date and update_by?
    TTFN
    John

  • About Workflows, urgent

    Hi all,
    Can any one tell me how to create workflows? Now I have a situation where I need to pass Business partner no., contract account no., and amount rejects to customers inbox. I know a bit about triggering workflow through function module SWW_WI_START_SIMPLE, but now I need to create workflow. If you have any documentation on workflows please send it to me. Please treat this as urgent.
    Thanks & Regards,
    Venkat.

    Hi,
    Step wise link for Workflow.
    http://www.****************/Tutorials/Workflow/Workflow.htm
    Thanks,
    Anitha

  • [PLEASE] Prob with instead of Trigger  [URGENT !]

    Hi,
    I have an INSTEAD OF TRIGGER on a view which update 2 based tables.
    Each time the user update information,the system processes the update operation and insert a new row into the base tables.None of the based tables has any trigger.
    Why this insertion occures ? How can i stop it and update only the based tables without inserting the same row ?
    Thks for your advice
    lamine
    SQL> CREATE OR REPLACE TRIGGER UPDATE_PP_TR
    SQL>       INSTEAD OF UPDATE ON V_CONTACTS1_PP
    SQL>       FOR EACH ROW
    SQL>       begin
    SQL>         update ORGANIZATIONS
    SQL>         set
    SQL>           org_name = nvl(:new.org_name,org_name)
    SQL> .....
    SQL>           ,updated_by = v('USER')
    SQL>           ,updated_date = sysdate
    SQL>         where org_id = :new.org_id;
    SQL>         update INDIVIDUALS
    SQL>         set
    SQL>           ,gender = nvl(:new.gender,gender)
    SQL>           ,first_name = nvl(:new.first_name,first_name)
    SQL>           ,last_name = nvl(:new.last_name,last_name)
    SQL> ......
    SQL>           ,updated_by = v('USER')
    SQL>           ,updated_date = sysdate
    SQL>          where org_id = :new.org_id;
    SQL>        end UPDATE_PP_TR;

    Thks Andrew for your reply,
    The INSTEAD OF trigger doesn't insert new row as i said before.... apologies.... It processes 2 things:
    - update the field with the new value (what i want)
    - Replace any existing data that has the same reference_key by the new value.
    If we change the email of an individual and it happens that they are many people in the same company,then the INSTEAD OF TRIGGER updates the email and replace the other employees records by the one that has been updated.
    But if the company employes only 1 person then the process is ok.It's bizarre only for many employees in the same company.
    i.e:
    Martin Tom , [email protected], FRANCE SOFT
    Paul Henri, [email protected], FRANCE SOFT
    Jason Case, [email protected], FRANCE SOFT
    If i update Martin Tom's email to [email protected], Paul and Jason would be replace by Marin Tom's record....
    Martin Tom , [email protected], FRANCE SOFT
    Martin Tom , [email protected], FRANCE SOFT
    Martin Tom , [email protected], FRANCE SOFT
    Maybe my instead of trigger is written improperly.....
    Any advise ?

  • Question about trigger to check the number of open cursors

    Hello.
    I wonder if it is possible to create a trigger that fires when the number of open cursors in a database becomes larger than a certain number. What kind of trigger and how would it be?
    If it were possible the trigger would write traces with the timestamp of the event.
    I would also like some pl/sql tester that would increase the number of open cursors so that I could check the trigger.
    Thanks in advance.

    Satish Kandi wrote:
    OPEN_CURSORS is a value per session and not for the entire database. So if your cron job is looking for a global cumulative value of open cursors to occur in a single session, it won't find any such sessions.
    Is it the case?Yes, I am afraid it is.
    I am sorry but I don't unsertand what you are telling me: doesn't "select count(*) from v$open_cursor" count the number of open cursor for all sid columns in the view?
    The cron launches a scripts that connects to the database via sqlplus whereas there is a java application (several threads without connection pooling) that connects to the database via jdbc and that causes the problem once in 5 months (to say something).
    Thanks again.
    Edited by: fsanchezherrero on Jul 3, 2009 12:28 PM
    Edited by: fsanchezherrero on Jul 3, 2009 12:36 PM

  • About Trigger and Transaction

    Hi,
    I want to know if trigger will be executed even if the transaction in which the table is participating is failed.
    e.g. if there are three tables participating in the particular transaction ,table update sequence is 1-->2-->3.The trigger is deployed on the second table if the transaction fails because some error while updating third table, will the trigger on the 2nd table be executed.
    Regards,
    Sachin R.K.

    So does that mean that
    If i have a table (say table1)
    And i have an AFTER UPDATE trigger on table 1 that writes to a file(say TriggerOutput.txt) some info.
    And Now I try to update table1 which is within the transaction ,if the transaction is rolled back,u mean i file TriggerOutput.txt will be empty.
    Is that correct.
    Regards,
    Sachin K.

  • Question about trigger and procedure

    Hi,
    I have a trigger on a table tbl1 (after AFTER INSERT OR UPDATE ... for each row).
    This trigger start a procedure which make some test. At the end of the procedure, I had to update a flag on tbl1, but without using the trigger !!!
    Is it possible ?

    not a mutating table error but ORA-00060: deadlock detected while waiting for resource.
    For your question :
    Is the flag on the same row as you are updating then you can update it in the trigger ?
    Yes, this is a field to update for row state for my application.
    The problem is that the update at the end of my procedure start the trigger that start the procedure and so on !!!
    Perhaps you have another idea to do something like this ?
    thankx for your answer.
    Rémi PILLOT

  • Error about trigger

    Hi All
    I try to use this trigger for inserting RecordID in Shoppingcart Table.
    DECLARE
    NEXTID NUMBER(3);
    BEGIN
    SELECT MAX(RECORDID) INTO NEXTID FROM SHOPPINGCART;
    :NEW.RECORDID := LTRIM(NEXTID+1);
    END;
    It is an empty table now. By inserting the other fields and leaves the RecordID for triggering. The Oracle shows this error
    ORA-01400; can not insert null into (“SCOTT”.”SHOPPINGCART”.”RECORDID”)
    How could I solve this error?
    Thanks in advance
    Blueman137

    You'll want to do something along these lines-
    SQL> CREATE TABLE trig_demo (
      2    col1 NUMBER PRIMARY KEY,
      3    col2 VARCHAR2(100)
      4  );
    Table created.
    SQL> CREATE SEQUENCE demoSeq;
    Sequence created.
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE TRIGGER demoTrigger
      2  BEFORE INSERT ON trig_demo
      3  FOR EACH ROW
      4  BEGIN
      5    SELECT demoSeq.nextval
      6      INTO :new.col1
      7      FROM dual;
      8* END;
    SQL> /
    Trigger created.
    SQL> insert into trig_demo( col2 ) values ('Row 1');
    1 row created.
    SQL> insert into trig_demo( col2 ) values ('Row 2');
    1 row created.
    SQL> select * from trig_demo;
          COL1      COL2
             1      Row 1
             2      Row 2Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • About Trigger

    Hi All,
    I had doubt on triggers if possible if you have face before this please let me know.
    I had table which had 200 columns and the end user is going to change the values of this table.
    I need to find out which column has updated, the previous columns value as well as new value.
    How to do this with triggers
    Regards
    Zaheer

    Hi !
    Well , to see what column was changed and to do this with triggers .. at the end someone must check column by column in any case.
    Oracle can do this for you with specifing column list in trigger
    create or replace trigger tr1
    before update of ename on emp
    for each row
    begin
        null; --- Do whatever
    end;and this trigger will fire only if column ename is changed ... but then again you should have 200 triggers in this scenario.
    And i agree there is a performance degradation with building a trigger on table , but degradation basically depends on "quality" of code in that trigger.
    So doing some checks for 200 columns , will this be bad or very very bad or maybe not so bad ... this depends on how the thing is coded and on the data itself and so on .. you should done some observations and test few solutions not just one ..
    T

  • About trigger points

    hi
      everybody
                   i need,as im new to sap
                            wat is trigger points, wats their functions, how they r used
                        plz. explain in details

    Dear please see the link given by MSH.
    Apart form that, following are the details.
    Trigger point as name suggests, to trigger some action, when some thing is not going as per planned activity,
    In PP, we use it for creating rework order/operation when during confirmation if you find a product is to be reworked, then we use enter the qty is reworked qty field. System will create rework order or rework operation as per you designed in Trigger point.
    Please go through the link...
    You need to design the trigger point in CO31, assign it in routing.
    How to create in C031...depends your requirement whether you want rework operation or rework order..pl come back what actually you want out of two options so that we can guide.
    Edited by: Rajesha Vittal on Jan 13, 2008 1:32 PM

  • Re: send message from the database trigger(URGENT)

    Hi,
    I am using forms 6.0 and oracle 8.0. My question is I am calling a stored procedure in the BEFORE UPDATE TRIGGER on database. This trigger will be fired and update another table(table B) when user update any record in the forms based on different table (table A).
    I want to pass the message to the forms from the database trigger when records gets updated in the database e.g. (10 records are updated). Since I am not calling my database procedure from the forms, rather it is being called from the database trigger, How can i display message to the forms.
    Thanks all your help in advance.

    Thanks Parker for ur reply but that subprogram raise_application_error only works if there is an error in the store procedure. But in my case there is no error, I just need to pass a message saying that e.g. "12 rows updated". How can I pass this message from the database trigger to the forms application.
    Thanks

  • Is the righr place to ask question about trigger?

    I update the form then suppose auto update the table PaymentRecords , but today it sudden not working , not error on the trigger , what is the possible mistake ??
    delimiter $$
    CREATE TRIGGER Date_PaymentRecord
    AFTER UPDATE ON tableA
    FOR EACH ROW BEGIN
    IF NEW.Ast= 'on' THEN
    UPDATE PaymentRecords SET DueDate = New.ADate
    WHERE FeeType = 'Fee 1st Instalment'
    and PaymentRecords.UserId=New.UserId;
    end if;
    END$$
    delimiter ;
    not error at all , just not work

    See sql and plsql forum
    PL/SQL

  • Re-post : General Question about Language - Urgent Advice Needed

    IS IT POSSIBLE TO AVOID COMPLETELLY THE DISPLAY/USAGE OF ENGLISH IN PORTAL?
    WE INSTALLED LANGUAGE SPANISH (langinst.cmd) AND OUR CONTENT AREAS HAVE DEFAULT LANGUAGE "SPANISH"(NO ENGLISH TRANSLATION) .
    OUR PAGES/NAVIGATION BARS/STYLES/ETC... WERE CREATED BEING CONNECTED TO THE PORTAL IN SPANISH.
    WE DON'T WANT TO SHOW THE "LANGUAGE" PORTLET FOR USERS TO CHANGE BETWEEN SPANISH AND ENGLISH AND WE DON'T WANT THE PORTAL TO DISPLAY IN ENGLISH IF THE BROWSER SETTING IS ENGLISH.
    I READ SOMEWERE THAT IT IS NOT POSSIBLE TO "UNINSTALL" A LANGUAGE, THEREFORE I ASSUME WE CANNOT ELIMINATE THE ENGLISH LANGUAGE.
    CAN WE CONFIGURE SOMEHOW "SPANISH" AS A DEFAULT AND "UNIQUE"LANGUAGE SO ALWAYS THE PORTAL DISPLAYS IN SPANISH ??
    I HAVE INSTALLED LATEST VERSION 3.0.9.
    ANY IDEAS/SUGGESTIONS WILL BE MORE THAN WELLCOME!
    REGARDS
    null

    Hi Maria,
    One way of using Spanish as the default language is to load the following code in your Portal schema:
    set def off
    /* @Copyright (c) 1999, Oracle Corporation. All rights reserved. */
    create or replace procedure home
    -- create the synonyms for wwpob_page.show
    as
    l_pageid number;
    l_url varchar2(32767);
    function is_language_set
    p_http_language in varchar2 default null,
    p_nls_language in varchar2 default null,
    p_nls_territory in varchar2 default null,
    p_requested_url in varchar2
    return boolean
    is
    l_cookie owa_cookie.cookie;
    l_language varchar2(100) default null;
    begin
    begin
    begin
    l_cookie := owa_cookie.get(wwctx_sso.PERSISTENT_COOKIE);
    exception
    when others then
    l_language := null;
    raise wwctx_sso.NOT_HTTP_SESSION_EXCEPTION;
    end;
    l_language := lower(l_cookie.vals(1));
    exception
    when others then
    l_language := null;
    end;
    if l_language is null then
    wwctx_app_language.set_language
    p_http_language => p_http_language,
    p_nls_language => p_nls_language,
    p_nls_territory => p_nls_territory,
    p_requested_url => p_requested_url
    return false;
    end if;
    return true;
    end is_language_set;
    begin
    -- Mobile support
    if wwpob_api_mobile.is_mobile_request
    then
    l_pageid := wwpob_api_mobile.get_defaultmobilepage;
    else
    l_pageid := wwpob_api_mobile.get_defaultmobilepage;
    else
    l_pageid := wwpob_api_page.get_defaultpage;
    end if;
    l_url := wwpob_page_util.get_page_url(p_pageid => l_pageid);
    if is_language_set('es', 'e', 'SPAIN', l_url) then
    owa_util.redirect_url(l_url);
    end if;
    exception
    when others then
    wwerr_api_error_ui.show_html;
    end;
    show errors procedure home;
    This script looks for the language in the NLS_LANGUAGE cookie. It this cookie does not exist then the language defaults to Spanish because of the code is_language_set('es', 'e', 'SPAIN', l_url). Please make sure to delete the NLS_LANGUAGE cookie, if it exists.
    Please note that this code will work for 3.0.9. In case you want to implement something similar to this on 3.0.8, the code containing the mobile support has to be removed. You can contact me, should you have any questions.

Maybe you are looking for