嗨,我创建了一个触发器,但是我确实遇到了一个错误,并且我不知道该怎么做
create or replace trigger OneMillion
before insert on RESERVATION
for each row
DECLARE
ligne PASSAGER%ROWTYPE;
NPRESVOL number;
begin
select count(*) INTO NPRESVOL from RESERVATION;
IF NPRESVOL = 36 THEN
SELECT * FROM PASSAGER WHERE IDPS = :NEW.IDPS;
DBMS_OUTPUT.put_line (' Vous Este le client 1 million sur le vol .' );
DBMS_OUTPUT.put_line (' NOM : ' || ligne.NOMPS);
DBMS_OUTPUT.put_line (' Prenom : '|| ligne.PRENOMPS );
DBMS_OUTPUT.put_line (' ID PASSAGER : '|| ligne.IDPS );
END IF;
end;
and this is the log error
Trigger ONEMILLION compiled
LINE/COL ERROR
--------- -------------------------------------------------------------
7/4 PLS-00428: an INTO clause is expected in this SELECT statement
Errors: check compiler log
在这种情况下,我不知道该怎么办PLS-00428:在此SELECT语句中应该有一个INTO子句
答案 0 :(得分:2)
您在第二个INTO
中缺少SELECT
:
SELECT * INTO ligne FROM PASSAGER WHERE IDPS = :NEW.IDPS;