Bug in the PL / SQL rule: Reserved words should be written in upper case

#bug:fp

I noticed a bug in the PL / SQL rule: Reserved words should be written in upper case.

In “create or replace PACKAGE”, it is normal for SonarQube to identify that “create or replace” are in violation of these three rules:

  1. A parsing error occurred in this file

  2. The reserved word “create” should be written in upper case.

  3. The reserved word “or” should be written in upper case

On the other hand, if we replace them “create or replace” by uppercase characters in “CREATE OR REPLACE PACKAGE”, SonarQube identifies as a syntactic problem (A parsing error occurred in this file.)

Indeed, under SQL Developer, in the PL / SQL language exceptionally “create or replace” must be written in lowercase in “create or replace PACKAGE”

The version of SonarQube is v8.9.2 (LTS) EE. So, could please you take this bug into account and develop a batch fix?

Hi,

Sorry, I don’t get it.
I suppose that you have a file which contains more than just the 4 words create or replace PACKAGE.

I don’t see any problem with something such as:

create or replace PACKAGE emp_mgmt AS 
   PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER); 
END emp_mgmt; 
/ 

SonarQube doesn’t raise a parsing issue on that code.
If you see one, can you please share your code? The parsing issue may be due to something else.
If you activate Reserved words should be written in upper case (it’s not in the default quality profile), SonarQube indeed raises an issue on both create and or.

If I use upper case, I don’t see any problem either:

CREATE OR REPLACE PACKAGE emp_mgmt AS 
   PROCEDURE increase_comm(employee_id NUMBER, comm_incr NUMBER); 
END emp_mgmt; 
/ 

SonarQube doesn’t raise a parsing issue on that code.

Really? What makes you think so?
I tested the above blocks of code with Oracle SQL Developer and I didn’t see any issue: it returned “Package EMP_MGMT compiled” in both cases.