Skip to Main Content

SQL Developer for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Merge statement in package causes compilation error

Jan Svoboda4 days ago

From vscode extension version 25.3.0 whenever you have merge statement inside package body, this package ends up with compilation error:

Package Body TEST_PACKAGE compiled

Errors for PACKAGE BODY TEST_PACKAGE:



LINE/COL ERROR

-------- -----------------------------------------------------------------

24/16 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

;

The symbol ";" was substituted for "end-of-file" to continue.

This was not happening with extension version 25.2.2 and prior.

Example package definition:

CREATE OR REPLACE PACKAGE BODY test_package AS
  PROCEDURE merge_test AS
  BEGIN
    MERGE INTO employees e
    USING (
      SELECT 1,
             'A',
             'B'
        FROM dual
    ) ne ON ( e.employee_id = ne.employee_id )
    WHEN MATCHED THEN UPDATE
    SET e.first_name = ne.first_name,
        e.last_name = ne.last_name
    WHEN NOT MATCHED THEN
    INSERT (
      employee_id,
      first_name,
      last_name )
    VALUES
      ( ne.employee_id,
        ne.first_name,
        ne.last_name );
  END merge_test;
END test_package;
/

When you select all text (even with forward slash) and “Run statement” it will throw and error as written above.

Tested on sql developer extension for vscode version 25.3.0

Comments
Post Details
Added 4 days ago
3 comments
65 views