Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> CREATE TRIGGER history?????????

CREATE TRIGGER history?????????

From: Arthur Levin <arthur_at_stario.com>
Date: 2000/04/25
Message-ID: <QLpN4.993$Pi2.27298@news.pacbell.net>#1/1

Hello,
I have two identical tables.
Primary and History table.
I insert data in Primary table and need insert the same data in History table
PS. I need history table to keep 'Clear' not updated data. I created index but got ERROR

SQL> CREATE OR REPLACE TRIGGER History
AFTER INSERT ON Merchant_Partnert
FOR EACH ROW
BEGIN
   INSERT INTO Merchant_Partnert_Hist
   SELECT * FROM Merchant_Partnert where row_id= row_id_seq.CURRVAL ;    commit;
   END History;
   /

Trigger created.

When I run transactions I receive ERROR. ERROR at line 1:
ORA-03113: end-of-file on communication channel

CREATE TABLE Merchant_Partner(

    row_id                           INTEGER    NOT NULL,
    network_id                    INTEGER,
    merchant_id                   INTEGER,
    merchant_partner_id       INTEGER,
    active                             CHAR(1) default 't' check (active in
('t', 'f')),
    creator                           VARCHAR2(50),
    creation_date                  DATE,
CONSTRAINT ROW_ID_PK PRIMARY KEY (row_id), CONSTRAINT NETWORK_ID1_FK FOREIGN KEY (network_id) REFERENCES Merchant_Nwk(network_id),
)
;
create sequence row_id_seq increment by 100;

CREATE TABLE Merchant_Partner_Hist(

    row_id                       INTEGER    NOT NULL,
    network_id                 INTEGER,
    merchant_id                INTEGER,
    merchant_partner_id      INTEGER,
    active                         CHAR(1) default 't' check (active in
('t', 'f')),
    creator                       VARCHAR2(50),
    creation_date              DATE,

CONSTRAINT ROW_IDH_PK PRIMARY KEY (row_id), CONSTRAINT NETWORK_ID1H_FK FOREIGN KEY (network_id) REFERENCES Merchant_Nwk(network_id),
)
;

Any Ideas how to insert data in history table?

Thank you,
Arthur Received on Tue Apr 25 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US