40 likes | 117 Views
I Esempio di trigger. DROP TABLE book1; DROP TABLE book_authors1; CREATE TABLE book1 ( bookid NUMBER(4), title VARCHAR2(25), publishername VARCHAR2(25)); CREATE TABLE book_authors1 ( bookid NUMBER(4), authorname VARCHAR2(20)); COMMIT;.
E N D
DROP TABLE book1; DROP TABLE book_authors1; CREATE TABLE book1 ( bookid NUMBER(4), title VARCHAR2(25), publishername VARCHAR2(25)); CREATE TABLE book_authors1 ( bookid NUMBER(4), authorname VARCHAR2(20)); COMMIT;
CREATE OR REPLACE TRIGGER "GIOVANNA"."INS1" BEFORE INSERT ON "GIOVANNA"."BOOK1" FOR EACH ROW declare ii varchar2(4); begin insert into book_authors1 values(5, 'Anne'); END;
insert into book1 values (76, 'Bill','ooo'); select * from book_authors1; select * from book1;