Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reg: UTL_URL.Unescape and CLOB -

915396Feb 8 2013 — edited Feb 10 2013
Hi Experts,

I'm trying to un-escape the data of a table column using the package function - UTL_URL.Unescape
But the problem is my column is a CLOB and length of my data exceeds that acceptable by the function.

So, i'm just trying to simulate that function behavior normally.
My logic is to scan all characters with pattern '%yy' (HEX) and then convert it into DECIMAL using TO_CHAR(,'XX')
But got stuck in this regexp-replace.

Am I going correct...? Any help guys...??
with xx as(
    select '<p>%3Cp%3Ewefwef%3C/p%3E</p>' col from dual
)
select
    UTL_URL.unescape(col) x1,
    regexp_replace(col,'%([a-zA-Z0-9]){2}','\2|.') x2
from
    xx;
gives
<p><p>wefwef</p></p>	
<p>|.p|.wefwef|./p|.</p>
my database:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE	11.2.0.2.0	Production
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Thanks,
Ranit B.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2013
Added on Feb 8 2013
17 comments
2,606 views