SQL> CREATE TABLE DTEMP (
2 VNAME VARCHAR2(20) NOT NULL PRIMARY KEY,
3 VID VARCHAR2(20) NOT NULL
4 )
5 ;
表已创建。
SQL> CREATE TABLE DTEMPME (
2 VNAME VARCHAR2(20) NOT NULL PRIMARY KEY,
3 VSS VARCHAR2(20) NOT NULL
4 );
表已创建。
SQL> CREATE VIEW BBVIEW AS
2 select dtemp.vname as pvname, dtemp.vid, dtempMe.* from dtemp,dtempMe where dtemp.vname=dtemp
me.vname;
视图已建立。
----------
建一个TRIGGER:
create or replace trigger BBTrigger
instead of insert on bbview
for each row
declare
-- local variables here
begin
insert into sa.dtemp values(:new.pvname,:new.vid);
insert into sa.DTEMPME values(:new.vname,:new.VSS);
end BBTrigger;
转载于:https://www.cnblogs.com/JackSun/archive/2010/09/28/1837424.html