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!

Bug: Cannot install stored object containing a merge statement with VSCode Ext. 25.3.0 and SQLcl 25.3.0

Philipp Salvisberg15 hours ago

The following script fails with SQL Developer for VSCode 25.3.0 and SQLcl 25.3.0 (standalone and embedded versions):

drop table if exists demo_tab purge;

create table if not exists demo_tab (
    demo_id          raw(16) default on null for insert only sys_guid() not null,
    demo_name        varchar2(10 char) not null,
    demo_description varchar2(30 char) not null,
    constraint demo_tab_pk primary key (demo_id),
    constraint demo_tab_uk1 unique (demo_name)
);

-- Fails with SQLcl 25.3.0 and SQL Developer for VSCode 25.3.0 with
--
--    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
--            ;
--            The symbol ";" was substituted for "end-of-file" to continue.
--
-- Works with SQLcl 25.2.0 and SQL Developer for VSCode 25.2.2
--
-- The final semicolon is not deployed (sent to the database), which leads to this error.
create or replace procedure demo_proc is
begin
   merge into demo_tab t
   using (values
            ('Name1', 'Description of Name1'),
            ('Name2', 'Description of Name2')
         ) s (demo_name, demo_description)
      on (t.demo_name = s.demo_name)
   when matched then
         update
            set t.demo_description = s.demo_description
   when not matched then
         insert (t.demo_name, t.demo_description)
         values (s.demo_name, s.demo_description);
   commit;
end demo_proc;
/
show errors;

exec demo_proc;

select * from demo_tab;

The output is:

Table DEMO_TAB dropped.


Table DEMO_TAB created.


Procedure DEMO_PROC compiled


Errors for PROCEDURE DEMO_PROC:

LINE/COL ERROR
-------- -----------------------------------------------------------------
16/13    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
         ;
         The symbol ";" was substituted for "end-of-file" to continue.

Errors for PROCEDURE DEMO_PROC:

LINE/COL ERROR
-------- -----------------------------------------------------------------
16/13    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
         ;
         The symbol ";" was substituted for "end-of-file" to continue.
BEGIN demo_proc; END;
      *
ERROR at line 1:

As mentioned in the comment, the reason is that the final semicolon is not sent to the database, and therefore, the stored procedure is incomplete, which leads to this error.

However, when I run the same script in SQL Developer for VSCode 25.2.2 or SQLcl 25.2.0 (standalone or embedded), the result looks like this:

Table DEMO_TAB dropped.


Table DEMO_TAB created.


Procedure DEMO_PROC compiled

No errors.

PL/SQL procedure successfully completed.


DEMO_ID                          DEMO_NAME  DEMO_DESCRIPTION              
-------------------------------- ---------- ------------------------------
40D068341864A1F4E063020012AC06B1 Name1      Description of Name1          
40D068341865A1F4E063020012AC06B1 Name2      Description of Name2          

Any stored object (Package, Type, Function, Procedure) containing a MERGE statement is affected by this bug.

The workaround is to use an older version, which is not affected by this bug.

Comments
Post Details
Added 15 hours ago
5 comments
136 views