End-user experience during CREATE OR REPLACE TRIGGER

Is CREATE OR REPLACE TRIGGER intended for you to be able to update a trigger in production while users are actively using a that table's data?
Just wondering how it behaves. People currently in the middle of an event will use the old trigger, while new requests will use the new one?
Thanks
Chuck

Actually, this one kind of surprised me. I tried:
SESSION1 > DESC t
Name                                      Null?    Type
ID                                                 NUMBER
DESCR                                              VARCHAR2(10)
SESSION1 > CREATE TRIGGER t_bi
  2  BEFORE INSERT OR UPDATE ON t
  3  FOR EACH ROW
  4  BEGIN
  5     :new.descr := UPPER(:new.descr);
  6* END;
Trigger created.Then, in anothe session I did:
SESSION2 > INSERT INTO t VALUES (1, 'One');
1 row created.Then in the first session:
SESSION1 > CREATE OR REPLACE TRIGGER t_bi
  2  BEFORE INSERT OR UPDATE ON t
  3  FOR EACH ROW
  4  BEGIN
  5     :new.descr := LOWER(:new.descr);
  6* END;
Trigger created.
Just to prove no commit happened
SESSION1 >SELECT * FROM t;
no rows selectedI was expecting to see
ORA-00054: resource busy and acquire with NOWAIT specified
or something similar. So in session 2 I did:
SESSION2 > COMMIT;
Commit complete.
SESSION2 > SELECT * FROM t;
        ID DESCR
         1 ONE
SESSION2 > INSERT INTO t VALUES(2, 'Two');
1 row created.
SESSION2 > SELECT * FROM t;
        ID DESCR
         1 ONE
         2 twoSo, the new trigger is working. Now change it again:
SESSION1 > CREATE OR REPLACE TRIGGER t_bi
  2  BEFORE INSERT OR UPDATE ON t
  3  FOR EACH ROW
  4  BEGIN
  5     :new.descr := UPPER(:new.descr);
  6  END;
  7  /
Trigger created.and back to session 2
SESSION2 > INSERT INTO t VALUES (3, 'Three');
1 row created.
SESSION2 > SELECT * FROM t;
        ID DESCR
         1 ONE
         2 two
         3 THREESo, it looks like whichever trigger is current at the time of the insertion or updation seems to control what gets in the database.
John

