Home > database >  Two table data as a table to another table also increases with increasing data
Two table data as a table to another table also increases with increasing data

Time:10-01

Insert into KSOA_RETMXLS
Select *
The from interface_retmxls


How to interface_retmxls increasing data automatically to the KSOA_RETMXLS inside

CodePudding user response:

Are you saying that when a new data table KSOA_RETMXLS, growth in interface_retmxls automatically?

This in the trigger

CodePudding user response:

Just don't know how to write

CodePudding user response:

 CREATE OR REPLACE the TRIGGER TG_TEMP 
AFTER INSERT ON INTERFACE_RETMXLS
FOR EACH ROW
The BEGIN
INSERT INTO KSOA_RETMXLS VALUES (: NEW KID: NEW KNAME, : NEW. The field);
END;

No debugging, the building Lord modified try line not line!

CodePudding user response:

 CREATE OR REPLACE the TRIGGER TG_TEMP 
AFTER INSERT ON INTERFACE_RETMXLS
FOR EACH ROW
The BEGIN
INSERT INTO KSOA_RETMXLS VALUES (: NEW KID: NEW. KNAME, : NEW. The field);
END;

CodePudding user response:

Data redundancy,
If two tables of data needs to be 100%, advice directly into the view,

CodePudding user response:

reference 5 floor kakabulusi reply:
data redundancy,
If two tables of data needs to be 100%, suggest directly into view,


Right ~ ~ ~ ~ ~ ~ and synonyms

CodePudding user response:

With the trigger can be solved

CodePudding user response:

1, according to the meaning of the original poster directly, how to implement the data consistent, two tables, and the most direct way is by insert triggers, the second is to write a job and procedure by logic (such as statistics, and then insert), but the practice of the two is trouble,

2, especially curious about why there are two tables, so in order to access (such as two db users of different tables, the same data), and so on in this way, there is no need to complete two tables, directly through the database access to do it, or the establishment of view or synonyms, and so on can be,
  • Related