Who calls the trigger?

I need to identify a trigger (before deletion) who called him.
What has been the users module and which executed sql commands.

I tried the following:

Select sysdate, b.MACHINE | '-' || b.OSUSER | '-' || b.MODULE | '-' || b.UserName | '-' || b.Program,
a.SQL_TEXT
v $ SQLTEXT,
V$ SESSION b
where a.SQL_ID = b.sql_id
and select = sys_context ('USERENV', 'SID')
and status = 'ACTIVE '.
and UPPER (username) = "DOURADOS ';

But I was just in the session of $ very exclusive v.

http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:382218730166

Tags: Database

Similar Questions

  • Transfer while calling the function of a trigger

    Hello

    I would appreciate if someone can point me in the right direction. So I have a trigger (TableAR_BU) on a table table. This trigger, I have a logic to call the function, and inside this function, I'm just a select statement of a few other tables that the table table.
    Function is supposed to return me 'Y' and it done correctly returns me 'Y' if I select the double feature. -Select the Function1 (100) twice;

    But when I call the trigger function, it returns me 'n'. So after investigation, I found that the select statement (selection of table) inside the function returns NULL when called from trigger.
     
    DROP TRIGGER TableAR_BU;
    
    CREATE OR REPLACE TRIGGER TableAR_BU
    BEFORE UPDATE
    ON TableAR_BU REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    declare
     localcontext varchar2(32000) := '; Context : ';
     sqlstmt varchar2 (2000);
    
     Status varchar2(1);
    
    Status := Function1(:new.Id);
    
    
    End;
    /
    
    
    function Function1(al_Id in TableAR.Id%type)
    RETURN  varchar2 is
    
    lsItemId TableAR.itemId%type;
    
    Begin
    
    Select itemId into lsItemId
    from TableAR
    where id = al_Id;
    
    
    
    Exception
    
    End Function1;
    Suggestions or comments appreciated.

    Edited by: Eclipse01 may 1, 2012 11:29

    The problem is that a level trigger line on table cannot query table or whatever it is that questions table call. In the middle of a SQL statement, the table is potentially in an invalid intermediate state if Oracle cannot guarantee that queries on the table return consistent or reasonable results so it does not allow queries of this type.

    99 + % of the time, it's a good thing because it means that you are trying to use triggers for something they are not designed for (in addition to creating applications that are terribly difficult to manage because an action like update a line will eventually create a huge cascade of effects). Most of the time, you are much better to reconsider the architecture and the displacement of the function call out of the trigger and in a sort of API that wraps the UPDATE statement (that is a stored procedure that made the UPDATE and calls the procedure).

    In the <1% of="" the="" cases="" where="" you=""> really want to do in a trigger, you would need a combination of objects (or a trigger composed containing several sections in 11 g). You would need
    -A package with a collection of table primary keys
    -A before the declaration that clears this collection
    -A level trigger line which inserts the: new. ID in the collection
    -A trigger statement that iterates over the collection and calls the function after.

    That, however, is a lot of moving parts to deal with, so it dramatically increases the complexity. If you only want to consider if you are really convinced that you must use triggers in the first place.

    Justin

  • create the trigger

    Hello

    I want to create the trigger on two tables

    as this - is - it possible.

    CREATE OR REPLACE TRIGGER
    ABC
    After INSERT or UPDATE or DELETE
    TABLE 1 AND TABLE 2
    for each line

    Start

    CONDITION OF THE INSERTION OF BASE ON TABLE 2

    END;


    -If not possible then how can I call the trigger with trigger

    Hello

    This is not possible, according to the syntax that you can check in the online documentation.

    When you have a trigger on the table 1, say table1_briu of relaxation, and you have a trigger on the table2, say table2_briu,

    and you have
    create or replace trigger table1_briu on table1 after insert or update for each row
    Start
    Insert into table2;
    end;

    the second trigger is automatically triggered.

    However, I highly recommend against the implementation of triggers "cascading" in this way, mostly because when trigger2 fails, you have an incomplete transaction and Oracle does not notice.
    I suggest strongly encapsulate you the complete code into a procedure that you call in a trigger on the table1 and you do not set a trigger on the table2.

    HTH

    --
    Sybrand Bakker
    Senior Oracle DBA

  • question about the call in the trigger statement

    I faced a question on the written examination.

    A CALL statement in a trigger to call
    package (a)
    procedure b)
    c function)
    (d) another trigger

    Can someone give me answer with reason?
    I used the CALL statement inside the trigger, but not allowing to use. Could be sooner in the oracle CALL statement, we can use... This isn't a guess, so I ask in the forum...
    Please guide me...



    Rgds,
    PC

    You can use the CALL in a trigger without using EXECUTE IMMEDIATE

    SQL> create table t1 (
      2    col1 number
      3  );
    
    Table created.
    
    SQL> create procedure t1_proc
      2  as
      3  begin
      4    dbms_output.put_line( 'In T1_PROC' );
      5  end;
      6  /
    
    Procedure created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create trigger trg_t1
      2    before insert on t1
      3    for each row
      4* call t1_proc
      5  /
    
    Trigger created.
    
    SQL> set serveroutput on;
    SQL> insert into t1 values( 1 );
    In T1_PROC
    
    1 row created.
    

    I see no reason that you would in fact intentionally structure your code this way in this day and age because it would be likely to lead to confusion for those who had to support it in the future. But it's a valid syntax that probably made sense back in Oracle 5.

    Justin

  • who is the best 4 db Trigger for auto-differentiels?

    Hello

    Who is the best 4 db Trigger for auto-incrementielle of an id ...?
    With the help of a sequence and the sequence of call in an insert...
    Or by using the following code:
    ----------------------------------------
    SELECT NVL(MAX (SCDEDULE_ID+1),0)
    INTO V_SCDEDULE_ID
    FROM INSP_DAILY_SCHEDULE ;
    EXCEPTION
    when NO_data_found then null;
    WHEN OTHERS then null;
    END;
    or both are the same thing... ?

    Pls advice me..... !

    Kind regards

    Abdetu...

    As already mentioned, you should definitely use sequences, because they are the only mechanism that works in multi user environments. Each user will receive a different schedule_id assigned, while the use of the nvl - max method two sessions when it is running at the same time will acquire the same schedule_id. You can of course lock the entire table to work around this problem, but which leads to questions of scalabilty. Sequences are also faster, as can be seen in the following example:

    SQL> create table insp_daily_schedule
      2  ( schedule_id number primary key
      3  , other_columns varchar2(100)
      4  )
      5  /
    
    Tabel is aangemaakt.
    
    SQL> create sequence myseq
      2  /
    
    Reeks is aangemaakt.
    
    SQL> create package schedule_api
      2  as
      3    procedure add_daily_schedule_nvlmax
      4    ( p_other_columns in insp_daily_schedule.other_columns%type
      5    );
      6    procedure add_daily_schedule_sequence
      7    ( p_other_columns in insp_daily_schedule.other_columns%type
      8    );
      9  end schedule_api;
     10  /
    
    Package is aangemaakt.
    
    SQL> create package body schedule_api
      2  as
      3    procedure add_daily_schedule_nvlmax
      4    ( p_other_columns in insp_daily_schedule.other_columns%type
      5    )
      6    is
      7      l_schedule_id insp_daily_schedule.schedule_id%type;
      8    begin
      9      select nvl(max(schedule_id),0)+1
     10        into l_schedule_id
     11        from insp_daily_schedule
     12      ;
     13      insert into insp_daily_schedule
     14      ( schedule_id
     15      , other_columns
     16      )
     17      values
     18      ( l_schedule_id
     19      , p_other_columns
     20      );
     21    end add_daily_schedule_nvlmax
     22    ;
     23    procedure add_daily_schedule_sequence
     24    ( p_other_columns in insp_daily_schedule.other_columns%type
     25    )
     26    is
     27    begin
     28      insert into insp_daily_schedule
     29      ( schedule_id
     30      , other_columns
     31      )
     32      values
     33      ( myseq.nextval
     34      , p_other_columns
     35      );
     36    end add_daily_schedule_sequence
     37    ;
     38  end schedule_api;
     39  /
    
    Package-body is aangemaakt.
    
    SQL> set timing on
    SQL> begin
      2    for i in 1..10000
      3    loop
      4      schedule_api.add_daily_schedule_sequence(lpad('*',100,'*'));
      5    end loop;
      6  end;
      7  /
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:00.93
    SQL> /
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:00.92
    SQL> /
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:00.92
    SQL> begin
      2    for i in 1..10000
      3    loop
      4      schedule_api.add_daily_schedule_nvlmax(lpad('*',100,'*'));
      5    end loop;
      6  end;
      7  /
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:01.32
    SQL> /
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:01.68
    SQL> /
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:01.32
    

    The only counter-argument that can be given for the nvl - max method, is that it is the independent database, while Oracle sequences are used by Oracle only as far as I know. But since independence database should never be a goal because it leads to poor applications and poor database design because it can only operate features that each database has, this argument is hardly any value.

    Kind regards
    Rob.

  • Call a procedure only once for the last place of the trigger FOR EACH ROW

    Hello world

    I wonder if someone could help me in the execution of the trigger. My use case what follows:

    -a trigger after each INSERT or UPDATE operation;
    -use FOR EACH ROW algorithm for relaxation;
    -collect certain values inserted/updated fields as: new.uuid and store in a set defined on the layer of the package;
    -only for the last inserted/updated line call a procedure from the global collection with the values collected as a parameter;

    Is it possible to be implemented for the type of the LINE FOR EACH of the trigger? Fact one: new identifier or trigger itself have special attributes such as COUNTY, SIZE to set a size of data inserted or changed to conditional logic? Is there another solution to possible workaround for thoughtful use cases.

    Thank you

    Andrey

    Hi, Andrey,

    I suggest you use 2 triggers:
    (1) A FOR EACH ROW trigger, as you described, to collect relevant data and store it in a temporary table overall or variable poackage. Whenever the trigger is activated, it will overwrite all the data from the previous row.
    (2) AFTER ( NOT FOR EACH ROW) trigger that calls the procedure by using the saved data.

  • To make a video call the person who receives the call can't see me, but they can hear me, why?

    Original title: Microsoft lifecam

    To make a video call, the person receiving the call can not see me, but they can hear me

    Hi Eddie,.

    As the person receiving the call is able to hear and unable to see, we need to check if the video settings are set correctly.

    Which application do you use to make video calls?

    While you reply us with the above information, see the following links:

    From the following link, refer to the "I can't start a video call".

    Troubleshooting: Webcams

    http://www.Microsoft.com/hardware/en-in/help/support/troubleshooting/webcam/LifeCam-Setup

    How to make a video call?
    http://www.Microsoft.com/hardware/en-in/help/support/how-to/webcam/VideoCall

    With the help of your LifeCam with Microsoft Live Messenger

    http://support.Microsoft.com/kb/921332?WA=wsignin1.0

    Hope the above information is helpful.

  • Client listeners who call Server on fields only listeners take account of changes made on the event field

    Hello

    I have this sample application:

    1. I have a view object with a view criteria added to my data model of the app module.
    2. Then, in a page fragment /, I created a table based on this view object, and drag-and - drop operation ExecuteWithParam binds variables to the page as input fields of text with clientComponent = 'true '.
    3. Next, I added a listener client in each of the fields of type keyPress entry to call the following JavaScript method whenever the user presses the Enter key:
    function handleEnterEvent(evt) {
                          var _keyCode = evt.getKeyCode();
                          //check for Enter Key
                          if (_keyCode == AdfKeyStroke.ENTER_KEY ){
                              var comp = evt.getSource();
                              AdfCustomEvent.queue(comp, "EnterEvent", {}, false);
                              evt.cancel();
                          }
                       }
    

    4. then I added a server listener to these same "EnterEvent" type text input fields to call a method in my grain of support, that basically runs the OperationBinding ExecuteWithParam programmatically.

    The problem:

    1. I type "123" in my it1 text entry field and press the Enter key. The operation is performed and the results of the table are filtered as expected with the view criteria.
    2. I then clear the value in my it1, change the cursor in my it2 of text entry (without pressing enter), type 'Hello' and press the Enter key. The operation is performed, but the results are incorrect - the results indicate values as if the value "123" was always filled the it1 (and respective value of binding).
    3. If I do the cursor resume my cleared it1 text input and press the Enter button, the results are now correct...

    It's like bind values are updated only when the client event is triggered in this specific field... How should it be properly implemented? What Miss me?

    Thanks in advance. Kind regards

    -Tiago Vidigal

    Try to set autoSubmit = "true" for the text input element

    Timo

  • Who are the best trigger/s to use for this? (Issue of master-detail)

    Hi all

    I am currently updating an old Oracle database. The last phase is to apply foreign keys (their absence on the PB at the moment). It is fine - the keys are easily identified - but it will cause a problem with some of the application that uses these tables. It is written in Oracle Forms (version 10g, although a large part of the code is from an earlier version). In some forms, the block order is such that the detail is committed to the master! Of course, this now gives a constraint error. This was done largely for the purposes of validation, for example. to check some detail item exists before committing the master.

    What is the best way to solve this problem now? Is the trigger of the POST-FORMS-COMMIT the best to use for validation?

    The only idea I have for this would be to "rewrite" the userexit-standard pl/SQL code and proceed in the same way (POST-FORMS-COMMIT)

  • Code of the trigger with the error table mutation

    I have 2 tables, cc_call_lists and cc_call_issues. I have a trigger on the table of cc_call_issues so that when the priority is updated I can determine how to set Issue_Priority.

    Basically, the priority update for an Issue_Id I need to update the I want to watch Issue_ids of all the participating on the cc_call_lists table and determine how to update the Issue_Priority column.

    Issue_Priority must always be the first priority of the table cc_call_issues for Issue_id records in the cc_call_lists table. So when I need to watch all changes priority priority values for which the Participant has records in the cc_call_lists table and take the max value priority after the record is updated.

    Unfortunately, I get the following error message when the trigger is activated:

    ORA-04091: table TTMS. CC_CALL_ISSUES is changing, function of triggering/can not see
    ORA-06512: at «TTMS.» UPDATEISSUEPRIORITY', line 30
    ORA-04088: error during execution of trigger ' TTMS. UPDATEISSUEPRIORITY'

    Is there a work around which is not too complicated? Any help would be greatly appreciated.


    Table: cc_call_lists
    Name
    -----------------
    PARTICIPANT_TYPE
    PARTICIPANT_ID
    LAST_ACCESS_DT
    LAST_ACCESS_BY
    CREATE_DT
    CREATE_BY
    MODIFY_DT
    MODIFY_BY
    CALL_STATUS
    CALL_PRIORITY


    Table: cc_call_issues
    Name
    -----------------
    ISSUE_ID
    ISSUE_DESCR
    DEACTIVATION_DT
    PRIORITY
    CREATE_DT
    CREATE_BY
    MODIFY_DT
    MODIFY_BY

    Trigger on cc_call_issues code:
    CREATE OR REPLACE TRIGGER TTMS.UpdateIssuePriority
    BEFORE UPDATE
    OF PRIORITY
    ON TTMS.CC_CALL_ISSUES 
    REFERENCING NEW AS New OLD AS Old
    FOR EACH ROW
    DECLARE
    tmpMaxPriority number:=0;
    
    -- Get list of all participants call queue records, existing priority who also have a participant issue record with this issue code
    cursor c1 is
    select a.participant_id, a.call_priority
    from cc_call_lists a, cc_participant_issues b
    where 
      a.participant_id = b.participant_id
      and b.issue_id = :new.issue_id
      and b.issue_status = '001'
      and a.call_status <> '003';  -- Not closed already
    
    BEGIN
        for thisone in c1 loop
                -- Get the existing highest priority
                select nvl(max(b.priority),0)
                into tmpMaxPriority
                from cc_participant_issues a, cc_call_issues b
                where
                  a.issue_id = b.issue_id and
                  a.participant_id = thisone.participant_id;
                  
                -- Update it if the new priority value is higher than the existing call queue record priority
                if :new.priority > tmpMaxPriority then
                        update cc_call_lists
                        set call_priority = :new.priority
                        where participant_id = thisone.participant_id; 
                elsif :new.priority < tmpMaxPriority then
                        update cc_call_lists
                        set call_priority = tmpMaxPriority
                        where participant_id = thisone.participant_id; 
                end if;
        end loop;
    END UpdateIssuePriority;
    /

    Move the level of LINE at the STATEMENT level triggers, see:
    http://www.Oracle-base.com/articles/9i/mutating-table-exceptions.php
    http://asktom.Oracle.com/pls/asktom/asktom.download_file?p_file=6551198119097816936

  • hide the trigger

    Dear Sirs,
    hide the trigger, or let the user see but not update it or remove it?
    Please help me
    Yasser

    user4490340 wrote:
    Me who create this trigger and I fear that the user may update or leave it down or turn it off
    I don't want the user to touch this trigger specifically.

    We call this security.

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/statements_9013.htm#SQLRF01603

    What you want to do, is to ensure that no user can access to the schema in which you develop and are granted exactly the privileges they need to do their job, no more, no less.

    Then you would not grant them access to this trigger, and since they do not know the password of the schema where the trigger they can't touch it (unless they have access to a role granted DBA user... and if they do, you are already serious problems).

  • I called the support 855-346-5768. They are demanding $ to release my computer to me...

    I tried to get support on the Mozilla site. As I got on the site, I received an article that said there were many problems with the latest version of Firefox and I should call Mozilla at 855-346-5768. I did and these people who call themselves computer Tech support, certified system engineers took control of my computer and declared that there are repairs to my system and the cost is $ 99. I refused to give them any money, but they won't get out my computer to me. Jeff Vanskike

    Edit: removed personal information for your protection. Please note that we cannot offer support by telephone, so please continue in the forum. Thank you for your understanding! (philipp)

    Hello Jeff, mozilla does provide no phone support - our official support to support.mozilla.org site and provides a knowledge base and Forum. Here, we will never charge you any assistance request or recommend additional paid services.

    the line you mentioned is not related to mozilla in some way, if unfortunately that we won't be able to help you with any dispute you may have with them. If you think they're mischarging or failing to get out of your computer, you could notify your local trading standards authorities.
    In addition, if this company falsely refers to the brand "Mozilla" to provide or to advertise their services, you may report it to https://www.mozilla.org/en-US/legal/fraud-report/ so that more can take action against them.

    Sorry for all the evils!

  • After that I went to El Capitan, my computer would be close and take forever to reboot.  I took it to the Genuis Bar and they said it was us who extinguished the FileVault.  I've updated the software on 1: 1 and now, I'm having the same problem

    After that I went to El Capitan, my computer would be close and take forever to reboot.  I took it to the Genuis Bar and they said it was us who extinguished the FileVault.  I've updated the software on 1: 1 and now, I'm having the same problem again.  The computer turns off and sometimes it takes me an hour or two to get started again.  Help, please!

    refer to this article and move forward with the NVRAM reset at the end.

    Reset the management system (SCM) controller on your Mac - Apple Support

    If the problem persists, how long have you made it Go?

    I would bring out there, but first call Apple.

  • Think of a scam, I called the company - am I at risk?

    My mother was using his iPad and got a pop-up in Safari on the iPad with a virus or something else and to dial a number to get it repaired. The site was called ios-security-alarm.

    Once she was on the phone with them, they asked his serial number on his iPad. She gave them that. They said that it was probably a problem with her laptop and wanted to remotely access that. At this time, she got the suspect and got off the phone.

    Two questions.

    Is it possible that your iPad (or a home network) is really in danger and that's why she who becomes pop up?

    and

    She is threatened to be hacked or have compromised information giving them the serial number of his iPad. It was the only information she provided them.

    If it is to any risk, that she must do to protect themselves?

    > At this time, she got suspicious and got off the phone.

    If it did not allow access to his laptop computer. That's great.

    > Is it possible that your iPad (or a home network) is really in danger and that's why she who becomes pop up?

    N ° she dodged an attempt to scam. Don't question even the legitimacy of the pop up warning. IT IS A SCAM! Period.

    > Is in danger at all to be hacked or have compromised information giving them the serial number of his iPad. It was the only information she provided them.

    N °

    > If it is to any risk, that she must do to protect themselves?

    While browsing the internet... If there is a scary warning, NEVER call the number. Contact Apple directly or ask someone who understands technology. Check iPad Settings - Safari - history and website data clear your MOM. That will clear the cache of Safari script.

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

Maybe you are looking for