Page 1 of 1
& returning &
Posted: Thu Oct 22, 2020 1:47 am
by Fromm603
I have a field in a LANSA defined file that is a CLOB. When I do an SQL in an SQLRPGLE program to retrieve the data the character '&' returns '&'.
How do I stop this? What causes this? Are there other characters this will happen to?
Re: & returning &
Posted: Thu Oct 22, 2020 9:42 am
by MarkD
Is the CLOB data formatted as HTML, XMLor just plain text ?
Re: & returning &
Posted: Fri Oct 23, 2020 3:08 am
by Fromm603
HTML.
Re: & returning &
Posted: Fri Oct 23, 2020 10:17 am
by MarkD
That's why the ampersand ( & ) is &
That's also why, for example, less than ( < ) and greater than ( > ) characters would be stored as < and >
See
https://www.htmlhelp.com/reference/html ... ecial.html for an example of some of the most common characters.
I don't think you can stop this because it's correct HTML.
Re: & returning &
Posted: Fri Oct 23, 2020 10:33 am
by MarkD
To understand why this happens try this incorrect HTML fragment:
<div> I like use a lot of <div> tags in my HTML pages </div>
It needs to be coded as
<div> I like use a lot of <div> tags in my HTML pages </div>
to work.