I am using a CLOB and its not letting me insert anything bigger than 4446
Main Topics
Browse All TopicsI need to be able to store more than 5000 chars in a column and I can't seem to figure out how to this please help. I am useing Oracle 8
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Error: ORA 1704
Text: string literal too long
--------------------------
Cause: A quoted string specified as a constant was too long.
Action: Quoted strings may not contain more than 2000 characters.
Of course!
You cannot have a string larger then 2000 character. You have to use DBMS_LOB.WRITE package for inserting more that 2000 chrs.
You can also create a table with a BFILE:
TEST@PROD>CREATE TABLE TESTTAB( COL1 BFILE );
Table created.
Elapsed: 00:00:00.07
TEST@PROD>INSERT INTO TESTTAB VALUES(BFILENAME('CDIR','T
1 row created.
TEST@PROD>SELECT DBMS_LOB.GETLENGTH(COL2) FROM TESTTAB;
DBMS_LOB.GETLENGTH(COL2)
------------------------
27100 --<<------------ 27100 characters
Here is an example of using DBMS.LOB.WRITE:
TEST@PROD>declare
2 V_CLOB CLOB;
3 V_POS INTEGER := 1;
4 clob_size binary_integer;
5 clob_value varchar2(32767);
6 v_name varchar2(100);
7 begin
8 for i in 1..1000 loop
9 select owner||' '||object_name||' '||object_type||' ' into v_name
10 from(select rownum rn, owner,object_name,object_t
11 clob_value := clob_value ||v_name;
12 end loop;
13 insert into tab1 values ( empty_clob() );
14 clob_size := LENGTH(clob_value);
15 select col1 into v_clob
16 from tab1;
17 DBMS_LOB.WRITE(v_clob, clob_size, v_pos, clob_value);
18 end;
19 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:25.03
TEST@PROD>select dbms_lob.getlength(col1) from tab1;
DBMS_LOB.GETLENGTH(COL1)
------------------------
24840
If you need to store more than 32k, than you need to modify the code
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept paquicuba's comment as answer.
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
ishando
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: paquicubaPosted on 2005-10-06 at 15:15:24ID: 15034702
Use a CLOB datatype.