I have a query as below:
Select price from myTable;
This returns value '22.50'
However, I need the format as 5.8 bytes
in my program.
That is my String value should be '00022.50000000'
and not '22.50'
Is there a way to achieve this directly in SQL ?
From docs, I think you want CHAR( DECIMAL( 22.50, 13, 8 ) )
I have no DB2 instance to play with so can't verify. These functions are not ANSI SQL, they are DB2 specific.