Misleading error message in the editor?


In the editor (is it still called MOE?) I have this statement:

alter table schema.table_name truncate partition (partition_name) drop storage;

The word ‘partition’ is underlined in red wiggles, and an exclamation mark appears in the gutter. The message is “ERROR … found ‘partition’: expecting PARTITION PARTITIONS SUBPARTITION or SUBPARTITIONS”.

It’s not a letter case problem as it complains if I uppercase the word ‘partition’ too.

Thanks Norm, I’ve logged it.

I’ve also noticed that it doesn’t complain if there are no parens around the partition name.

Hey Norm,

Turns out that parens there are undocumented. SQL developer flags the syntax as wrong also. So I’m not sure why Oracle runs it, but maybe it’s an Oracle bug. To make this even weirder, you can add as many parens as you want

ALTER TABLE table_name_1 TRUNCATE PARTITION (((((part_1))))), (part_2) DROP STORAGE;


Evening John,

Interesting, very interesting. I’m sure that I saw somewhere in the docs that there were parenthesis around the partition name, but looking just now in 11.2, 12.1 and 12.2, I see nothing!

However, the problem is not the parenthesis, but the word ‘partition’ which is underlined and the hint text says that it was expecting ‘partition’ etc.

SQLDeveloper? Hack! Spit! :wink:



Sent from my Android device with K-9 Mail. Please excuse my brevity.