2 Replies Latest reply on Mar 11, 2019 1:50 PM by Lukas Eder

    Wrong syntax error reported when passing PL/SQL %ROWTYPE to MERGE .. INSERT .. VALUES

    Lukas Eder

      This statement batch works perfectly in Oracle 12c:

       

      CREATE TABLE t (a int, b int);

       

      DECLARE

        r t%rowtype;

      BEGIN

        r.a := 1;

        r.b := 2;

       

        MERGE INTO t USING dual ON (1 = 0) WHEN NOT MATCHED THEN INSERT VALUES r;

      END;

      /

       

      SELECT * FROM t;

       

      However, SQL Developer, there's a compilation error reported on "VALUES r":