Similar Messages

  • Create or replace trigger

    hi i want to create trigger . when insert a row on table , it returns new value and old value . I have many tables and columns . i should to use :new.columntitle and :old.columntitle .Columntitle is refere to name of column in table . but sql developer is not accept it and show this error : BAD BIND VARIABLE 'NEW.COLUMNTITLE' .My code is this :
    Create or replace TRIGGER hr.departments_before_insert   
      before insert       on HR.departments 
       for each row
       DECLARE
          columnid number ;
         columnval number ;
         columntitle varchar2(4000);
         cursor c2 is
         select id,tableid from hr.columns where tableid = 1 ;
          tablesid number ;
          tablenames varchar2(4000);
          cursor c1 is
          select id , title from hr.tables where id = 1;
                    BEGIN
                    open c1;  
                           loop
                              fetch c1 into tablesid , tablenames;
                                  EXIT WHEN C1%NOTFOUND;    
                                   for rec in c2
                                            loop
                                                 select substr(title,instr(title,'.',-1,1)+1) into columntitle  from hr.columns where id = rec.id ;
                                                 dbms_output.put_line(:new.columntitle); -- in this line the eroor occured  : error = " bad bind variable 'new.columntitle' "
                                             end loop;
                             end loop;
                    close c1;    
                     end;
    -- in loop columntitle=deparment _id and department_name ; when i replace columntitle with department _id in :new , code is work ...
    thanks                                                                                                                                                         

    You have no choice but to specifically list the column names.
    If you really have "too many columns", that would tend to imply that you have improperly normalized your schema.  Perhaps you need to rethink the data model.
    If the real problem is that you want to generate similar triggers for a large number of different tables, you could write a PL/SQL block that generates the CREATE TRIGGER statement for each table and use EXECUTE IMMEDIATE to run those statements for each table.  Using dynamic SQL like this significantly complicates the complexity of building the trigger.  This may be balanced out, though, by the fact that you only have to write it once rather than writing separate triggers for each table.
    Justin

  • End User Experience Monitoring Querries

    Dear Experts,
    I have a doubt in End User Experience Monitoring (EEM), I created a SAP GUI Script
    that script  execute automatically every day. How to set automatically.
    Regards
    Balaji

    Dear Experts,
    I want to know the End user Experience Monitoring in the EEM Script how to assign the Region, Location,
    then how to call the script.
    Please give me provide solution.
    Regards
    Balaji

  • End-User Experience error running agent on windows server 2008 R2

    Hi,
    I have installed implemented the end-Uer experience agent in a Windows 7 without issues but when we have installed the SDM 7.30 agent and the SAP GUI 730 in a Windows server 2008 R2 and we have configured the agent as End-User experience monitoring Robot in solution manager.
    We have distributed one script without issues but the executios are failing with the message:
    "SAPGUI Compontent" could not be instantiated (sapfewse):605
    We have reviewed the bellow notes but wothout success:
    1261706 - Kill bits set for SAP GUI Scripting
    1092631 - Remote vulnerabilities in SAP GUI for Windows
    We are able to run the scripts in the server directly in the SAPGUI and even with the EemEditor.
    SAP message is open since last week, but my be you can provide a faster response.
    Could you please help me.
    Kind Regards

    Have you followed installation procedure described in the following article: http://www.cisco.com/en/US/docs/security/ibf/setup_guide/ibf10_install.html ?
    You can find troubleshooting hints in the following article: http://www.cisco.com/en/US/docs/security/ibf/setup_guide/ibf10_troubleshooting.html
    I'd reccomend to install CDA instead of AD agent (nice GUI...) but you'll have to create new (virtual) server for that: http://www.cisco.com/en/US/docs/security/ibf/cda_10/Install_Config_guide/cda_install.html

  • Migration: 04089  'create or replace trigger "GENSS2K5FORKEYRIG" '    error

    hi:
    I am trying to migration sqlserver 2008 to 10g.
    I try to execute the sql "
    +create or replace trigger "GENSS2K5FORKEYRIG"+
    +BEFORE INSERT ON STAGE_SS2K5_FN_KEYS+
    +FOR EACH ROW+
    +BEGIN+
    +IF :NEW.OBJECT_ID_gen IS NULL THEN+
    +:NEW.OBJECT_ID_gen := MD_META.get_next_id;+
    +end if;+
    +end GENSS2K5FORKEYRIG;+"
    as Migrations , then 04089, where I was wrong?
    please help me!

    Hi 914847 ,
    http://psoug.org/oraerror/ORA-04089.htm
    do not create triggers on schema objects owned by sys.
    Use a different schema for schema objects - create one if necessary.
    -Turloch
    SQLDeveloper team

  • Recording NWBC scripts for End User Experience

    Hi Experts,
    I am recording NWBC scripts using the Netweaver Business Client GUI for loading and running it through Robots for End User Experience Monitoring. I don't see an option to "LogOff" in NWBC client while recording  the script. We only have option to "Close all session and LogOff" in NWBC client .
    When I am using this option, it closes all the sessions including the EEM Recorder also without saving the recording .
    I need to include "LogOff" as the last step so that it doesn't leave any active sessions for each run by different robots.
    I have a Solution Manager 7.1 SP10 and NWBC client 3.5 Patch 13.
    Please help me achieve this.
    Regards,
    Manish K

    Hi,
    for a browser the recommendation is to open a new, empty tab to keep the browser alive while closing the tab with the  session. All that with the hope that the backend will use the triggered event of collapsing tab to close session.
    Maybe a similar strategy works for NWBC.. but I don't know the UI in detail.

  • End User Experience Management(EEM)

    Does any one has insight information about SAP's End User Experience Management(EEM) in Solution manager vs CA's Customer Experience management?
    Please provide me relevant information.

    Please check this:
    Link: [http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/5093bee4-27f2-2c10-869e-e523d818f2e9&overridelayout=true]
    Regards,
    Gerald

  • End User Doc. Create / Change Customer Master Data

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. >
    Hi Experts,
    I would appreciate, if anyone of you could forward me the end user documents for creating & changing customer master data.
    sonicasmailbox at rediff
    Points will be assigned.
    Regards
    Sonica

    Hi
    Refer to help.sap.com for creating customer master data.
    Copy this to word document and it will be become user manual.
    http://help.sap.com/saphelp_ides/helpdata/en/47/ef8c64124811d2806f0000e8a495b3/content.htm
    Additionally refer to this weblink
    http://web.mit.edu/cao/www/AR/ar1/ar_FD01.htm - This if for FICO only.
    Changing customer master record.
    Use T.Code XD02.
    Enter Customer No,Company code,Sales Org, Distribution channel and division and press Enter or
    Enter Customer no,company code and click on customer's sales area, you will see Sales Org, Distribution channel and division,select the Sales org,Sales Org, Distribution channel and division and press enter.
    You can make necessary changes to customer master
    Please let me know if you need more information.
    Asssign points if useful.
    Regards
    Sridhar M

  • Network traffic of an End-User Experience Monitoring (EEM) Robot

    Dear Experts,
    our company is currently using three EEM-Robots in different countries.
    After one month we noticed, that the network traffic of the robots is quite high (one robot used about 8 GB in one month).
    So I checked the configuration of the robots:
    Every Robot runs about five scripts, which are executed every ten minutes. Therefore every robot exectues 30 scripts in one hour.
    There are four SAPGUI Scripts and one http-script. Every Script (besides the http-Script) is collecting the system data (bold letters in the monitoring) and the trace level low (parameter trace.e2etracelevel = 0).
    So I start measuring the network traffic. I observed the connection with Wireshark:
    The robot uses in average 4000 Byte per second, which equates to 9,66 GByte for one month.
    After stopping every script and rebooting the robot, I measured the traffic again.
    The robot uses without executing a script in average 820 Byte per second, which equates to 2 GByte for one month.
    Are there some settings I overlooked, possibilities to decrease the network traffic? 
    Is that size of network traffic within the normal range?
    Regards
    Alex
    Edited by: Alexander Beck on Jan 11, 2012 10:57 AM

    Hi  Beck,      
    I am also working on End user experience monitoring.
    I want to in depth details in End User Experience Monitoring. If you have screen shots please share for me.
    Regards
    Balaji
    Edited by: Balaji Rao Bhoomraogari on Jan 18, 2012 12:19 PM

  • Oracle9i AS (invalid user/password,During creating of database)

    Hello!
    I have installed oracle 9i in Advance server 2000 (domain controller) and when i try to create a database (any type) via Database Configration Assistent then during creating of database it give me the message invalid username/password. The point to be noted is that during creating of database it doesnot ask any username or password, so probably this is a some sort of post creating script with a difault password like SYS, SYSMAN, SYSTEM etc accounts. Please guide me what is the problem in my steping of database creation. (Remmeber i am loging into the server with Administrator's account.
    Please reply me as soon as possible at following email address.
    [email protected] (above email address is invalid)
    Thanks.

    User => Default password
    =========================
    sys => change_on_install
    system => manager
    scott => tiger
    hope this helps.

  • ESSO - Full SSO end-user experience

    Hi all,
    I have been testing Windows authenticator and Windows V2 authenticator and I have been unable to set it up so that it does not request the password when a user first logs into the system. Is it possible to set it up so that it does not show this authentication dialog in the first login? Any hints would be appreciated.
    Thanks in advance

    hello,
    to my knowledge, i think you won't be able to prevent (at least) your first authentication for the simple reason that when FTU is done, a key is generated to encrypt your credentials and this key is generated based on your authentication.
    For subsequent use, i've found out that you can prevent recurring authentication (apart from the reauthentication timer setting) by adding a key to the registry HKLM/Passlogix/AUI/<your authentication here>/CheckForParentProcess the type of the entry being DWORD and the value being 0.
    Of course it will still ask for authentication for "password reveal" feature (but still depending on the settings you specified).
    hope it helps.
    regards

  • [Request] Special user-exit we need during creating purchase order

    Hi, Gurus!
    We need to make specific User-Exit during creating Purchase order.
    When user creates/change a PO document (ME21N/22N), SAP has to check the u2018CUSTOMERu2019 filed whether it is BLANK or NOT in Delivery Address tab at ITEM LEVEL.
    If there is no value in that field, system will automatically input right value with useru2019s business logic.
    Thatu2019s what we want to implement in the future.
    If you have any solution or recommendation for this, Please help us.
    I really appreciate your help in advance.
    Best Rgds;
    Ian

    For checking user exit - SMOD, you need to activate this exit via CMOD
    For Badi - SE18 to check & SE19 to implement
    Take the help of your abaper, give him / her your logic.
    Hope the above answers your query.
    Regards,
    Vivek

  • Error creating job into trigger using DBMS_SCHEDULER.

    Hi,
    I am trying to create job using dbms_scheduler package. I have one trigger on insert event on one table. I am creating job using following syntax.
    CREATE OR REPLACE TRIGGER TRG_BI_JOB_CONFIG BEFORE INSERT ON JOB_CONFIG FOR EACH ROW
    DECLARE
    BEGIN
         DBMS_SCHEDULER.Create_Job(job_name => 'my_job1'
                             ,job_type => 'PLSQL_BLOCK'
                             ,job_action => 'delete_temp'
                             ,start_date => TO_DATE('15-JUL-2003 1:00:00 AM', 'dd-mon-yyyy hh:mi:ss PM')
                                  ,repeat_interval => 'FREQ=DAILY'
                             ,enabled => TRUE
                             ,comments => 'DELETE FOR job schedule.');
    EXCEPTION
    WHEN OTHERS THEN RAISE;
    END;
    but I am getting following error while inserting into JOB_CONFIG table.
    ORA-04092: cannot in a trigger
    ORA-06512: at "PRAKASH1.TRG_BI_JOB_CONFIG", line 41
    ORA-04088: error during execution of trigger
    same above statement If I am running from sqlplus then It is creating job without error. If I am creating job using DBMS_JOB into trigger then It is also working fine but this package is depricated from oracle10g so I cannt use it any more.
    My Oracle version is 'Oracle DATABASE 10g RELEASE 10.2.0.1.0 - Production'.
    can anyone help me in this context.

    I have a few comments on this thread as an Oracle dbms_scheduler developer.
    - Oracle takes backward compatibility very seriously. Although dbms_job is deprecated, the interface will continue to work indefinitely. The deprecation of dbms_job is so that customers will be encouraged to take advantage of the more powerful dbms_scheduler. It is extremely unlikely that entire blocks of functionality will ever be removed. There is currently no plan to remove dbms_job functionality (and even if there were, doing so would be strenuously opposed by many users).
    - lots of internal Oracle database components are standardizing on using dbms_scheduler (resource manager, materialized views, auto sql tuning etc). This is good evidence that it will continue to be the recommended scheduling method for the foreseeable future - not even the concept of a replacement exists. It is also under active development.
    - The reason for the automatic commit is that a dbms_scheduler job is a full database object like a stored procedure or a table. So a call to dbms_scheduler.create_job is like executing a DDL which takes effect immediately. A dbms_job job is mostly just a row in a table so a call to dbms_job.submit behaves like regular DML. There are many advantages to a job being a full database object but DDL behaviour is an unfortunate requirement of this.
    Hope this clears a few things up, reply with any questions.
    -Ravi

  • Creating a row trigger to populate the primary key

    to populate the primary key of a table automatically, i created a sequence named rule_id
    using the following statement:
    create sequence rule_id;
    and then i created a trigger to populate the primary key using the statements below:
    CREATE OR REPLACE
    TRIGGER RULE_ID BEFORE INSERT ON DOC_CATS_RULE_BASED_CLASS
    FOR EACH ROW
    BEGIN
    SELECT SEQ_RULE_BASED_CLASS.NEXTVAL
    INTO :new.id FROM DUAL;
    END;
    i took this from a books example. but it gives and error called:
    Error(3,8): PLS-00049: bad bind variable 'NEW.ID'
    What is wrong and what is the current way to do it?
    Please help!

    Hi ,
    The new denotes the new data values for the table relative column.....
    As regards the dual is a small table in the data dictionary that Oracle and user-written programs can reference to guarantee a known result. This table has one column called DUMMY and one row containing the value X.
    Regards,
    Simon

  • How to create a database trigger for automatic run statspack.snap

    Hi,
    I want to create a database trigger to run statspack.snap at startup.
    connect /as sysdba
    grant create any trigger to perfstat;
    connect perfstat/perfstat
    create or replace trigger auto_snap
    after startup on database
    begin
    statspack.snap;
    end;
    after startup on database
    error at line 2:
    ora-01031: insufficient privileges
    connect /as sysdba
    create or replace trigger perfstat.auto_snap
    after startup on database
    begin
    statspack.snap;
    end;
    Trigger created.
    after shutdown and startup the database, the trigger has not been run. (no statspack snapshot)
    What I have done wrong?

    981145 wrote:
    hi... I have created a database link but it is showing some error. Can you please tell me, do we have to update the details in TNSNAMES.ora file regarding the database which i am creating now before creating database link?????
    awaiting for your response,
    Thanks in advanceI'm sorry, but "showing some error" is NOT an actionable error message. Why do you think we can solve your error if you don't tell us what the error is?
    Yes you will need to adjust your tnsnames. When a process in a database_A accesses database_B via a dblink in database_A, the database_A is acting as a client to database_B. At that point database_A is just like sqlplus or sqldeveloper, and all tns considerations are the same.

Maybe you are looking for