Reputation: 1
I want to Trim the white-spaces from a string which I am getting from XML file using esql.
I am using trim command but it doesn't seems to work while trimming spaces, whereas if you want to trim something else the Trim() function seems to be working fine .
example
Trim(' ' From ' Nitin ');
Result
Nitin
Trim('i' From 'Nitin');
Result
Ntn
Upvotes: 0
Views: 3786
Reputation: 589
DECLARE whiteSpace CONSTANT CHARACTER CAST( X'090D0A20' AS CHAR CCSID 1208);
-- tab, cr, lf, space
DECLARE input2 CHARACTER 'smith';
SET input2 = whiteSpace || input2 || whiteSpace;
SET OutputRoot.XMLNSC.Top.Out2 = TRIM( whiteSpace FROM input2);
output:
<Top><Out2>smith</Out2></Top>
Upvotes: 0