Track Table History

Hi,
I need to maintain history of TABLE_AA into TABLE_BB. Whenever a column is updated on TABLE_AA, the old record needs to be inserted into TABLE_BB (for history purpose). I am trying to achieve this using a trigger on the table AA but I am getting 2 records inserted everytime the trigger fires. Please help me here.
Here is the trigger code
CREATE OR REPLACE TRIGGER APPS.TABLEAA_TRIG
BEFORE UPDATE
ON APPS.TABLE_AA
REFERENCING NEW AS NEW OLD AS OLD
DECLARE
V_ERR_CODE NUMBER;
V_ERR_MSG VARCHAR2(255);
BEGIN
-- Insert into history table TABLE_BB --
INSERT INTO APPS.TABLE_BB
(COL1,
COL2,
COL3,
COL4,
COL5,
COL6,
COL7,
COL8,
COL9,
COL10)
VALUES
(:OLD.COL1,
:OLD.COL2,
:OLD.COL3,
:OLD.COL4,
:OLD.COL5,
:OLD.COL6,
:OLD.COL7,
:OLD.COL8,
:OLD.COL9,
:OLD.COL10);
EXCEPTION
WHEN OTHERS
THEN
V_ERR_CODE :=SQLCODE;
V_ERR_MSG := SQLERRM;
DBMS_OUTPUT.PUT_LINE(' Error : '||V_ERR_CODE||' has occurred. '||V_ERR_MSG);
END;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

I modified it to a row level trigger. After this change also I am getting duplicate rows in History table TABLE_BB when ever I update TABLE_AA through form. While I get only 1 record into the history table when I update TABLE_AA from database. In the form, I have reckoned that the update is being done through a button and the button is calling a package.proedure.
Only when I update the record through this push button, I am getting duplicate rows in the history table while when I use the standard save button (yello button on the menu) I do not get the duplicate rows. I have the code of the procedure below.
Note: This form was already created some developer and functioning good.
Please help me here.
Here is the code of the package.proedure
PACKAGE BODY PROCESS_ROW IS
Procedure update_row
is
v_err_code number;
v_err_msg varchar2(255);
begin
:TABLE_AA.last_update_user_i := fnd_global.user_name ;
:TABLE_AA.creation_user_i := fnd_global.user_name ;
:TABLE_AA.last_update_ts := sysdate;
:TABLE_AA.creation_ts := sysdate;
update TABLE_AA
set COL2 = :TABLE_AA.COL2
, COL3 = :TABLE_AA.COL3
, COL4 = :TABLE_AA.COL4
, COL5 = :TABLE_AA.COL5
, COL6 = :TABLE_AA.COL6
, COL7 = :TABLE_AA.COL7
, COL8 = :TABLE_AA.COL8
, COL9 = :TABLE_AA.COL9
, COL10 = :TABLE_AA.COL10
, last_update_ts = :TABLE_AA.last_update_ts
, last_update_user_i = :TABLE_AA.last_update_user_i
where COL1 = :TABLE_AA.COL1;
commit;
exception when others then
v_err_code :=SQLCODE;
v_err_msg := SQLERRM;
fnd_message.debug(' Error : '||v_err_code||' has occurred. '||v_err_msg||' in procedure update_row');
raise form_trigger_failure;
end;
end;

