CREATE OR REPLACE TRIGGER "DEFAULT_LOG_ENTRY" AFTER insert on "MAIN_APEX" for each row
begin
:new.APEX_LOGS.LOG_ENTRY:= 'This log page was established. Actions and communcations are captured from this date and time onward.';
:new.APEX_LOGS.LOG_DATE:= sysdate();
:new.APEX_LOGS.CIRCULATION:= 'External';
:new.APEX_LOGS.MAIN_PK_REF:= &MAIN_APEX.MAIN_PK;
:new.APEX_LOGS.TECHWRITER:= &MAIN_APEX.TECHWRITER;
end;
思考?这个话题似乎记录得非常糟糕。即使是“帮助”部分也无法深入了解正确的格式。谢谢你们。
答案 0 :(得分:2)
您对Apex和数据库概念感到困惑:触发器是数据库的一部分,而不是Apex。
触发器的语法是:
CREATE OR REPLACE TRIGGER "DEFAULT_LOG_ENTRY" AFTER insert on "MAIN_APEX"
for each row
begin
insert into apex_logs (log_entry, log_date, circulation,
main_pk_ref, techwriter)
values ('This log page was established. Actions and communcations are captured from this date and time onward.'
, sysdate
, 'External'
, :new.main_pk
, :new.TECHWRITER);
end;