With the help of AfterInsertTrigger for the audit table

Hi all

I use after Insert trigger to re - write the record goes to the base table in the corresponding table. The statement from the two tables are the same, except that the table has a column more - audit_time. Here is how I defined the trigger:

Create or replace trigger dup_rec after insert on table_A for each line
begin PK_comm.create_audit_rec (table_A, table_b,: new.) ROWID); end;


In the PK_comm package, I defined the procedure as 'PRAGMA AUTONOMOUS_TRANSACTION' create_audit_rec as follows:


Procedure create_audit_rec (baseTable IN VARCHAR2, auditTable IN VARCHAR2, cRowId IN VARCHAR2)
IS
PRAGME AUTONOMOUS_TRANSACTION;

Insert into auditTable (audit_time, col1, col2, col3)
Select systimestamp, col1, col2, col3
from baseTable
where ROWID = chartorowid ('v_rowID');

It seems that registration is NOT added to the audit table when I tried to insert a record in the database table. Is it possible that integration into baseTable have not completed when the trigger is activated? If Yes, what is the work around?

Thanks for your help,

Mike

Packages have session scope. Thus, each session will have a different instance of the collection.

If you have multiple tables, you must in general, several collections. If you can guarantee that a single table would never change during the scope of a single statement, you could get away with a single collection. But as soon as a trigger on table A changes data in table B, you would need different collections. For most applications, it is much easier to simply create separate collections. I guess you can also create a collection of objects and folders that have a table name and a ROWID as well and add the logic to process only the associated with the table ROWID that you are interested in.

Justin

Tags: Database