Similar Messages

  • Need help on TRacking Jobs history of an ETL package

    Hello there, Kindly Elaborate me the way to track Job history of my ETL package.
    For Sample I am running that package on my local Server.
    i need a SQL Server tAble, Which Gives me following information
    -Name of the package
    -TYpe of job.: Etl or TSql
    -Is_SuccessRun
    -LAst run time
    -ErrorRun
    -Last Execution time Taken by the ETL.
    Kindly Guide me on this,
    Thanks in advance

    Hi Aditya,
    We cannot integrate the package execution information into the job history.
    This sysssislog table is created in the msdb database when we install SQL Server Integration Services. If you configure logging to log to a different SQL Server database, a sysssislog table with this format is created in the specified database. So, whether
    the sysssislog table in the MSDB database or in a specified database depends on how you create the connection manager for the SSIS log provider for SQL Server, and either one is okay.
    For more information about implementing SQL Server logging, please see:
    http://www.bidn.com/blogs/ShawnHarrison/ssis/2436/basics-of-ssis-logging-part-1-enabling-and-using-sql-server-provider 
    http://www.msbiguide.com/2013/10/logging-in-ssis-sql-server-log-provider/ 
    In addition, you can implement custom logging using event handlers:
    http://consultingblogs.emc.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx
    Regards,
    Mike Yin
    TechNet Community Support

  • Tracking Table value changes

    Hi all,
    currently we are in the process of tracking the data changes in the following table
    /sapsll/adrcon (GTS specific) but it has been checked for the log data changes in its technical settings
    but still we are unable to track the changes in
    cdpos table
    please provide your valuable inputs
    so that we can track the changes
    cheers
    balu

    Hi,
    The place where we find Transaction Table history is SCU3.
    ===================================================================================================
    The logging flag defines whether changes to the data records of a table should be logged. If logging is activated, every change (with UPDATE, DELETE) to an existing data record by a user or an application program is recorded in a log table in the database.
    Note: Activating logging slows down accesses that change the table. First of all, a record must be written in the log table for each change. Secondly, many users access this log table in parallel. This could cause lock situations even though the users are working with different application tables.
    Dependencies
    Logging only takes place if parameter rec/client in the system profile is set correctly. Setting the flag on its own does not cause the table changes to be logged.
    The existing logs can be displayed with Transaction Table history (SCU3).
    Regards,
    Bhargava

  • Status & Tracking system History

    Hello Everybody,
    I have a special situation here. I need to show my clients my Status and Tracking system history. Let me give u a mudane example,
    A cost  center account undergoes twice budget changes both the times with the 'accepted' status. I should show the client in a report when and what amount has this account undergone during the two budget changes like this
    Account   Changed on     Changed amount   Approved by              Requested by
    23423       14.05.2007          100000€           Thomas Escher          Wolf schere
    23423       13.06.2007          120000€          Thomas Escher          Wolf schere
    My question,
    Do status & tracking system hzas table where i can get this information. !?
    If not do you have any other approach on mind for this issue!?
    Any idea is highly appreciated,
    Regards & many thanks indeed,
    Karthik

    STS data is contained in tables starting 'UPS'.
    However, the STS history is not going to show which accounts changed, by whom, I think. It can show the status change history by user for a planned unit. (Click the  'Present status' link in the STS. )
    If you want to see which user changed particular values you would have to set the BPS model to record the user id and date/time; it could generate very large amounts of data.

  • How to track the history of supplier sites used for tax reporting (1099)

    Hi,
    Oracle financials doesn't allow two supplier sites setup as tax reportable sites (Unless one is inactive). Suppose if the supplier uses site1 for the year 2009 and site 2 for 2010 and now there is site3 setup as tax reportable. All three sites were setup in 2009 and all three sites are active. Supplier chosen different sites for each year as their tax reportable site.
    How do we know which site oracle used to send 1099 for 2009 & 2010? How to track the history of supplier sites used for tax reporting (1099) in previous years?
    Thanks in advance.
    Regards,
    Ram

    Would the begin_date, end_date and status columns on HZ_PARTY_SITES_USES be any good? Our R12 installations is too new to have accumulated much data yet, but I would look in those columns first.

  • How to get the Reports of Change Tracking Table in MDM?

    Hi!
    Please tell me how to get the reports of Change Tracking Table in MDM which is a System table, directly from MDM without using any interface.
    Thanks in advance for the reply.
    With Best Regards
    Devendra Pandey

    Hi Devendra,
    MDM can track changes on tables and fields. <u>The level of change tracking, and which tables/fields to track, are configurable in the MDM Console</u>. MDM opens a new database on the same database engine as the MDM repository and writes all change records to this database.
    For information of various steps you can visit
    <a href="http://help.sap.com/saphelp_mdm550/helpdata/en/45/c7b20339ee570ae10000000a114a6b/content.htm">this URL</a>
    Regards,
    Krutarth

  • Inserting RFC Response to Tracking table using JDBC as a receiver

    Hi All
    I want to update my tracking table with the RFC response but the problem is I cant figure out he Target structure on my JDBC.
    Every time when testing on my http://xxxxxx:50000/mdt/channelmonitorservlet I get nothing on the  "Processing Details"
    I've configured my RFC Response as a sender (ASYN) and JDBC as a receiver, I do have RFC destination and it working fine.
    My is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:RFC_JDBC_MT xmlns:ns1="http://yonela.com">
    <StatementName_response>
    <PI_JDBC_TBL ACTION="UPDATE">
    <TABLE>PI_JDBC_TBL</TABLE>
    <access>
    <TYPE></TYPE>
    </access>
    <key>
    <key><CARRID>AA</CARRID></key>
    </key>
    </PI_JDBC_TBL>
    </StatementName_response>
    </ns1:RFC_JDBC_MT>
    Any suggestion

    Hi,
    Use Insert in the action field instead of Update and try again.
    -Supriya.

  • OBIEE Usage Tracking Table Is Not Populated

    Hello everybody,
    OBIEE Usage tracking table (s_nq_acct) is not populated correctly for last a few weeks. I have no experience on configuring / managing usage tracking jobs, so I do not know where to start to solve this problem. First of all, which log file should I go to find the problem? And also which parameters should I look? Can you help me please.
    Regards,
    Dilek

    Check that the absolutely correct and precise connection pool information contained in your RPD matches what your entries in the MBeans which then get written to the NQSConfig.ini.
    Check that your UT physical model in the RPD physical layer isn't and old (11.1.1.5) setup running on a 11.1.1.7 env where the column definitions don't match.
    Several log files. NQServer.log and NQQuery.log to begin with.

  • OBIEE 11G - Usage Tracking - Table S_NQ_DB_ACCT

    Hi
    I successfully set up usage tracking in Obiee 11 and the table S_NQ_ACCT gets a lot of new records. Basically it's working.
    In the nqserver.log I get some errors concerning a new table S_NQ_DB_ACCT:
    [nQSError: 17001] Oracle Error code: 942, message: ORA-00942: table or view does not exist
    at OCI call OCIStmtExecute: INSERT INTO S_NQ_DB_ACCT (ID,LOGICAL_QUERY_ID,QUERY_TEXT,QUERY_BLOB,TIME_SEC,ROW_COUNT,START_TS,START_DT,START_HOUR_MIN,END_TS,END_DT,END_HOUR_MIN) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12).
    This is an additional Usage Tracking Table which didn't exist in OBIEE 10G.
    I configured the table as S_NQ_ACCT in the same place in the repositry/connection pool. Writing to this table should be possible.
    Does anybody has an idea what could be wrong? Does another user fill data to this table than the user which fills data to S_NQ_ACCT?
    Thank you

    Hi
    Thank you.
    I use the table within the default RCU created schema. What I don't understand ist why the table S_NQ_ACCT gets a lot of records (because I set the loglevel) but S_NQ_DB_ACCT keeps empty with the error in the nqserver.log. I mean if one table works then the other should be working too? I checked also the permissions which are the same for both tables.
    [2012-06-04T15:14:39.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 7d4f9e9d968c0bfe:-39c197c9:13773b9d89f:-8000-000000000005c768] [tid: 18e0] [nQSError: 17011] SQL statement execution failed. [[
    [nQSError: 17001] Oracle Error code: 942, message: ORA-00942: table or view does not exist
    at OCI call OCIStmtExecute: INSERT INTO S_NQ_DB_ACCT (ID,LOGICAL_QUERY_ID,QUERY_TEXT,QUERY_BLOB,TIME_SEC,ROW_COUNT,START_TS,START_DT,START_HOUR_MIN,END_TS,END_DT,END_HOUR_MIN) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12).
    ]]

  • Does any app exist to track the history of iphone

    is there any app which can track the history of the apps opened or used in the iphone ?

    Yes, that's the size of the incoming update.
    You can check the space each the app currently on the phone takes by going Settings / General /Usage / Storage. Tap on Show all Apps if necessary. Tap on each app name for more details (app size and data size).

  • Ipad/safari wont track browse history when private not selected. Fix?

    Played around with Safari/ipad settings and deleted all browsing history.  Now it doesnt track website history at all even when private isnt manually selected.  Have I changed a default?  Want it to track History now and cant find an obvious fix!

    Played around with Safari/ipad settings and deleted all browsing history.  Now it doesnt track website history at all even when private isnt manually selected.  Have I changed a default?  Want it to track History now and cant find an obvious fix!

  • Date Track Tables

    Hello Friends,
    I am writing a SQL Query to display data from per_all_people_f and ben_prtt_enrt_rslt_f and i am joining these tables by person_id.
    I am getting the result, the problem is that I am getting multiple records for same person_id. I know that it is because of date tracked tables.
    But how to avoid that, so that i can populate latest information only.
    I dont have _x tables. I even tried
    effective_start_date<=sysdate and
    effective_end_ate>=sysdate.
    Still no use.
    Please help!

    Add the following to the where clause:
    per_all_people_f papf
    ben_prtt_enrt_rslt_f bper
    where sysdate between papf.effective_Start_date and papf.effective_end_date
    and sysdate between bper.effective_Start_date and bper.effective_end_date
    and papf.person_id = bper.person_id
    and papf.person_type_id = 'XX' where XX is the person_type_id from table per_person_types where user_person_type = 'Employee'
    you might also want to pull in the assignments table, so you can validate the EE records.
    Thanks, Naveen.

  • [59053] Usage Tracking stopped because the specified Usage Tracking table

    Immideatly after server startup, I am gettting this log in the NQServer.log.
    [59053] Usage Tracking stopped because the specified Usage Tracking table contained the wrong number of columns or a column with an inappropriate data type.
    Any idea how I can find out which table needs update?
    Thanks
    -SJ
    Here are the details of hte tables I have in the Usage tracking schema :
    CREATE TABLE "RMI"."S_NQ_ACCT"
    (     "USER_NAME" VARCHAR2(128 BYTE),
         "REPOSITORY_NAME" VARCHAR2(128 BYTE),
         "SUBJECT_AREA_NAME" VARCHAR2(128 BYTE),
         "NODE_ID" VARCHAR2(15 BYTE),
         "START_TS" TIMESTAMP (6),
         "START_DT" TIMESTAMP (6),
         "START_HOUR_MIN" CHAR(5 BYTE),
         "END_TS" TIMESTAMP (6),
         "END_DT" TIMESTAMP (6),
         "END_HOUR_MIN" CHAR(5 BYTE),
         "QUERY_TEXT" VARCHAR2(1024 BYTE),
         "SUCCESS_FLG" NUMBER(10,0),
         "ROW_COUNT" NUMBER(10,0),
         "TOTAL_TIME_SEC" NUMBER(10,0),
         "COMPILE_TIME_SEC" NUMBER(10,0),
         "NUM_DB_QUERY" NUMBER(10,0),
         "CUM_DB_TIME_SEC" NUMBER(10,0),
         "CUM_NUM_DB_ROW" NUMBER(10,0),
         "CACHE_IND_FLG" CHAR(1 BYTE) DEFAULT 'N' NOT NULL ENABLE,
         "QUERY_SRC_CD" VARCHAR2(30 BYTE) DEFAULT '',
         "SAW_SRC_PATH" VARCHAR2(250 BYTE) DEFAULT '',
         "SAW_DASHBOARD" VARCHAR2(150 BYTE) DEFAULT '',
         "SAW_DASHBOARD_PG" VARCHAR2(150 BYTE) DEFAULT '',
         "PRESENTATION_NAME" VARCHAR2(128 BYTE) DEFAULT '',
         "ERROR_TEXT" VARCHAR2(250 BYTE) DEFAULT '',
         "RUNAS_USER_NAME" VARCHAR2(128 BYTE) DEFAULT '',
         "NUM_CACHE_INSERTED" NUMBER(10,0) DEFAULT NULL,
         "NUM_CACHE_HITS" NUMBER(10,0) DEFAULT NULL
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "RMI_DATA" ;
    CREATE INDEX "RMI"."S_NQ_ACCT_M1" ON "RMI"."S_NQ_ACCT" ("START_DT", "START_HOUR_MIN", "USER_NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "RMI_DATA" ;
    CREATE INDEX "RMI"."S_NQ_ACCT_M2" ON "RMI"."S_NQ_ACCT" ("START_HOUR_MIN", "USER_NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "RMI_DATA" ;
    CREATE INDEX "RMI"."S_NQ_ACCT_M3" ON "RMI"."S_NQ_ACCT" ("USER_NAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "RMI_DATA" ;
    CREATE OR REPLACE FORCE VIEW "RMI"."NQ_LOGIN_GROUP" ("LOGIN", "RESP") AS
    Select DISTINCT USER_NAME as "LOGIN", RUNAS_USER_NAME as RESP From S_NQ_ACCT
    Edited by: SachinJ on Aug 3, 2009 7:54 AM

    Compare the S_NQ_ACCT table you created with the table structure defined in the rpd under the physical layer database object "Oracle Analytics Usage".

  • Track Table Changes

    Hi,
    May I know how to track changes to a table,
    eg. what data has been added/updated/deleted by who and when?
    i have set rec/client parameter in the profile.
    and using SE13, i have tick the log data changes flag of the table.
    when using scu3, logging display status, i can see logging is active
    and the table logging status is active too.
    when using scu3, list of change docs, the page shows
    "Analysis without archived log data
    No logs found for the selected period"
    When clicking on compare, current and history is the same.
    We have made a few updates, additions of rows to the tables.
    May I know how to view these changes, made by who and when.
    What other setting do i have to set?
    Thanks.

    Hello Lovejoy,
    Unfortunetly, the SDN search is not working today for some reason (no sarcasm intended... -Regarding Search ).
    When it is back up again, search for the term rec/client. There are also SAP notes on it.
    Cheers,
    Julius

  • Is there a way to track transaction history based on serial numbers?

    From an accounting standpoint, is there a way where we can track all the costs, freights, transactions on a certain serial number? For example: when we call a computer customer support, they bring up the history of actions that have taken place on a particular computer serial number. Is there a way to do this in SAP?
    The key goals I am trying to accomplish in future with the serial number management are:
    1) Individual costing: I might buy back the same serial number machine from the customer in future and I need to cost it again just based on that serial number. The serial number history should be able to show me the revised cost.
    2) Freight: I need to be able to track freight based on serial number
    3) Product costing: Initially cost the product based on serial number (i think I can accomplish this using batch management and serial management and split valuation)
    Any inputs given would be highly appreciated.
    Thanks & Regards

    Yes...Can you check that with your SAP BW/Bi Team ??
    Thanks,
    Sandhya

Maybe you are looking for

  • ThreadOpt values - is it possible to set them and what are the ranges?

    Hi there, I have a problem on my TestStand 4.2 platform, with test step result, formed and received from called external sequences results. In my Main sequence, in Post-Expression I defined condition, according to which the "Step.Result.Status" is pa

  • Third Party Sales Order Change

    Hi Gurus I have a situationin third party processing. When the sales order is created with IC = TAS, it fires PR which is then converted to a PO. However after the PO is generated, if Qty in Sales order is changed it does not update the PO. Have you

  • Adobe Acrobat XI: PDF Portfolios - Nonfunctional Preview Window

    Good afternoon, all. I'm running AA XI Pro on a Dell Inspiron 1764 laptop. Win7/64-bit platform. My question focuses on the creation and viewing of PDF portfolios created from converted email. The conversion itself seems to work fine. I select the de

  • Dropdown with property values

    Hi Experts, How would you create a drop down on a report which contains all the values of a property for a given dimension. My Account dimension has property called Allocation_Rule  which could have Rule1, Rule2 ... values. In my report i have to giv

  • Backup failures

    I have a problem with the online backup service, and the 800 people has no clue. About 1-2/week the backup fails. The progress bar shows a message "retrying in X sec", which seems to go in a loop, so it never completes. Rebooting does not help. The r