PLS-00428:在此SELECT语句pl / sql oracle触发器中应有一个INTO子句

时间:2018-12-25 18:43:16

标签: sql oracle plsql triggers

嗨,我创建了一个触发器,但是我确实遇到了一个错误,并且我不知道该怎么做

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子句

1 个答案:

答案 0 :(得分:2)

您在第二个INTO中缺少SELECT

SELECT * INTO ligne FROM PASSAGER WHERE IDPS = :NEW.IDPS;