Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Leading Spaces in answer set in SQLA - response (2) by msk.khurram

$
0
0

Hi,
 As Integer ranges from -2147483648 to +2147483647, So it needs 10 characters for digits and1 for sign. By default when you convert an integer to characters it is right justfied inside character space. 
Here you have 986 as integer so when it is converted into characters it is right justified in 4 characters space like +986.
You can try cast function it will trim all leading spaces.  SELECT '(' || CAST((a+1) AS CHAR(3)) || ')' FROM dummy;
 
 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>