Hello,
The following piece of PL/SQL code runs perfectly fine on an Oracle Database, and prints “12” as expected. However, SQL Developer extension for VS Code reports syntax error for the second call to extend() a table. Apparently it doesn't like the empty parentheses when extend() is called on a table that is itself an element of a larger collection. The error isn't reported for the call to extend() on the parent table; it also disappears when I remove the empty parentheses in the second call. In PL/SQL parentheses are optional in a call to a subroutine that takes no arguments, so both versions should be considered valid.
I maintain somebody else's code, and I'd rather not change random things that are valid and working just because my IDE doesn't like them. Is there a way to tell the editor to ignore that particular perceived error and hide it?
Version 25.1.0.
DECLARE
TYPE IntegerTable IS TABLE OF INTEGER;
TYPE Wrapper IS RECORD
(
ints IntegerTable
);
TYPE WrapperTable IS TABLE OF Wrapper;
wt WrapperTable := WrapperTable();
BEGIN
wt.extend();
wt(1).ints := IntegerTable();
wt(1).ints.extend(); -- This is reported as syntax error
wt(1).ints(1) := 12;
dbms_output.put_line(wt(1).ints(1));
END;