If i insert record in table A and these record should update in table B by using Trigger.How to achieve this.

Answer Posted / shwetha

CREATE TABLE A1(ID NUMBER(2),NAMES VARCHAR2(30))

CREATE TABLE B1(ID NUMBER(2),NAMES VARCHAR2(30),STATUS VARCHAR2(10))

CREATE OR REPLACE TRIGGER A1B1
AFTER INSERT ON A1
FOR EACH ROW
BEGIN
INSERT INTO B1 VALUES(:NEW.ID, :NEW.NAMES,'Y');
END;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is view explain with example?

514


Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints

640


What is a join query?

546


Why do we use procedures in sql?

544


How does a covering index work?

522






What is sql performance tuning?

489


Does view store data in sql?

529


Which join is default?

515


Explain the purpose of %type and %rowtype data types?

499


What is cascade in sql?

557


What is difference between hql and native sql?

572


What are inbuilt functions in sql?

593


Explain the uses of database trigger.

648


What is interval partition?

539


What is trigger in sql? Explain

531