Posted: Sat Feb 02, 2008 5:31 pm Post subject: RPAD Equivalent in ESQL
Newbie
Joined: 02 Feb 2008 Posts: 4
Hi,
Is there a function I can use in ESQL which is equivalent to RPAD. I am trying to add 0 at the end of the string if the length of the string is less than 8. The below code is giving an error " Invalid or incompatible data types for '+' operator" . Thanks in advance for your help.
DECLARE totalLength INT 8;
DECLARE actualLength INT 1;
SET DetailQTY = Data.ItemQuantity;
SET actualLength = LENGTH(DetailQTY);
WHILE actualLength < totalLength DO
DetailQTY = DetailQTY + cast(0 AS CHAR);
END WHILE;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum