I’m attempting to utilize GETXML and cast its output to VARCHAR, encountering various types of values, such as:
240.0, 102.4, 255.0
And textual data like
MOZILLA/5.0 (WINDOWS; U; WINDOWS NT 6.0; PL; RV:1.8.1.14) GECKO/20080404 FIREFOX/2.0.0.14 WEBMONEY ADVISOR
the result for ‘240.0’, for instance, is ‘240’. How can I retain the decimal point and get ‘240.0’? I can’t use the NUMBER type since the values can also be VARCHAR, and the number of decimal points varies across the data types.
An example of the XML structure I’m working with is:
<DeviceInfo>
<AdditionalInfo>
<BrowserVersion>240.0</BrowserVersion>
</AdditionalInfo>
</DeviceInfo>
In my query:
SELECT
GET(XMLGET(xmldata, 'BrowserVersion'), '$')::VARCHAR AS BrowserVersion
FROM CLAIM;
I except to get 240.0 instead 240
Thanks a lot