Link to home
Start Free TrialLog in
Avatar of Steve Berger
Steve BergerFlag for United States of America

asked on

Erase CLOB data

Hi,

Is it possible to erase the data from the CLOB? If yes please let me know how?

Thanks
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Define 'erase'?

Do you want to delete the entire contents or part of the clob?

If part of the lob, to you want the erased part to be removed or just over written?

Check out DBMS_LOB.ERASE
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_lob.htm#i997838


update yourtable set your_clob = NULL where....
>>update yourtable set your_clob = NULL

or
update yourtable set your_clob = empty_clob() where....

depending on exactly what they want to do.
Avatar of Steve Berger

ASKER

No i wanted to erase only some part not the whole data
And also how do i come to know the starting point and the ending point to erase. I have only the string which i need to erase.
>>erase only some part

OK, now what does 'erase'?

for example:
in this clob I want to erase the first word clob

Do you want 'clob' spaced out or 'removed'?

in this      I want to erase the first word clob
or
in this I want to erase the first word clob


If you want it removed, doc link but look for:  FRAGMENT_DELETE
>>And also how do i come to know the starting point and the ending point to erase

ALL strings in the clob, just the first, last, ???

same doc link:  dms_lob.instr
could you please provide some sample code for my clear understanding
As soon as you answer my questions:

ALL strings in the clob, just the first, last, ???
and what you mean by erase, replace with spaces or remove?

In other words:  What if the 'string' appears more than once?

Also post your Oracle version.
Not all string in the CLOB. only the sting which i am having in some local variable.

the string never appears more than once in CLOB.

I am using Oracle 10g version.
now.... define 'erase'.

Repeat from when I asked in http:#a34980868


Do you want 'clob' spaced out or 'removed'?

in this      I want to erase the first word clob
or
in this I want to erase the first word clob

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For my requirement first function will suite. when i call eraseCLOB function i am getting below error.

ORA-21560: argument 3 is null, invalid, or out of range
You get that error when you are running my test example as-is or when you try to run it in your system.
GOOD ONE