CREATE OR REPLACE TRIGGER input_mileages_after_insert AFTER
INSERT ON emora.wm_point
FOR EACH ROW
BEGIN
insert into mileages (no,mem_id, code, mileage, reg_date,last_date, conn_key, status, ip, description ) values (
(select max(no) from mileages) + 1,
:new.customerid,
'4',
:new.point,
:new.in_date,
:new.in_date,
:new.metasessionid,
'R',
'trigger',
:new.description);
END;
/
위에서와 같이 no 의 가장 큰 값을 가져와 하나증가하여 삽입을 하려고
합니다.
근데 아래와 같은 에러가 발생합니다.
SQL> show error
TRIGGER INPUT_MILEAGES_AFTER_INSERT에 대한 오류:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/5 PLS-00103: Encountered the symbol "SELECT" when expecting one of
the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute cast trim forall
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
4/35 PLS-00103: Encountered the symbol "+" when expecting one of the
following:
<an identifier> <a double-quoted delimited-identifier> set
13/20 PLS-00103: Encountered the symbol ")" when expecting one of the
following:
. ( , * @ % & - + / mod rem <an identifier>
<a double-quoted delimited-identifier> an exponent (**) as
into || indicator bulk
부탁드립니다.
|