我創建了甲骨文展示一個觸發器:錯誤與SQL CREATE TRIGGER甲骨文
/* Formatted on 3-Oct-2013 15:58:45 (QP5 v5.126) */
CREATE OR REPLACE TRIGGER testtrigger
AFTER INSERT OR UPDATE OF sellpoint_name
ON sell_point
FOR EACH ROW
WHEN (new.sellpoint_name = 'Location')
DECLARE lat, lng sell_point.sellpoint_lat%TYPE;
BEGIN
SELECT sellpoint_lat, sellpoint_long into lat, lng
FROM sell_point
WHERE sellpoint_name = :new.sellpoint_name;
IF (:new.sellpoint_lat < 20 OR :new.sellpoint_long < 100)
THEN
raise_application_error (-20225, 'this point is not exists');
END IF;
END;
,但我得到一個錯誤:
1/12 PLS-00103: Encountered the symbol "," when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national character
nchar
1/47 PLS-00103: Encountered the symbol ";" when expecting one of the following:
16:10:50 := (, not null range default external character
什麼錯在這裏?感謝幫助!
它工作!謝謝! – Thangnv
但是爲什麼要從表格中選擇sellpoint_lat和sellpoint_long列,而不是隻能使用:new.sellpoint_lat和:new.sellpoint_long。 否則您將得到t他錯誤,表格在變化。 – Dba
我想在插入sellpoint_lat <20或sellpoint_long <100後執行操作。不在意「raise_application_error(-20225,'這一點不存在');」。 Actualy我有一個錯誤變異。任何更多的解釋? – Thangnv