Similar Questions

  • Problems with the audit files!

    Hi friends,

    We are facing a problem with the audit files we have a runnning on oracle 10g server and being an Institute of teaching many ppl to connect to the server and too much work with SQL and PL/SQL. We have disabled the option to audit the database, but the audit files grow enormous in size. May I know what can be the problem and how to fix that there could be something that we would have missed.

    Kind regards
    Maury

    There is no setting of "verification". Display the values of

    AUDIT_FILE_DEST, AUDIT_SYS_OPERATIONS, AUDIT_TRAIL.

    I don't know 'NULL' as the value for each of these parameters.

    Werner

  • Historical data in the audit tables

    We are facing the following requirement of our current customer.

    They run a number of workflow manually for a few years, and they have retained the historical data in Excel spreadsheets. Now, they want to start using the BPM Suite.

    They would like to query power and display the track Audit Suite BPM of all workflows, i.e. not only those who will be executed with BPM Suite in the future, but also those who have been stored in spreadsheets Excel over the years.

    I have a few questions about this:

    What is a reasonable demand?
    My guess is that we need to load historical data in the tables of audit BPM (BPM_AUDIT_QUERY, etc.), is - that correct?
    Any suggestions on how to get there?

    I was reading the doc, Googling the web and searching this forum and I have not found yet any relevant material on this subject.

    Concerning

    Juan

    Published by: Juan Algaba Colera on October 11, 2012 04:14

    It would be very difficult to directly load their data in the audit tables. Also check tables are stored in the soa-infra schema which is usually configured to be served after a certain period of time so that it grows indefinitely, because it contains all the runtime information as well. You will need to determine how long they need these historical data and configure properly the purge and the size of the DB correctly for this amount of data.

    If data in excel are truly one, the new BPM process the best way to get the audit data in the process can be use the APIs to create instances of the process and then automate execution of each task as defined in the spreadsheets. This way these past instances have been run through the system.

    In most cases this is not done however. Most of the customers usually somewhere archived these worksheets in case they need to recover, but will not try to make that old data visible from the BPM workspace and to view an audit trail.

    Thank you
    Adam DesJardin

  • How the parameter of the procedure with the default table type?

    Hello!

    How the parameter of the procedure with the default table type?
    For example:
    type varchar2lType is table of varchar2(50) index by binary_integer;
    create or replace procedure test1
       (
        s1  varchar2(50)
        sa2 Varchar2Type
       )
    as
    begin
       dbms_output.put_line('yyxxyyy!');
    end;
    /
    Published by: bullbil on 16.01.2012 06:35

    If he should really be an associative array for some reason any (can't think why, but just for fun...) you could declare a dummy array in the packet header and specify as the default:

    create or replace package wr_test
    as
       type varchar2ltype is table of varchar2(50) index by pls_integer;
       g_dflt_varchar2l_tab varchar2ltype;
    
       procedure testit
          ( p_testarray varchar2ltype default g_dflt_varchar2l_tab );
    end wr_test;
    
    create or replace package body wr_test
    as
       procedure testit
          ( p_testarray varchar2ltype default g_dflt_varchar2l_tab )
       is
       begin
          dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements');
       end testit;
    
    end wr_test;
    

    It is a bit of a hack, because it relies on a global variable that is exposed. A more orderly approach would overload the procedure so that a version does not have the table and another argument:

    create or replace package wr_test
    as
       type varchar2ltype is table of varchar2(50) index by pls_integer;
    
       procedure testit;
    
       procedure testit
          ( p_testarray varchar2ltype );
    
    end wr_test;
    
    create or replace package body wr_test
    as
    
       procedure testit
       is
          v_default_array varchar2ltype;
       begin
          testit(v_default_array);
       end testit;
    
       procedure testit
          ( p_testarray varchar2ltype )
       is
       begin
          dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements');
       end testit;
    
    end wr_test;
    
  • Nested tables will not align with the primary table


    Hi all. Looks like I am facing another obstacle focus on the table. While I was creating one of my pages, I used nested tables to create a column on the left side of the page that will contain my menu secondary, while the other column will hold a flash element and the content of the page.

    Although I have inserted tables nested with a spacing of the cell '0' and '0' cell padding and Visual AIDS seem to indicate that the values in the nested table are identical with the primary table who is the holder, the nested table that will contain the film and the page content is not embedded with the table above. It seems to be off by 1-2 pixels or more, but since there will be a right on the image under the menu is quite obvious.

    I enclose the code for your information (line 165, 166).

    Thank you for your time and your suggestions. I really appreciate it.

    Saturday, September 16, 2006 15:06:50 + 0000 (UTC), "HTML-Newbie.
    wrote:

    > Discover the link http://www.fastventures.com/dev/test_temp_2col.html and you
    > see the picture under the main menu align with her on the
    > right side.

    Change this:




    To do this:

    <>
    SRC = "img/place_second.jpg" width = "572" height = "200" > "

    align = "right" >

    <>
    SRC = "img/place_second.jpg" width = "572" height = "200" > "

    Gary

  • ORA-39060: one or more tables has declined due to conflicts with the main table

    Dear all,

    Currently, I have problems, I try to import the entire schema

    bash - $3.2

    bash - $3.2 impdp dumpfile = PRODDUMP BALL/BALL_BALL@BALL. DMP DIRECTORY = DUMP_DIR FULL = Y LOGFILE = IMP Log REMAP_SCHEMA = BALL: BALL REMAP_TABLESPACE = BALLDATA:BALLDATA

    Import: Release 11.2.0.3.0 - Production the my Sep 30 15:28:08 2013

    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

    Connected to: Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, Automatic Storage Management, Oracle Label Security, OLAP,.

    Options of Data Mining and Real Application Testing

    ORA-39060: one or more tables has declined due to conflicts with the main table

    UDI-31626: operation there was error ORACLE 31626

    ORA-31626: there is no job

    ORA-39086: cannot retrieve information about jobs

    ORA-06512: at "SYS." DBMS_DATAPUMP', line 3326

    ORA-06512: at "SYS." DBMS_DATAPUMP', line 4551

    ORA-06512: at line 1

    Any solution please

    Hello

    You can use the view:DBA_DATAPUMP_JOBS

    then use the table as drop statements

    drop table . purge;

    HTH

  • 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

  • Related to images of a table showing visted and play with the whole table

    Help please.

    I've never had this happen in another version of dreamweaver.  Using dreamweaver CC now.

    I have an image created in photoshop. cut into slices. load the HTML and images in dreamweaver.  Dreamweaver then creates a table.  If I download just as, the site looks good.  Once I choose a slice of the image, create a link to it and then to download the site, there is a purple border around the image so ruin my entire table.  The site shows the breaks between each slice of the image.

    Thank you

    The only real advice I can give, which will help you in the long run, would be to take some time to learn at least the basics of html and css. How to Photoshop to do will almost always blow your site to pieces as soon as you start editing content around. To create professional sites with DW, you need to understand HTML and CSS (and to a lesser extent, javascript). However, without a solid understanding of HTML and CSS little issues like the problem of border IE can become huge problems.

    There are tons of places online to get tutorials on that, personally, I like the following links for the basics...

    HTML: http://w3schools.com/html

    CSS: http://w3schools.com/css

    Once you understand what is happening behind the scenes of DW, it is much easier to work with the program. Once you understand how to work with code, the program gives you, you can let Photoshop do the work, that it was designed for, image manipulation.

  • Calculate the % with the pivot table columns

    I created an application with these columns:
    Metric       Study          Fast          Slow       On-Target     Total
    ---------------------------------------------------------------------------------
    Metric1     Study1           1             0              0             1
    Metric1     Study2           1             0              0             1
    Metric1     Study3           0             0              1             1
    Metric1     Study4           0             0              1             1
    Metric1     Study5           0             1              0             1
    Metric1     Study6           0             1              0             1
    Metric1     Study7           0             0              1             1
    Metric1     Study8           0             0              1             1
    Metric1     Study9           1             0              0             1
    Metric1     Study10          1             0              0             1
    I want to create a pivot table looks like this.
    Metric          Fast     Slow      On-Target     Total      % Fast     % Slow   % On Target
    ------------------------------------------------------------------------------------------------------
    Metric1         4           2        4            10           40        20       40
    The fast, slow, on the target and Total columns are calculated fields. Picky, I'm having is to get the % columns to work. I also tried create columns % in the form of columns of the table, but at each level of study, the % is 100% or 0%.

    I tried with duplicate columns, all different options to display the value as. None of them worked.

    Could someone help me? The version of the OBI is 10.1.3.4

    Thank you

    Shi-ning

    Published by: SPUD on November 21, 2011 23:09

    Sounds like it. You will need the account of studies as a measure in the criteria. You could do something in the repository, but the fastest way is:

    Criteria:
    Add the study in (it will not go into the PivotTable)
    create new measure based on any existing measure that has the background you need with the formula:
    cases where [existing] is not null then 1 else 0 end

    This will give you 1 for each line that your measure in effect is valid. Add this new measure in the PivotTable and treat it as a normal amount.

  • Buffer and relate with the single table

    I have a table with a geometry column representative plot information with the shape of the plot. I need to write a query that will select 1 or more packages in this table based on the ID of the plot, but also select all parcels less than 300 feet of those selected.

    So just now, I have something like this example to select plots according to their ID:

    SELECT PARCEL_DATA. ADDRESS,
    PARCEL_DATA. CITY,
    PARCEL_DATA. STATE,
    PARCEL_DATA. ZIP,
    PARCEL_DATA. AFN
    OF PARCEL_DATA
    WHERE PARCEL_DATA. AFN IN ('6465 ', ' 4654');

    I don't know where to go here to select also the plots of less than 300 feet from each of these 2 that are already selected. I tried various queries by using SDO_BUFFER and SDO_RELATE, but nothing has worked. Any help would be appreciated.

    The below query works, but only for a digital CAMERA. If I add several APNs to AFN (...), I get the error "ORA-01427: einreihig subquery returns more than one line. I need to work for many, not one. Any ideas?

    SELECT PARCEL_DATA. ADDRESS,
    PARCEL_DATA. CITY,
    PARCEL_DATA. STATE,
    PARCEL_DATA. ZIP,
    PARCEL_DATA. AFN
    OF PARCEL_DATA
    WHERE SDO_RELATE (PARCEL_DATA. FORM,
    (SELECT SDO_GEOM. SDO_BUFFER (300, 1 FORM)
    OF PARCEL_DATA
    WHERE APN IN ('6465')),
    "mask = anyinteract") = "TRUE";

    Edited by: Guddie on April 15, 2010 09:00

    1) hold with SDO_RELATE/SDO_BUFFER:

    SELECT A.ADDRESS,
    A.CITY,
    A.STATE,
    A.ZIP,
    A.APN
    OF PARCEL_DATA A, PARCEL_DATA B
    WHERE SDO_RELATE (A.SHAPE, SDO_GEOM. SDO_BUFFER (B.SHAPE, 300, 1)
    "(masque = anyinteract') = 'TRUE' AND B.APN IN ('6465 ', ' 4654');"

    (2) reserved for the SDO_WITHIN_DISTANCE:

    SELECT A.ADDRESS,
    A.CITY,
    A.STATE,
    A.ZIP,
    A.APN
    OF PARCEL_DATA A, PARCEL_DATA B
    WHERE SDO_WITHIN_DISTANCE (A.SHAPE, B.SHAPE, 'distance = 300') = 'TRUE' AND
    B.APN IN ('6465 ', ' 4654');

    Published by: you on April 15, 2010 12:21

  • foreign key with the apps table

    Hello world

    I created a custom table and I want to create a foreign key with per_all_people_f.

    Code:
    ALTER TABLE xxsshr.xxsm_sshr_hr_approver
    ADD CONSTRAINT fk_person_id
    FOREIGN KEY (person_id)
    REFERENCES HR. PER_ALL_PEOPLE_F (person_id)

    However, I get ora-00942: table or view does not exist.

    We use 11.5.10 and g 10 dB

    Thanks for any help...

    Elmer

    The XXSSHR account will need reference and select the privileges (and maybe others) on the PER_ALL_PEOPLE_F table. The ALTER TABLE statement must be run under the account XXSSHR after the above privileges are granted.

    HTH
    Srini

  • DM 4.0.0.833 and synchronization with the data-&gt; TABLES DROP dictionary

    Hello

    I have a DataModeler physics implemented in Oracle database, I drop a table of data in DM maker 4.0.0.833.

    The database with the data dictionary synchronization and does not detect that you have deleted a table.


    Is this a bug? Or am I something wrong?


    Thank you

    Please mark the thread as answered if answer has helped you to solve the problem.

    Thank you

  • Problem with the af:table links and views

    I want to display a table with data from a database table called PERSON, so I use af:table tag.

    The PERSON table has the following fields:

    • PERSON_CODE
    • PERSON_NAME
    • PERSON_COD_STATE

    The PERSON_STATE field is a foreign key to another table called PERSON_STATE:

    • PERSON_COD_STATE
    • DESCRIPTION

    I created a view for the data of the PERSON (personView) table. Because I want to show the person status description in the af: table, I created another view for the data in table PERSON_STATE (personStateView). And I've also created a link between personView and personStateView.

    In the column of the af: table that represents the State of no one, I drop the field 'description' of the State view linked to the view of anyone.

    When I run the JSP, the State is not displayed correctly. All persons are displayed with the same State.

    During the test directly with the application module, the display link works correctly.

    View links inside an af:table work?

    I work with ADF 10 g.

    Thank you

    Your scenario should be treated with a sql (VO on two EOs) join with a relationship master / detail. The table will be able to browse the details for each master record to time stamping.

  • error handling - when using 'base' no updates to the audit table

    Hello;
    We use the error handling via the shadow errors; the operating mode is set by default to the "game";
    errors are caught in the trap in the errors table, but the audit of execution messages show is no longer there was error;
    y at - missing something on the shelf upward?
    before implementation of the error, with the operation mode table ' set to the line according to fail based on ' errors were recorded in all_rt_audit_exec_messages;
    now with the switch, the errors are caught in the trap, but we warned is no longer that it was a mistake;
    ID appreciate advise on how to fix that
    THX
    Rgds

    Hello

    Mode set-based, Oracle Warehouse Builder generates a single SQL statement that treats all data and performs all operations. Although the treatment of the data as a whole improves performance, audit information available are limited. Runtime auditing is only limited to the account of the run-time error. With mode based on the game, you can not identify lines that contain errors.

    Cap 10. Understand the Performance and Advanced ETL of Oracle® Warehouse Builder of modeling, ETL and data quality Guide data
    11g Release 2 (11.2)

    See you soon

  • Formulation of condition CQL with the source table and Javabean event

    Hello

    I managed to create a State in CQL that compares 2 values of TIMESTAMP between a source table and a Java bean.

    I did this by complying with the standard DATETIME SimpleDateFormat in the docs.

    But the format does not include milliseconds. Is there another way I can do this, without losing the value of millisecond of the Javabean?

    The request is something like

    Select table.*
    table, beans
    where table.sometimestamp < bean.startdate
    and table.sometimestamp > bean.enddate


    where bean.startdate and bean.enddate is a java.util.Date? (or all)

    I tried all kinds of combinations like to_timestamp (bean.startdate.getTime ()) but it is not the correct timestamp.

    Also tried to use types of java.sql. * but came through different CQL syntax errors.


    Any tips?

    Thank you!
    Jarell

    Hello

    I think you have two options:

    (1) to use SimpleDateFormat the of ' pattern. For example: "' yyMMddHHmmssSS', where the last two are the number of milliseconds.

    2) keep as a long (e.g. System.currentTimeMillis)

    Best regards
    Alex

Maybe you are looking for

  • can I erase all the data from my old phone with out damaging the data on my new phone?

    My old phone is disconnected from my iCloud, I want to know that the data on my new phone will not erase?

  • HP pavilion 15-p125ng: restoration of the bios

    So I've updated my bios, insyde f.42 and temperatures of the cpu, motherboard and gpu increase 10-15 ° C on average. This is not acceptable, which explains why im trying to do a bios recovery. Unfortunatally this procedure does not work since the upd

  • nothing responds to mouse clicks

    PC starts normally, windows opens with everything in place, but no response when I click on anything whatsoever

  • Problem with Gmap or GPS

    Hi all I have a problem, I think with a my Z3c sencor. In fact, when I run Gmap, land or any other applications using compass. I have a gap of 45 ° between true North and what appears on my screen. For my Z3c North is the East. So I have not found...

  • MAF: Unable to create the device

    Hey all:I created a new simple application to the MAF.  This app is at the base, has some features with basic behaviors.#1: when I run "Clean All"--> CRG cancels the CLEAN#2: to deploy I get ' feature was not created.Any direction is welcome.  I woul