How do I insert more than 4000 characters to a CLOB type column?
--create test table s
create table s
(
a clob
);
insert into s values('>4000 char')
Results in an error:
ORA-01704:the string too long.
I want to insert a string of >4000 characters one time. How do I do it? Is it possible?
When I read the Oracle reference, CLOB
can save max 4GB(Gigabyte)?
A CLOB (character large object) value can be up to 2,147,483,647 characters long.
The four large object data types BFILE, BLOB, CLOB, and NCLOB all store up to 4 GB of data.
*Cause: The string literal is longer than 4000 characters. *Action: Use a string literal of at most 4000 characters. Longer values may only be entered using bind variables.
Here is an example:
insert into <table> (clob_column)
values
(
to_clob(' <=4000 symbols ')
||to_clob(' <=4000 symbols ')
||to_clob(' <=4000 symbols ')
...
||to_clob(' <=4000 symbols ')
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With