ROWID in a TRIGGER

Hi,
I have an AFTER UPDATE TRIGGER but need to track each row which is updated.
Following is the simple example:
need to get the EMPNO whenever there is change in DEPTNO for an employee in EMP.
CREATE OR REPLACE TRIGGER ed_chg
AFTER UPDATE ON emp
FOR EACH ROW
begin
if updating then
select empno into v_empno from emp
where deptno=:new.empno;
dbms_output.put_line('The employee who had a change in Dept : '||v_empno);
--the above one will give an error of too_many_rows. so need to track only that row which is updated.
end if;
end;

Maybe something like this ?
TEST@db102 SQL> CREATE OR REPLACE TRIGGER ed_chg
  2  AFTER UPDATE ON emp
  3  FOR EACH ROW
  4  begin
  5     if :new.deptno != :old.deptno then
  6             dbms_output.put_line('The employee who had a change in Dept : '||:new.empno);
  7     end if;
  8* end;
TEST@db102 SQL> /
Trigger created.
TEST@db102 SQL> set serveroutput on
TEST@db102 SQL> update emp set deptno=10 where empno=7902;
The employee who had a change in Dept : 7902
1 row updated.
TEST@db102 SQL>                                                  

Similar Messages

  • How to get the ROWID in a Trigger?

    On Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit when I try below script I always get the same Rowid as "AAAAAAAAAAAAAAAAAA". Is this normal?
    Thank you.
    create table testrowid (a number );
    create or replace trigger testrowidbins
    before insert on testrowid for each row
    begin
    dbms_output.put_line( 'Rowid:= ' || :new.rowid );
    end;
    set serveroutput on
    insert into testrowid values( 1 );
    insert into testrowid values( 2 );
    insert into testrowid values( 3 );
    rollback ;
    insert into testrowid values( 1 );
    insert into testrowid values( 2 );
    insert into testrowid values( 3 );
    commit ;
    insert into testrowid values( 1 );
    insert into testrowid values( 2 );
    insert into testrowid values( 3 );
    rollback ;

    Well, it was more of a rhetorical question.
    Rowid is the physical location of a row in a table. During the execution of a BEFORE trigger, the row has not yet been placed in the table hence the 'AAAAA' rowid.
    During your AFTER trigger, the row exists in the table and therefore has a normal rowid.

  • Sequence inside a Trigger ??

    Is it possible to use a sequence inside trigger's definition ?
    I don't understand why when i give a static value to my RowId in a trigger's definition it works, but when get a value from a sequence, the trigger become invalid.
    Please Help.

    Somewhat off the spatial topic but what the heck! This is easy :
    SQL> create table t
    2 (person_id number,
    3 person_name varchar2(32));
    Table created.
    SQL> create sequence person_id_seq start with 1 increment by 1;
    Sequence created.
    SQL> create trigger person_id_trig
    2 before insert
    3 on t
    4 for each row
    5 begin
    6 select person_id_seq.nextval
    7 into :new.person_id
    8 from dual;
    9 end;
    10 /
    Trigger created.
    SQL> insert into t (person_name) values ('Steve');
    1 row created.
    halls@GENDEV> select * from t;
    PERSON_ID PERSON_NAME
    1 Steve
    SQL> insert into t (person_name) values ('Rod');
    1 row created.
    halls@GENDEV> select * from t;
    PERSON_ID PERSON_NAME
    1 Steve
    2 Rod
    SQL>
    Steve

  • Error while adding a record

    I am getting the following error while adding record into the table CM_RECIPE_ITEM :
    <h4> Error </h4>
    ORA-20505: Error in DML: p_rowid=626, p_alt_rowid=CRI_ID, p_rowid2=, p_alt_rowid2=. ORA-01410: invalid ROWID ORA-06512: at "COSTMAN.CM_RECIPE_ITEM_T3_AFTER", line 11 ORA-04088: error during execution of trigger 'COSTMAN.CM_RECIPE_ITEM_T3_AFTER'
         Error      Unable to process row of table CM_RECIPE_ITEM.
    Kindly suggest if the problem is because of the Global temporary table or the triggers given below. Also suggest the solution.
    Thanking You,
    Yogesh
    <h4> CM_RECIPE_ITEM Table </h4>
    CRI_ID------CRI_CR_ID--------CRI_BOM_CODE--------CRI_CIFG_CODE---------CRI_CIRM_CODE--------CRI_SEQ--------CRI_QTY--------CRI_RM_COST
    625----------464-----------------PRODUCT3001----------FG003----------------------10---------------------------1-------------------60-----------------10
    626----------464-----------------PRODUCT3001----------FG003----------------------12---------------------------2-------------------40------------------10
    <h4>Global temporary table</h4>
    DROP TABLE COSTMAN.INTERIM CASCADE CONSTRAINTS;
    CREATE GLOBAL TEMPORARY TABLE COSTMAN.INTERIM
    ROW_ID ROWID
    ON COMMIT PRESERVE ROWS
    NOCACHE;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T3"
    BEFORE INSERT OR UPDATE ON "CM_RECIPE_ITEM" FOR EACH ROW
    BEGIN
    INSERT INTO interim VALUES (:new.rowid);
    END;
    <h4>Trigger to update data on CM_RECIPE table </h4>
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T3_AFTER"
    AFTER INSERT OR UPDATE ON "CM_RECIPE_ITEM"
    BEGIN
    FOR ds IN (SELECT row_id FROM interim) LOOP
    UPDATE CM_RECIPE
    SET CR_RMC = (
    SELECT SUM(CRI_QTY * CRI_RM_COST)/SUM(CR_QUANTITY)
    FROM CM_RECIPE_ITEM
    WHERE CRI_BOM_CODE = CR_BOM_CODE
    AND rowid = ds.row_id
    UPDATE CM_RECIPE
    SET CR_TOTAL_COST = (
    SELECT CIFG_PACKING + CIFG_OVERHEAD +CIFG_OTHERS
    FROM CM_ITEM_FG
    WHERE CIFG_CODE = CR_CIFG_CODE
    AND rowid = ds.row_id
    ) + CR_RMC;
    UPDATE CM_RECIPE
    SET CR_GROSS_MARGIN =
    (SELECT CIFG_DP_RATE
    FROM CM_ITEM_FG
    WHERE CIFG_CODE = CR_CIFG_CODE
    AND rowid = ds.row_id) - CR_TOTAL_COST) / CR_TOTAL_COST;
    END LOOP;
    END;
    /

    The scripts of the tables CM_ITEM_FG, CM_RECIPE, CM_RECIPE_ITEM are as follows :
    <h4>CM_ITEM_FG</h4>
    ALTER TABLE COSTMAN.CM_ITEM_FG
    DROP PRIMARY KEY CASCADE;
    DROP TABLE COSTMAN.CM_ITEM_FG CASCADE CONSTRAINTS;
    CREATE TABLE COSTMAN.CM_ITEM_FG
    CIFG_CODE VARCHAR2(13 BYTE) NOT NULL,
    CIFG_CCG_ID NUMBER NOT NULL,
    CIFG_NAME VARCHAR2(50 BYTE) NOT NULL,
    CIFG_PACKING NUMBER NOT NULL,
    CIFG_OVERHEAD NUMBER NOT NULL,
    CIFG_OTHERS NUMBER NOT NULL,
    CIFG_DP_RATE NUMBER NOT NULL,
    CIFG_CR_BY VARCHAR2(32 BYTE),
    CIFG_CR_ON DATE,
    CIFG_UPD_BY VARCHAR2(32 BYTE),
    CIFG_UPD_ON DATE
    TABLESPACE COST_MANAGER
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX COSTMAN.CM_ITEM_FG_PK_001 ON COSTMAN.CM_ITEM_FG
    (CIFG_CODE, CIFG_CCG_ID)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX COSTMAN.CM_ITEM_FG_UK_001 ON COSTMAN.CM_ITEM_FG
    (CIFG_CODE)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_ITEM_FG_T1"
    BEFORE UPDATE ON "CM_ITEM_FG"
    FOR EACH ROW
    BEGIN
    BEGIN
    UPDATE CM_RECIPE
    SET CR_TOTAL_COST = (CR_RMC + :NEW.CIFG_PACKING + :NEW.CIFG_OVERHEAD + :NEW.CIFG_OTHERS);
    END;
    BEGIN
    UPDATE CM_RECIPE
    SET CR_GROSS_MARGIN = (:NEW.CIFG_DP_RATE - CR_TOTAL_COST) / CR_TOTAL_COST;
    END;
    END;
    ALTER TABLE COSTMAN.CM_ITEM_FG ADD (
    CONSTRAINT CM_ITEM_FG_PK_001
    PRIMARY KEY
    (CIFG_CODE, CIFG_CCG_ID)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    CONSTRAINT CM_ITEM_FG_UK_001
    UNIQUE (CIFG_CODE)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    ALTER TABLE COSTMAN.CM_ITEM_FG ADD (
    CONSTRAINT CM_ITEM_FG_FK_001
    FOREIGN KEY (CIFG_CCG_ID)
    REFERENCES COSTMAN.CM_COST_GROUP (CCG_ID));
    <h4>CM_RECIPE</H4>
    ALTER TABLE COSTMAN.CM_RECIPE
    DROP PRIMARY KEY CASCADE;
    DROP TABLE COSTMAN.CM_RECIPE CASCADE CONSTRAINTS;
    CREATE TABLE COSTMAN.CM_RECIPE
    CR_ID NUMBER NOT NULL,
    CR_CCG_ID NUMBER,
    CR_EFF_FROM DATE,
    CR_CIFG_CODE VARCHAR2(10 BYTE) NOT NULL,
    CR_BOM_CODE VARCHAR2(50 BYTE),
    CR_QUANTITY NUMBER,
    CR_RMC NUMBER,
    CR_TOTAL_COST NUMBER,
    CR_GROSS_MARGIN NUMBER,
    CR_CR_BY VARCHAR2(32 BYTE),
    CR_CR_ON DATE,
    CR_UPD_BY VARCHAR2(32 BYTE),
    CR_UPD_ON DATE
    TABLESPACE COST_MANAGER
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_PK_001 ON COSTMAN.CM_RECIPE
    (CR_CCG_ID, CR_ID, CR_CIFG_CODE)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_UK_001 ON COSTMAN.CM_RECIPE
    (CR_ID)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_UK_002 ON COSTMAN.CM_RECIPE
    (CR_BOM_CODE)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_T1"
    BEFORE INSERT ON "CM_RECIPE"
    FOR EACH ROW
    DECLARE
    L_ID NUMBER;
    BEGIN
    IF INSERTING THEN
    IF :NEW.CR_ID IS NULL THEN
    --SELECT CM_RECIPE_SEQ.NEXTVAL INTO L_ID FROM DUAL;
    :NEW.CR_ID := CM_RECIPE_SEQ.NEXTVAL; --L_ID;
    END IF;
    :NEW.CR_CR_ON := SYSDATE;
    :NEW.CR_CR_BY := nvl(v('APP_USER'),USER);
    END IF;
    IF UPDATING THEN
    :NEW.CR_UPD_ON := SYSDATE;
    :NEW.CR_UPD_BY := nvl(v('APP_USER'),USER);
    END IF;
    END;
    ALTER TABLE COSTMAN.CM_RECIPE ADD (
    CHECK ("CR_EFF_FROM" IS NOT NULL) DISABLE,
    CHECK ("CR_CCG_ID" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CONSTRAINT CM_RECIPE_PK_001
    PRIMARY KEY
    (CR_ID)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    CONSTRAINT CM_RECIPE_UK_002
    UNIQUE (CR_BOM_CODE)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    <h4>CM_RECIPE_ITEM</H4>
    ALTER TABLE COSTMAN.CM_RECIPE_ITEM
    DROP PRIMARY KEY CASCADE;
    DROP TABLE COSTMAN.CM_RECIPE_ITEM CASCADE CONSTRAINTS;
    CREATE TABLE COSTMAN.CM_RECIPE_ITEM
    CRI_ID NUMBER NOT NULL,
    CRI_CR_ID NUMBER NOT NULL,
    CRI_BOM_CODE VARCHAR2(50 BYTE) NOT NULL,
    CRI_CIFG_CODE VARCHAR2(10 BYTE) NOT NULL,
    CRI_CIRM_CODE VARCHAR2(10 BYTE) NOT NULL,
    CRI_SEQ NUMBER,
    CRI_QTY NUMBER,
    CRI_RM_COST NUMBER,
    CRI_CR_BY VARCHAR2(32 BYTE),
    CRI_CR_ON DATE,
    CRI_UPD_BY VARCHAR2(32 BYTE),
    CRI_UPD_ON DATE
    TABLESPACE COST_MANAGER
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_ITEM_PK_001 ON COSTMAN.CM_RECIPE_ITEM
    (CRI_ID)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T2"
    BEFORE INSERT OR UPDATE ON "CM_RECIPE_ITEM"
    FOR EACH ROW
    BEGIN
    IF :NEW.CRI_CR_ID IS NULL THEN
    SELECT CR_ID INTO :NEW.CRI_CR_ID
    FROM CM_RECIPE
    WHERE CR_BOM_CODE = :NEW.CRI_BOM_CODE;
    END IF;
    END;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T1" BEFORE
    INSERT OR UPDATE ON "CM_RECIPE_ITEM" FOR EACH ROW
    DECLARE
    L_ID NUMBER;
    SEQ NUMBER;
    BEGIN
    IF INSERTING THEN
    IF :NEW.CRI_ID IS NULL THEN
    SELECT CM_RECIPE_ITEM_SEQ.NEXTVAL
    INTO :NEW.CRI_ID
    FROM dual;
    END IF;
    :NEW.CRI_CR_ON := SYSDATE;
    :NEW.CRI_CR_BY := NVL(v('APP_USER'),USER);
    SELECT (NVL(MAX(CRI_SEQ),0)+1)
    INTO SEQ
    FROM CM_RECIPE_ITEM
    WHERE CRI_BOM_CODE = :NEW.CRI_BOM_CODE;
    :NEW.CRI_SEQ := SEQ;
    END IF;
    IF UPDATING THEN
    :NEW.CRI_UPD_ON := SYSDATE;
    :NEW.CRI_UPD_BY := NVL(v('APP_USER'),USER);
    END IF;
    END;
    ALTER TABLE COSTMAN.CM_RECIPE_ITEM ADD (
    CHECK ("CRI_RM_COST" IS NOT NULL) DISABLE,
    CHECK ("CRI_QTY" IS NOT NULL) DISABLE,
    CHECK ("CRI_SEQ" IS NOT NULL) DISABLE,
    CONSTRAINT CM_RECIPE_ITEM_PK_001
    PRIMARY KEY
    (CRI_ID)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    ALTER TABLE COSTMAN.CM_RECIPE_ITEM ADD (
    CONSTRAINT CM_RECIPE_FK_002
    FOREIGN KEY (CRI_CIRM_CODE)
    REFERENCES COSTMAN.CM_ITEM_RM (CIRM_CODE),
    CONSTRAINT CM_RECIPE_ITEM_FK_001
    FOREIGN KEY (CRI_CR_ID)
    REFERENCES COSTMAN.CM_RECIPE (CR_ID));
    Yogesh

  • Update child table

    create table p (p1 number constraint ppk primary key);
    create table f (f1 number constraint ffk references p);
    create trigger pt after update on p for each row begin
    update f set f1 = :new.p1 where f1 = :old.p1;
    end;
    insert into p values(1);
    insert into p values(2);
    insert into p values(3);
    insert into f values(1);
    insert into f values(2);
    insert into f values(3);
    commit;
    After this when I execute
    update p set p1 = p1+1;
    I am seeing all the records updated 4 in table f.This is because of the fact that above dml updates multiple rows at once.
    My doubt: Is there any way to track which foreign key values have already been updated? Using that suggested way I would like to modify the trigger such that no row is updated twice.
    Thanks in advance.

    Please find the code which I have tried for the
    same...
    DROP TABLE f;
    DROP TABLE p;
    CREATE TABLE p (p1 NUMBER CONSTRAINT ppk PRIMARY
    KEY);
    CREATE TABLE f (f1 NUMBER CONSTRAINT ffk REFERENCES
    p);
    INSERT INTO p VALUES(1);
    INSERT INTO p VALUES(2);
    INSERT INTO p VALUES(3);
    INSERT INTO f VALUES(1);
    INSERT INTO f VALUES(2);
    INSERT INTO f VALUES(3);
    DROP TABLE a;
    CREATE TABLE a(arowid ROWID);
    DROP PACKAGE pkg;
    CREATE OR REPLACE PACKAGE pkg IS
    frowid ROWID;
    END;
    CREATE OR REPLACE PROCEDURE load(r ROWID) IS
         v NUMBER(1) :=0;
    BEGIN
         SELECT 1
         INTO v
         FROM a
         WHERE arowid=r;
         IF(v=0) THEN
              INSERT INTO a VALUES(r);
              pkg.frowid:=r;
         ELSE
              DBMS_OUTPUT.PUT_LINE(r||' is already updated.');
         END IF;
    END;
    CREATE TRIGGER ft AFTER UPDATE ON f FOR EACH ROW
    BEGIN
         load(:OLD.ROWID);
    END;
    CREATE TRIGGER pt AFTER UPDATE ON p FOR EACH ROW
    BEGIN
         UPDATE     f
         SET      f1 = :NEW.p1
         WHERE      f1 = :OLD.p1
         AND      f.ROWID=pkg.frowid;
    END;
    SQL> update p set p1=p1+1;
    update p set p1=p1+1
    ERROR at line 1:
    ORA-02292: integrity constraint (BI_LEARN.FFK)
    violated - child record found
    SQL>
    Could anyone help me for this.
    Thanks in AdvanceThe first logical error is here
         AND      f.ROWID=pkg.frowid;pkg,rowid to this point of time never corresponds to ROWID of table f.
    That's why UPDATE in trigger doesn't run and also other actions respectively.
    BTW: here
    CREATE OR REPLACE PROCEDURE load(r ROWID) IS
         v NUMBER(1) :=0;
    BEGIN
         SELECT 1
         INTO v
         FROM a
         WHERE arowid=r;
         IF(v=0) THEN
              INSERT INTO a VALUES(r);
              pkg.frowid:=r;
         ELSE
              DBMS_OUTPUT.PUT_LINE(r||' is already updated.');
         END IF;
    END;You get an exception NO_DATA_FOUND, if You haven't a record in table.
    Your branch starting with IF v=0 will be never processed ...
    Regards
    Dmytro

  • After insert trigger with :NEW.ROWID

    Hi All,
    I am using a After insert trigger to generate history record as following:
    CREATE TABLE TB_TEST (classID number(3), classNm varchar2(12));
    CREATE TABLE TB_HIST_TEST (hist_dttm timestamp(6), classID number(3), classNm varchar2(12));
    CREATE or REPLACE TRIGGER air_test AFTER INSERT ON tb_test FOR EACH ROW
    BEGIN PK_SRVC.CRT_NewRec('TB_TEST', 'TB_HIST_TEST', :new.ROWID); END:
    In PK_SRVC package, I use the following statment to create new record in TB_HIST_TABLE:
         Insert into tb_hist_test (hist_dttm, classID, classNm)
         values (select systimestamp, classID, classNm from tb_test where rowid = ROWID )
    The trigger DOES fire when a new row is inserted into TB_TEST. However there is no record inserted into TB_HIST_TEST. Any suggestion?
    Thanks,

    The PK_SRVC.CRT_NewRec is a generic service package that can be shared by many tables. It uses dynamic SQL to get all the collumns for different tables based on USER_TAB_COLUMNS.  The following is the code of this package:
    PROCEDURE CRT_NewRec ( p_TableName IN VARCHAR2, p_AudTableName IN VARCHAR2, p_RowID)
    IS
           TYPE TabCol_RecTyp IS RECORD (COLUMN_NAME VARCHAR2(30), COLUMN_ID NUMBER);
           TYPE TabCol_CurTyp IS REF CURSOR;
            c_TabCol TabCol_CurTyp;
            rc_TabCol TabCol_RecTyp;
            v_Sql_TabCol VARCHAR2(1000);
            v_ColNames VARCHAR2(1000);
            v_Sql VARCHAR2(1000);
            PRAGMA AUTONOMOUSE_TRANSCATION;
    BEGIN
            v_SQL_TabCol := ' SELECT column_name, column_id FROM USER_TAB_COLUMNS'
                                      ||  ' WHERE table_name = ' || CHR(39) || p_TableName || CHR(39)
                                      || '  ORDER BY column_id';
            v_ColNames := NULL;
            OPEN c_TabCol FOR v_Sql_TabCol;
            Loop
                   FETCH c_TabCol INTO rc_TabCol; Exit WHEN c_TabCol%NOTFOUND:
                   v_ColNames := v_ColNames || ',' || rc_TabCol.COLUMN_NAME;
            End Loop;
            CLOSE c_TabCol;
            v_Sql := 'INSERT INTO ' || p_AudTableName || '(HIST_DTTM, ' || v_ColNames || ' )'  
                      || ' SELECT systimestamp, ' || v_ColNames || ' FROM ' || p_TableName
                      || ' WHEN ROWID = chartorowid(' || CHR(39) || p_RowId || CHR(39) || ')';
             EXECUTE IMMEDIATE v_Sql;
             COMMIT;
    END;    
    (charmingholidays-yyz)

  • Read ROWID from trigger

    Hi expert,
    I'm trying to working with a trigger.
    I want get the ROWID of the record after the commit
    desc tmp_table
    Name                           Null     Type                                                                                                                                                                                         
    TMPID                            NOT NULL VARCHAR2(10)                                                                                                                                                                                 
    FIRST_DAY                               DATE                                                                                                                                                                                         
    LAST_DAY                               DATE                                                                                                                                                                                         
    NOTE                                    VARCHAR2(255)        
    CREATE OR REPLACE TRIGGER trigger_test
    BEFORE UPDATE OF FIRST_DAY ON TMP_TABLE
    declare
    v_tmpid  tmp_table.tmpid%type;
    BEGIN
    insert into tmp_table values ('111',sysdate,sysdate,'1111');
    dbms_output.put_line ('HOW I GET THE ROWID OF THE RECORD UPDATED?');
          commit;
       END;
    /the trigger work fine if I update the column first_day, but I don't know how i can get the rowid of this record.
    cheers,
    Lain

    "Printing" the rowid doesn't have much value.
    If you want to see what it actually means, use the dbms_rowid package to format it.
    SQL> declare
      2     l_rowid         rowid;
      3     l_rowid_type    number;
      4     l_object_number number;
      5     l_relative_fno  number;
      6     l_block_number  number;
      7     l_row_number    number;
      8  begin
      9     select rowid
    10     into   l_rowid
    11     from   t
    12     where  rownum = 1;
    13
    14     DBMS_ROWID.ROWID_INFO (rowid_in         => l_rowid,
    15                            rowid_type       => l_rowid_type,
    16                            object_number    => l_object_number,
    17                            relative_fno     => l_relative_fno,
    18                            block_number     => l_block_number,
    19                            row_number       => l_row_number);
    20
    21     dbms_output.put_line('rowid_type    = ' || l_rowid_type);
    22     dbms_output.put_line('object_number = ' || l_object_number);
    23     dbms_output.put_line('relative_fno  = ' || l_relative_fno);
    24     dbms_output.put_line('block_number  = ' || l_block_number);
    25     dbms_output.put_line('row_number    = ' || l_row_number);
    26  end;
    27  /
    rowid_type    = 1
    object_number = 1473364
    relative_fno  = 42
    block_number  = 47334
    row_number    = 0

  • APEX and CLOB value in trigger

    Hi,
    I am using APEX 3.2.1 with Oracle 11gR1.
    I have two tables:
    CREATE TABLE "TSI"."ATT_TEST2"
    (     "ID" NUMBER NOT NULL ENABLE,
         "TITLE" VARCHAR2(250 BYTE),
         "TOPIC" CLOB
    and
    CREATE TABLE "TSI"."ATT_TEST2"
    (     "ID" NUMBER NOT NULL ENABLE,
         "TITLE" VARCHAR2(250 BYTE),
         "TOPIC" CLOB
    My trigger is:
    create or replace TRIGGER "TSI"."ATT_TEST_TRG"
    BEFORE INSERT ON ATT_TEST
    FOR EACH ROW
    BEGIN
    SELECT ATT_TEST_SEQ.NEXTVAL INTO :new.ID FROM DUAL;
    insert into att_test2(id, title, topic) values (ATT_TEST_SEQ.NEXTVAL, :new.title, :new.topic);
    END;
    Now if I insert a record to ATT_TEST using SQL Developer ATT_TEST2 gets populated.
    If create an APEX form and try to insert into ATT_TEST i get all the fields inserted into ATT_TEST2 except for the CLOB column. The TOPIC column is not copied into ATT_TEST2.
    Any idea why this works from SQL Developer and not from APEX?
    Thank you

    Hello:
    I believe this behaviour is seen because APEX uses the 'DBMS_LOB' API to update LOB/CLOB columns.For the example posted APEX does something like
    INSERT INTO "ATT_TEST" ( "ID","TITLE","TOPIC") VALUES (:B1 ,REPLACE(:B2 ,'%null%',NULL),EMPTY_CLOB()) RETURNING ROWID INTO :0;
    begin select "TOPIC" into wwv_flow.g_dml_clob_text from "ATT_TEST" where rowid = :p_rowid for update; end;
    begin dbms_lob.write( wwv_flow.g_dml_clob_text, length(wwv_flow.g_dml_varchar32767_text), 1, wwv_flow.g_dml_varchar32767_text ); end;
    varad

  • Tabular form on a view :ORA-01446: cannot select ROWID from, or sample...

    Hi,
    I have two tables
    CUSTOMERS
    ===========
    Name Null Type
    ======================
    CUST_UID NOT NULL NUMBER(4)
    CUST_NAME VARCHAR2(50)
    ITEM_PRICES
    ===========
    Name Null Type
    ======================
    IP_UID NOT NULL NUMBER(4)
    IP_ITEM_DESC VARCHAR2(50
    IP_COST_PRICE NUMBER(6,2)
    IP_SELL_PRICE NUMBER(6,2)
    I have a view IPS_VW which is the cartician product of CUSTOMERS and ITEM_PRICES, and an instead of trigger for UPDATE on this view which either inserts or updates data in the following third table
    ITEM_PRICES_SPECIAL
    ===========
    Name Null Type
    ======================
    IPS_UID NOT NULL NUMBER(4)
    CUST_UID NUMBER(4)
    IP_UID NUMBER(4)
    IPS_SELL_PRICE NUMBER(6,2)
    The following is my view
    SELECT 'A'||ROWNUM AS "IPSVW_UID",
    0 AS "IPSVW_IPS_UID",
    "CUSTOMERS"."CUST_UID" AS "IPSVW_CUST_UID",
    "ITEM_PRICES"."IP_UID" AS "IPSVW_IP_UID",
    "ITEM_PRICES"."IP_SELL_PRICE" AS "IPSVW_IPS_SELL_PRICE"
    FROM "CUSTOMERS" "CUSTOMERS",
    "ITEM_PRICES" "ITEM_PRICES"
    WHERE NOT EXISTS
    (SELECT 1
    FROM "ITEM_PRICES_SPECIAL" "ITEM_PRICES_SPECIAL"
    WHERE "ITEM_PRICES_SPECIAL"."IP_UID" ="ITEM_PRICES"."IP_UID"
    AND "ITEM_PRICES_SPECIAL"."CUST_UID" ="CUSTOMERS"."CUST_UID"
    UNION
    SELECT 'B' ||ROWNUM AS "IPSVW_UID",
    "ITEM_PRICES_SPECIAL"."IPS_UID" AS "IPSVW_IPS_UID",
    "ITEM_PRICES_SPECIAL"."CUST_UID" AS "IPSVW_CUST_UID",
    "ITEM_PRICES_SPECIAL"."IP_UID" AS "IPSVW_IP_UID",
    "ITEM_PRICES_SPECIAL"."IPS_SELL_PRICE" AS "IPSVW_IPS_SELL_PRICE"
    FROM "ITEM_PRICES_SPECIAL" "ITEM_PRICES_SPECIAL";
    And this is the instead of trigger
    CREATE OR REPLACE TRIGGER "TRG_IPSVW_UPDATE" INSTEAD OF
    UPDATE ON IPS_VW REFERENCING NEW AS N FOR EACH ROW
    BEGIN
    IF :N.IPSVW_IPS_UID = 0 THEN
    INSERT INTO ITEM_PRICES_SPECIAL
    ( CUST_UID, IP_UID,IPS_SELL_PRICE )
    VALUES
    ( :N.IPSVW_CUST_UID,:N.IPSVW_IP_UID, :N.IPSVW_IPS_SELL_PRICE );
    ELSE
    UPDATE ITEM_PRICES_SPECIAL
    SET IPS_SELL_PRICE = :N.IPSVW_IPS_SELL_PRICE
    WHERE IPS_UID = :N.IPSVW_IPS_UID;
    END IF;
    END;
    Everything works fine in SQLPLUS, if i update a rate in this view, a record is either inserted or updated in the third table.
    But when i try to create a tabular form based on this view, i get the error
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    Could someone help me please?
    Thanks,
    Allen

    I think The tabular form needs to be able to identify some primary key and using a rownum concatenation cannot provide that.
    Cheers
    Kofi

  • How to find rowid of locked rows?

    Hello All,
    I have the "before update trigger" I want to know the rowid of all the locked row before update so that I dont try to update the same row which is locked by some other user. In Ask Tom forum I have seen how to know the rowid of locked row, but it will work only when Some body got hanged in that Perticular row while trying to update it. I dont want the User to get hanged, for that I want to user before update trigger. Help me.

    I believe this is a duplicate of another question in this forum
    How to find out rowid of locked row
    which I answered.
    Justin

  • Instead of trigger and merge

    Hi,
    I have created view and instead of insert, delete, update triggers on it. It is working fine for insert, delete, update. However, the application uses lots of merge command. For merge command on the view, I get following error
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    I dont have any rowid mentioned in merge command. Is there way how to make MERGE working over view with instead of triggers ?
    Thanks for advices.

    my view is simple, it is "union all" operation over several tables without any other conditions, original tables are index organized with PK consisting of 4 columns
    EDIT:
    here is simplified example of the problem
    create table val_00 (
    id number(10),
    data varchar2(100),
    constraint pk_val_00 primary key (id) validate
    ) organization index;
    create table val_01 (
    id number(10),
    data varchar2(100),
    constraint pk_val_01 primary key (id) validate
    ) organization index;
    create or replace view val as
    select id, data from (
    select id, data from val_00
    union all
    select id, data from val_01
    create or replace trigger trg_val_ins
    instead of insert on val
    referencing new as new
    for each row
    begin
    case mod(:new.id, 2)
    when 0 then insert into val_00 (id, data) values (:new.id, :new.data);
    when 1 then insert into val_01 (id, data) values (:new.id, :new.data);
    end case;
    end;
    create or replace trigger trg_val_upd
    instead of update on val
    referencing old as old new as new
    for each row
    begin
    if updating('id') then
    raise_application_error(-20999, 'you can not update primary key in val');
    end if;
    case mod(:new.id, 2)
    when 0 then update val_00 set data = :new.data where id = :old.id;
    when 1 then update val_01 set data = :new.data where id = :old.id;
    end case;
    end;
    create or replace trigger trg_val_del
    instead of delete on val
    referencing old as old
    for each row
    begin
    case mod(:old.id, 2)
    when 0 then delete from val_00 where id = :old.id;
    when 1 then delete from val_01 where id = :old.id;
    end case;
    end;
    insert into val values (1, 'one');
    insert into val values (2, 'two');
    insert into val values (3, 'three');
    insert into val values (4, 'four');
    insert into val values (5, 'five');
    delete from val where id = 2;
    insert into val values (2, 'twooo');
    update val set data = 'two' where id = 2;
    commit;
    merge into val using
    ( select 10 as id, 'ten' as data from dual ) newdata
    on (val.id = newdata.id)
    when matched then
    update set val.data = newdata.data
    when not matched then
    insert (id, data) values (newdata.id, newdata.data);
    ERROR at line 1:
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    Edited by: kamilp on Aug 18, 2012 8:17 AM

  • Instead of trigger is NOT firing for merge statements in Oracle 10gR2

    The trigger fires fine for a update statement, but not when I use a merge statement
    with an update clause. Instead I get the normal error for the view ( which is a union all view, and therefore not updatable.)
    The error is :-
    ORA-01733: virtual column not allowed here
    oracle release is 10.2.0.2 for AIX 64L
    Is this a known bug ?
    I've used a multi-table insert statement to work around the problem for inserts, but
    for updates, I'd really like to be able to use a merge statement instead of an update.
    Mark.

    This is my cut-down version :-
    In this case case I'm getting an :-
    ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
    rather then the ora-01733 error I get in the real code ( which is an update from an involved
    XML expression - cast to a table form)
    create table a ( a int primary key , b char(30) ) ;
    create table b ( a int primary key , b char(30) ) ;
    create view vw_a as
    select *
    from a
    union all
    select *
    from b ;
    ALTER VIEW vw_a ADD (
    PRIMARY KEY
    (a) DISABLE);
    DROP TRIGGER TRG_IO_U_ALL_AB;
    CREATE OR REPLACE trigger TRG_IO_U_ALL_AB
    instead of update ON vw_a
    for each row
    begin
    update a targ
    set b = :new.b
    where targ.a = :new.a
    if SQL%ROWCOUNT = 0
    then
         update b targ
         set b      = :new.b
         where targ.a = :new.a
    end if ;
    end ;
    insert into a values (1,'one');
    insert into a values (2,'two');
    insert into a values (3,'three');
    insert into b values (4,'quatre');
    insert into b values (5,'cinq');
    insert into b values (6,'six');
    commit;
    create table c as select a + 3 as a, b from a ;
    commit;
    merge into vw_a targ
    using (select * from c ) src
    on ( targ.a = src.a )
    when matched
    then update
    set targ.b = src. b
    select * from vw_a ;
    rollback ;
    update vw_a b
    set b = ( select c.b from c where b.a = c.a )
    where exists ( select c.b from c where b.a = c.a ) ;
    select * from vw_a ;
    rollback ;

  • Instead of trigger on view

    I created a view to use in a tabular form and only need to update one column from one table of that view. How do I write the instead of trigger to accomplish this? The field that I am trying to update is a select list-yes/no column in the tabular form. Upon submit with the wizard MRU and the instead of trigger I wrote the update doesn't take effect.
    Without the trigger I get this error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved tableHere's the view:
    CREATE OR REPLACE FORCE VIEW  "GET_USERNAME_VW" ("DOC_INFO_ID", "DOC_TITLE", "DOC_LINK", "ECRNO", "OWNER", "ISO_NUMBER", "STATUS_ID", "FILE_TYPE", "APPROVAL_REQ", "APPROVED", "JOB_DESC", "USER_NAME") AS
      select     "DOC_INFO"."DOC_INFO_ID" as "DOC_INFO_ID",
         "DOC_INFO"."DOC_TITLE" as "DOC_TITLE",
         "DOC_INFO"."DOC_LINK" as "DOC_LINK",
         "DOC_INFO"."ECRNO" as "ECRNO",
         "DOC_INFO"."OWNER" as "OWNER",
         "DOC_INFO"."ISO_NUMBER" as "ISO_NUMBER",
         "DOC_INFO"."STATUS_ID" as "STATUS_ID",
         "DOC_INFO"."FILE_TYPE" as "FILE_TYPE",
         "DOC_INFO"."APPROVAL_REQ" as "APPROVAL_REQ",
         "DOC_INFO"."APPROVED" as "APPROVED",
         "SH_JOB_DESCRIPTION"."JOB_DESC" as "JOB_DESC",
         "SH_EMPLOYEES"."USER_NAME" as "USER_NAME"
    from     "SH_EMPLOYEES" "SH_EMPLOYEES",
         "SH_JOB_DESCRIPTION" "SH_JOB_DESCRIPTION",
         "DOC_INFO" "DOC_INFO"
    where   "DOC_INFO"."OWNER"="SH_JOB_DESCRIPTION"."JOB_DESC"
    and     "SH_JOB_DESCRIPTION"."JOB_DESC_ID"="SH_EMPLOYEES"."JOB_DESC_ID"
    and "DOC_INFO"."STATUS_ID" IN (1,2)
    /Here's the trigger I created
    CREATE TRIGGER GET_APPROVAL
    INSTEAD OF UPDATE ON GET_USERNAME_VW
    REFERENCING NEW AS n                
    FOR EACH ROW
    BEGIN
    update doc_info set approval_req = :n.approval_req
    END;As always, TIA!
    Alexandra
    Edited by: userRRRYB on Jul 11, 2011 4:16 PM - ADDED VIEW

    Alexandra,
    You're going to get that error when creating a tabular form off of a complex view because of the validations APEX creates for you, not because of your trigger. Delete those validations and try again.
    Of course, you're going to want to add the where clause to your trigger, or you'll find that you're updating many more rows than you want...
    -David

  • Form with view having instead-of-trigger gives FRM-40501 and ORA-02014

    I created a data-entry from with a 'view' as datas-source block. This view gives crosstab query results with a data from a single base-table but it is complex and uses decode and aggregate funciton 'max' just to create group by in a crosstab query. I have created a instead of trigger on this view to update or insert a record in base table. A test to update base table works fine at SQl prompt. A test to insert at SQL shows '1 row created' but in fact when I query the database, it does not show newly inserted row. Also, when I compile and run this form, I get FRM-40501 and ORA-02014. Help!!!
    I know that DML operations on a view with DECODE, aggregate functions or group by can not be performed but I thought the "instead of" trigger on the view to update the base table should eleminate this restriction and hence pusued further but now stuck!
    BTW: I can post details of base table, view, and instead of trigger, if you want to see them to further decipher the problem. Just let me know. Thanks!
    VERSIONS: Forms in developer suite v10.1.2.0.2 on Windows XP 64 bit desktop - ; Backend database: 9.2.0.8 on Windows 2003 EE server
    Edited by: user8647268 on Aug 19, 2009 1:19 PM
    Edited by: user8647268 on Aug 19, 2009 1:25 PM

    I just forgot to ask you one question: In my experience with forms, I have captured before_value and after_value and implemented logic based on results many times. This form I am working on is kinda first multi-record form where I have a tabular page with date and about 7 other columns forming a grid of cells, which users wanted. Each line is a record from a view. I tried relying on forms to do DML on underlying table and since the underlying table is a paritioned table, I ran into FRM-40509 and ORA-00936, where returning ROWID becomes problematic. I found a note 167550.1 which says to set Key mode to 'Updateable' or 'Non-Updateable' but not 'Unique' or 'Automatic' as a solution #1. Solution#1 failed i.e. the errors persisted. The note also says in that case, implement Solution #2, which is to write explicit trigger to do each of the DML on view. Here I run into kinda problem: In a tabular form with say 31 records each row having 7 cells which is like capturing 217 before values..that is too many. Addressing them with ':old.xxx' or ':new.xxx' which works in instead of trigger, does not work in trigger inside forms. Without checking these before and after values, it inserts rows with nulls for empty cells where we wnated it to skip and do nothing. So iam looking for a way to capture before value using some kinda standard form mechanism..Do you have any suggestions! (Sorry for long explanation but that is the only way to do it..)

  • Trigger based approach to capture changes in OLTP DB

    I have this scenario where we need to capture changes (updates/deletes) to transaction tables in our OLTP database. The changes will be populated to temp tables and then moved to Hadoop for analysis. The OLTP table record huge volume of data on a daily basis, some tables having thousands of updates every day and some having a few million.
    We have thought of using a trigger-based approach, where a trigger in the OLTP tables will take care of inserting records in the temp tables. It will be a "After Update and Delete" trigger as:
    IF updating THEN
          BEGIN
           insert into temp table // insert statement here
          EXCEPTION
             WHEN others THEN
               null;
          END;
      ELSIF DELETING THEN
         BEGIN
           insert into temp table //insert statement here
          EXCEPTION
             WHEN others THEN
               null;
          END;
       END IF;
    END;Please let me know if this is an acceptable approach. Are there any better ways of doing the same?
    I am using Oracle 11g r1.

    >
    So, as a test, I created a table called test, with a PK on col1.
    Then, I created a MV on it,
    Next, I inserted 2 records, committed, and deleted 1 record, and did commit.
    The RUPD$_TEST is empty, but the MLOG$_TEST has data.
    >
    The RUPD$_TEST is a temporary table that Oracle creates and uses with primary key based MV logs. As a temporary table you won't see data in it unless your session puts data there.
    >
    But how do I read this data?
    >
    What data? You didn't log any data to read.
    Here is an example that doesn't even use a primary key - just a plain old table with familiar data.
    create table emp_copy as select * from emp
    create materialized view log on emp_copy
    with rowid, sequence (empno, ename, job, mgr, hiredate, sal, comm, deptno)
    including new values;
    insert into emp_copy (empno, ename) values (9999, 'test')
    delete from  emp_copy where empno = 7369
    update emp_copy set job = 'NEW JOB' where empno = 7499
    select * from mlog$_emp_copy
    EMPNO     ENAME     JOB     MGR     HIREDATE     SAL     COMM     DEPTNO     M_ROW$$     SEQUENCE$$     SNAPTIME$$     DMLTYPE$$     OLD_NEW$$     CHANGE_VECTOR$$     XID$$
    9999     test                                   AAAUayAAEAAAAJVAAO     1     1/1/4000     I     N     FEFF     844454994905658
    7369     SMITH     CLERK     7902     12/17/1980     30          20     AAAUayAAEAAAAJVAAA     2     1/1/4000     D     O     0000     844454994905658
    7499     ALLEN     SALESMAN     7698     2/20/1981     1600     300     30     AAAUayAAEAAAAJVAAB     3     1/1/4000     U     U     0800     844454994905658
    7499     ALLEN     NEW JOB     7698     2/20/1981     1600     300     30     AAAUayAAEAAAAJVAAB     4     1/1/4000     U     N     0800     844454994905658SNAPTIME$$ shows the SEQUENCE of events.
    XID$$ shows the transaction id
    DMLTYPE$$ I/D/U for Insert/Update/Delete
    For the Insert you can see the new EMPNO and ENAME
    For the Delete you can see the values that were in the deleted row
    For the Update you can see the old job 'SALESMAN' in sequence #3 and the new job 'NEW JOB' in sequence #4
    Just pull the data that you haven't mined/processed yet based on SNAPTIME$$ and then delete those rows when you are done with them.
    It took a few minutes to create that example and start collecting change data. Oracle will collect the changes automatically. All the user needs to do is manage the MV Log to keep it from growing indefinitely.
    For some uses you may not need the actual column values; maybe you just want to know what ROWS in the table changed. This modified example uses ROWID but you could use primary key instead.
    create materialized view log on emp_copy
    with rowid, sequence;
    insert into emp_copy (empno, ename) values (9999, 'test')
    delete from  emp_copy where empno = 7369
    update emp_copy set job = 'NEW JOB' where empno = 7499
    select * from mlog$_emp_copy
    M_ROW$$     SEQUENCE$$     SNAPTIME$$     DMLTYPE$$     OLD_NEW$$     CHANGE_VECTOR$$     XID$$
    AAAUa3AAEAAAR+mAAA     5     1/1/4000     I     N     FEFF     1.68898729922029E15
    AAAUa3AAEAAAR+jAAA     6     1/1/4000     D     O     0000     1.68898729922029E15
    AAAUa3AAEAAAR+jAAB     7     1/1/4000     U     U     0800     1.68898729922029E15There are the ROWIDs for the rows that have changed. The row for the delete MAY not be in the table anymore. The original row with that ROWID was deleted (SNAPTIME$$ = 6) but there could be a later INSERT whose row now has that ROWID. And if ROW MOVEMENT is enabled the rowid of a row could change.
    For that last example you would access the MASTER table (emp_copy) and pull rows based on ROWID. Those are the rows that have 'changed' since the last time you mined the MV log.
    I don't know how it can get any simpler than that! ;)

Maybe you are looking for

  • Finder Closes when I try to open Macintosh HD

    I've just noticed this happening tonight. I did perform todays Mac Update but I don't know if they are related. Whenever I try to open "Macintosh HD" (my boot drive) the Finder closes. Does anyone know what the solution could be? I was able to run a

  • Music playlist on nokia e6

    Hello! I have a brand new Nokia E6 which comes from Germany, however I'm unable to play any songs through a playlist. I have checked the instructions and they all suggest the same, but it seems that my phone does not have the same settings. I am able

  • Why do I get corrupted JPEGs when saving images in Camera Raw, CS6, Mac 0S Mavericks

    I occasionally get corrupted JPEG files when processing RAW files in Camera Raw. The images will have lines of pixels that ar out of line, and or whole sections will be truncated and show white or black. I'm using PS CS6, Camera Raw 8.6 on a Mac with

  • Reader 8.1.2 Blacks out wording.

    Recently upgraded one of our terminal servers to Adobe Reader 8. Since then when a user opens any pdf file it willl open in one of two ways. First it will open in multicolored text. Second it will open with all text Blacked out as if it was a governm

  • Run-time engine doesn't run ('network error')

    Hi, I'm trying to get the RuntimeEngine 7.0 to work on my Win2K PC, which is behine a corporate firewall. The webpage is being setup at an university which I don't believe to have any access restrictions. When I try to access the data page I got the