Full width home advertisement

Travel the world

Climb the mountains

Post Page Advertisement [Top]

Recently, I came across this problem, someone faced while casting a decimal datatype to varchar data type in DB2.

Here’s the link to the whole thread :

db2– Decimal to Varchar without leading zeros

So, the idea is to replace the 0’s with spaces and convert them back to 0 with second replace. I’ve already explained the reason for this double-do for both replace and rtrim/ltrim functions instead of a single trim, strip functions.

Bottom Ad [Post Page]

| Designed by Colorlib