Parse error on Oracle sql package with forall statement

Hi,

I am using cli version sonar-scanner-7.1.0.4889-windows-x64
and SonarQube Server Cloud v2025.2 (105476)

On parsing Oracle PL/SQL code there are some ‘Parse error’ messages on the commandline output:

17:27:24.477 WARN Unable to fully parse: C:/svn/SonarQube_checks/SonarQubeSandbox_trunk/sql/011.xxyss_tms/pkg_foralltest.sql
17:27:24.477 WARN Parse error starting from line 1
17:27:24.477 WARN
17:27:24.477 WARN
17:27:24.478 WARN Unable to fully parse: C:/svn/SonarQube_checks/SonarQubeSandbox_trunk/sql/011.xxyss_tms/pkg_foralltest.sql
17:27:24.482 WARN Parse error starting from line 6

the content of pkg_foralltest.sql is

create or replace package body pkg_invoice is
  procedure p_rollback_invoice is
    type t_number is table of number;
    t_inv_line_id t_number;
    l_seq trigtest.seq%type;
  begin
    --
    null;
    forall l_i in 1..t_inv_line_id.count
        select seq
          into l_seq
          from trigtest
         where seq = t_inv_line_id(l_i); 
    --
  exception
    when others then
      raise;
  end p_rollback_invoice;

end pkg_invoice;

When I outcomment the forall statement is no parse errors.

Is this a SonarQube bug or am I doing something wrong?

Hello @Rob.Wijs and thank you for reporting this!
We’ll try to look into it as soon as we can.

1 Like

Hi @Rob.Wijs ,

Thank you for reporting this. I have created a ticket for this issue and we will try and fix it during the week.

David

1 Like

Hi David,

Thanks.
FYI:
I recently found out that you cannot use a select in a forall statement.

The Oracle compiler does not complain but this code seems incorrect.

1 Like

Hi @Rob.Wijs ,

Thanks for letting us know. I will cancel the work on this.

Have a great day,

David

1 Like