0

以下触发代码在一定数量的访问后对账单应用折扣,但我收到以下错误 PLS-00103:在预期以下情况之一时遇到符号“=”: := 。( @ % ; 指标

  CREATE OR REPLACE TRIGGER CHECK_DISCOUNT
  BEFORE INSERT OR UPDATE OF C_NO,BILL ON APPOINTMENT
  FOR EACH ROW

  DECLARE

  CURSOR C_APPTMNT
  IS
  SELECT C_NO,COUNT(C_NO) 
  FROM APPOINTMENT GROUP BY C_NO;

  V_C_NO APPOINTMENT.C_NO%TYPE;
  VISIT NUMBER(2);
  V_TEN NUMBER(3):=0.9;

  BEGIN

  OPEN C_APPTMNT;
  FETCH C_APPTMNT INTO V_C_NO,VISIT;

  IF VISITS = 3 AND :NEW.C_NO = V_C_NO THEN 
  :NEW.BILL := :NEW.BILL * V_TEN
  END IF;

  END;
  /

得到一个新的错误 PLS-00103:在预期以下之一时遇到符号“END”:。( * @ % & = - + ; < / > at in is mod not rem <> or != or ~= >= <= <> and or like between || 将符号“;”替换为“END”继续。

4

1 回答 1

0

作业需要一个:

:NEW.BILL := :NEW.BILL * V_TEN;
于 2012-11-19T12:14:10.643 回答