How do I fix Ora 01704 string literal too long?

This ORA-01704 error is related with the string literal is longer than 4000 characters. Use a string literal of at most 4000 characters. Longer values may only be entered using bind variables. You need to split the characters into multiple parts as follows.

What is the size of CLOB in Oracle?

Datatype Limits

Datatypes Limit
CLOB Maximum size: (4 GB – 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB)
Literals (characters or numbers in SQL or PL/SQL) Maximum size: 4000 characters
LONG Maximum size: 2 GB – 1
NCHAR Maximum size: 2000 bytes

What is the max size of CLOB in Oracle?

4 GB
Datatype Limits

Datatypes Limit
CLOB Maximum size: (4 GB – 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB)
Literals (characters or numbers in SQL or PL/SQL) Maximum size: 4000 characters
LONG Maximum size: 2 GB – 1
NCHAR Maximum size: 2000 bytes

How do I edit CLOB?

To launch the CLOB editor, use the “View Contents” option of the database browser or execute an SQL query against a table that has CLOB data. Once the results are displayed in the query results section, right-click on a cell that contains CLOB data and select the CLOB editor option from the pop-up menu.

Is the string in ora-01704 too long?

ORA-01704: string literal too long. Any suggestion, which data type would be applicable for me if I have to set value of unlimited characters although for my case, it happens to be of about 15000 chars. Note : The long string that I am trying to store is encoded in ANSI.

Is the string literal too long in Oracle?

While I try to set the value of over 4000 characters on a field that has data type CLOB, it gives me this error : ORA-01704: string literal too long. Any suggestion, which data type would be applicable for me if I have to set value of unlimited characters although for my case, it happens to be of about 15000 chars.

What does Oracle error ora-01704 mean?

Error : ORA-01704: string literal too long. Dynamically assign CLOB to variable My problem is quite nontrivial. I should execute PL/SQL script which runs INSERT INTO query. It looks like: So, I found that it’s a good idea to assign CLOB to VARCHAR2 variable as It could be 32767 bytes long. My goal is to do that for each INSERT INTO query. Like:

Is there a character limit for PLSQL procedure?

If You are in PLSql procedure, the limit is 32K characters. Can You provide code sample? The fact is that following two statements result in different behavior: Take a look at post Error : ORA-01704: string literal too long – example how to put update in plsql block in order to achieve 32.767 character limit.