Reporting Update, Delete and Insert Transactions in Certain Tables as SQL Scripts.

Posted on 2011-10-04
Last Modified: 2012-05-12
Hi Experts,

I need a Log table in which update, delete and insert transactions in certain  tables
will be  written as SQL scripts.     So, the dml  SQl commands which applied  in these tables  will be reported.   How can I do that ?

Question by:orcun_turkec
    LVL 76

    Expert Comment

    by:slightwv (䄆 Netminder)
    Have you looked at auditing and log miner?

    If you want to write it yourself I thing you will need triggers.

    Author Comment

    I haven' t looked at auditing  or log-miner  Slightwv.
    Could you send me   some links or  info about auditing  ?  

    Author Comment

    And If I try to make it with triggers, how will the SQLs that make the dml changes  be  formed ?
    I think I must use this way because I don' t have the sys user of the database.
    LVL 76

    Accepted Solution

    On mobile and cannot find the links.  The online docs have all the info if you search the docs.

    With triggers you just build the DML with the 'when updating', 'when inserting' and when deleting' clauses with the :old and :new column values based on what you want to do.
    LVL 23

    Expert Comment


    Author Closing Comment

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now