0

I'm trying to return the inserting row into a table of ROWTYPE in PL/SQL but I have the error:

ORA-00936: missing expression.

Table type declaration in package head:

  TYPE t_retourResult IS TABLE OF RESULTATS%ROWTYPE;

And error at inserting in the package body:

PROCEDURE EncoderResultats(p_tResultats IN t_resultats, p_tAjoutes OUT t_retourResult, p_tErreurs OUT t_erreur)
    IS
      ExceptTResultats EXCEPTION;
      i INTEGER;
    BEGIN
      IF(p_tResultats.COUNT = 0) THEN RAISE ExceptTResultats; END IF;

      FORALL i IN INDICES OF p_tResultats SAVE EXCEPTIONS
        INSERT INTO RESULATS VALUES p_tResultats(i) RETURNING * BULK COLLECT INTO p_tAjoutes;

      COMMIT;

    EXCEPTION
        WHEN ExceptTResultats THEN RAISE_APPLICATION_ERROR(-20006,'Le tableau est vide, aucun resultat à ajouter');
        WHEN OTHERS THEN RAISE;    
    END EncoderResultats;
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Remi Hirtz
  • 134
  • 3
  • 16

1 Answers1

0

there is a typo error in

INSERT INTO RESULATS VALUES p_tResultats(i) RETURNING * BULK COLLECT INTO p_tAjoutes;

it is not the table RESULATS but "RESULTATS"

moreover i guess you can't use "RETURNING * " , you have to specify all the column names as reported also here: PL/SQL How return all attributes in ROW

Community
  • 1
  • 1
S.Bozzoni
  • 998
  • 9
  • 18