Inserting Values in Oracle CLOB field


I have one oracle table where one of the field (Column value) datatype is CLOB.
When I query on th etable by select command taking one row as example the field vaule shows as below.
These are nothing but the user names.
I want to add one more username, for example 'asahoo001' to the existing list.

Can you please help me with teh insert query syntax.
Who is Participating?
slightwv (䄆 Netminder)Connect With a Mentor Commented:
What database version are you using?
In newer versions just concatenate it:

update table set clob_col = clob_col || chr(13) || chr(10) || 'newusername' where ...

the chr(13) and chr(10) addes the CR-LF to the clob that looks like yours has.
are you looking to modify the data in the table?

or just select the clob and append the new name without actually modifying the underyling data?
AnandSahooAuthor Commented:
I want to add this new name without changing the existing ones.
In the above example, 3 names are there already.Want to add the 4th one. So total I wil have 4 names after inserting.
In few scenario's I may have more names (5,6,7,8) and I want to add one more. Will the above query work  for that also.
We are using oracle 10g.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

sorry, I didn't ask that well  I guess

do you want to modify the table?
or simply return 4 names, 3 from the table plus 1 more?

in other words,  is this a read or a write operation?
slightwv (䄆 Netminder) Commented:
>>Will the above query work  for that also.


If you are using pl/sql code you might look into dbms_lob.writeappend but for straight SQL, the above should work.
AnandSahooAuthor Commented:
Dear sdstuber
This is a write operation. So wondering if teh update query will replace teh existing ones. I dont have staging environment for this to try.

Dear slightwv,
will try with just one record and confirm u back soon

AnandSahooAuthor Commented:
I am able to get a direction to work wih.

Thanks a ton
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.