-3
 CREATE OR REPLACE TRIGGER OBU
 BEFORE INSERT ON BOOKING
 REFERENCING NEW AS n
    FOR EACH ROW
 BEGIN
 INSERT INTO BOOKINGLOG VALUES(n.HOTELID,n.ROOMNO,n.GUESTID,n.STARTDATE,n.ENDDATE,'SYSTEM',SYSDATE);
 ENG;
 .
 /

当我尝试执行它时,我收到此错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
3/4      PLS-00103: Encountered the symbol "end-of-file" when expecting
         one of the following:
         ( begin case declare end exception exit for goto if loop mod
         null pragma raise return select update while with
         <an identifier> <a double-quoted delimited-identifier>
         <a bind variable> << continue close current delete fetch lock
         insert open rollback savepoint set sql execute commit forall
         merge pipe purge
4

1 回答 1

3

您可能想更改 ENG;结束;

并且,失去那个和/之间的句点。

要提升评论以回答:INSERT 语句中引用表值的值需要以冒号 (:) 为前缀。所以,n.HOTELID 应该是 :n.HOTELID 等。

于 2013-02-22T01:20:33.977 回答