Skip to content

On an older Apps8-era environment, a Custom Menu's PL/SQL block that directly references a database SEQUENCE's NEXTVAL fails with 'Illegal SQL rejected... Illegal column <SEQUENCE_NAME>.NEXTVAL' — why is a plain sequence reference blocked here, and what's a working alternative?

Answer

On that older track, the Custom Menu PL/SQL execution engine only allows SQL referencing objects properly registered in the application's own dictionary — a raw, unregistered database SEQUENCE isn't one of those, which is why a direct NEXTVAL reference gets rejected as illegal SQL. The workaround is to wrap the sequence inside a small custom PL/SQL API package that's properly registered with the framework's dictionary, via the standard sequence of rebuilding dictionary storage, granting the new package to the relevant permission set, and refreshing the active list, exposing a function that simply returns the sequence's NEXTVAL — then call that registered wrapper function from the Custom Menu's PL/SQL block instead of referencing the raw sequence directly, since a properly dictionary-registered custom API package is allowed where a bare sequence reference is not.

← Browse Developer Studio, deployment, and upgrades questions