0

I'm using system to control the process in my company and some of it has comment table, let us say it is Opr_comm. the content inside that attribute is various sometimes it contain "<", ">", "'" and so many symbols. here is the query.

SELECT
    T1.Prod_No, 
    T1.Proc_CD,
    T1.Opr_Comm
FROM
    P110 T1 

I have figure it out, when we input to system < it will turned to be &lt, when > it will be &gt. it happen when i retrieve it from database.

So, how can i convert that code to be symbol again?

Thank you very much for your help

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

If you're just looking to convert back to symbols when you are reading from the table, and not during the write process, you can use the REPLACE function

http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions134.htm

It's bulky, but if this is a limited issue it will work. You'd replace your code:

SELECT
T1.Prod_No,
T1.Proc_CD,
replace(replace(T1.Opr_Comm,"&lt;","<"),"&gt;",">") AS Opr_Comm
From
P110 T1 

Of course if you're able to prevent this encoding from happening in the first place, you'd be better off.

Scott
  • 3,663
  • 8
  • 33
  • 56