While storing the HTML code in oracle db the column type should be CLOB rather than BLOB. Incase if you have used BLOB for storing the HTML code while carrying out update you should first convert the content in to hexadecimal values as below.

  SELECT (RAWTOHEX(UTL_RAW.CAST_TO_RAW('Test'))) 
    FROM DUAL;

The above code returns Hexadecimal value for test as below
54657374

Now if you want to update the Hexadecimal you need to do the same thing.

UPDATE TemplateTbl
   SET TemplateConetent = (RAWTOHEX (UTL_RAW.cast_to_raw ('Mugil   Nikkhil')))
   WHERE TemplateId = TL2600

The above code seems to be fine but it does not work as the   would be interrupted as if a variable prompting you to enter the variable value.

To overcome this issue   should be replace with &  as below

UPDATE TemplateTbl
   SET TemplateConetent = (RAWTOHEX (UTL_RAW.cast_to_raw ('Mugil &  Nikkhil')))
   WHERE TemplateId = TL2600

Cheers. We are Done. :-).

Leave a reply