I have a CLOB field in a table and I need to repace any occurance of 'string1' with 'string2'. I cant be sure where in the CLOB it will be or how many times it will be in there. Any help would be great as I am having a few issues getting it resolved.
I wrote this and it seems to work. Im worried that what this does though is just change it to a string. Im still testing it but if someone knows this is defo wrong then please tell me.
Many thanks for reply.
Sorry to be pain but why? Im not disagreeing I would just like to know why. and, if you have time would it be possible to show me how I could modify my code to use it.
Much appreciated! it all seems a bit of a dark art right now.
If that v_clob2 value contains single quotes and double dashes you could end up executing something like
update table set value ='I'--blah blah where rowid=....
and seriously screw up your database.
Even if you don't, using this sort of construct (dynamic sql without bind variables) can play havoc with your shared pool.
Thanks for the warning.
Do you know how I can replace that with something better?
How can I get a table name that is a string used in an update statement with out turning the whole thing into a string and executing it?
how can I do this:
update 'schema1.table1' set 'field1' = 'value';
It complains that the table doesnt exist due it being a string rather than a table name. This is the only reason I am using it as I am.
The code in this example is faulty. Try to reduce the work amount from 32767 to 5 (to better visualize the error), and set the following values:
The result will be '1234556A8901233456AA8901234556A890' - not quite correct as the last character of each part is repeated.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.