PL/SQL (MOSC)

MOSC Banner

ORA-01704 string literal too long error during execution of select query

edited Apr 29, 2025 7:17PM in PL/SQL (MOSC) 4 commentsAnswered ✓

For some reason I needed to run a "select" query which length exceeds 4000 bytes, let's assume that it is:

"SELECT '11111111111111………………………11111111' FROM DUAL;"

I tried every possible way I could think of to run the query such as appending it to CLOB, splitting it and run by execute immediate etc. So far I've gathered some information about SQL Engine's working mechanism and knowledge about SQL Engine takes that query as string regardless of how it was constructed.

I'd like to learn more about this situation in technical manner so I'd appreciate any in-depth explanation.

Exclude MAX_STRING_SIZE parameter pls

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center