Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DECODE function can accept up to 65535 components on Oracle 12c although the document says up to 255

da95c879-4e95-46ec-8816-7ad3b64fc45fDec 9 2019 — edited Dec 10 2019

DECODE function can accept up to 65535 components on Oracle 12c.

* 65535 components

-----

SELECT DECODE(1, 2,3 ... 65535) FROM DUAL;

-----

-> work

" 65536 components

-----

SELECT DECODE(1, 2,3 ... 65536) FROM DUAL;

-----

-> ORA-0939: too many arguments for function

Although the function accepts up to 65535 components(2^16 - 1), the document says that the maximum number of component is 255.

https://docs.oracle.com/database/121/SQLRF/functions057.htm#SQLRF00631

-----

The maximum number of components in the DECODE function, including expr, searches, results, and default, is 255.

-----

Why can the function accept huge number of components?

Does anyone know the reason?

I could not find any information or release note about this discrepancy.

Comments
Post Details
Added on Dec 9 2019
6 comments
489 views