Was ist an diesem Statement falsch?
Delphi-Quellcode:
CREATE TRIGGER AutoIncAdresse FOR admin.ADRESSEN AFTER INSERT EXECUTE
(
IF :new.ADRESS_ID IS NULL THEN
SELECT MAX(ADRESS_ID) + 1 INTO :new.ADRESS_ID FROM admin.ADRESSEN
ELSE
IF :new.ADRESS_ID <= 0 THEN
SELECT MAX(ADRESS_ID) + 1 INTO :new.ADRESS_ID FROM admin.ADRESSEN
ENDif;
IF :new.ADRESS_ID IS NULL THEN
:new.ADRESS_ID := 1;
ENDIF;
)
Das krieg ich als meldung:
Delphi-Quellcode:
---- Error -------------------------------
Auto Commit:
On,
SQL Mode: Internal, Isolation Level: Committed
General error;-7045 POS(80) Parameter spec
not allowed.
CREATE TRIGGER AutoIncAdresse
FOR admin.ADRESSEN AFTER INSERT EXECUTE
(
IF :new.ADRESS_ID
IS NULL
THEN
SELECT MAX(ADRESS_ID) + 1 INTO :new.ADRESS_ID FROM admin.ADRESSEN
ELSE
IF :new.ADRESS_ID <= 0
THEN
SELECT MAX(ADRESS_ID) + 1 INTO :new.ADRESS_ID FROM admin.ADRESSEN
ENDif;
IF :new.ADRESS_ID
IS NULL
THEN
:new.ADRESS_ID := 1;
ENDIF;
)
Wobei das ":new.ADRESS_ID" (Erste Zeile) rot geschrieben da steht. Geh mal davon aus da da der Fehler liegt