I’m using DB2 and I tried this:
SELECT SUBSTR(DIGITS(123456789),2,9) FROM SYSIBM.SYSDUMMY1
this returned :
If you try this with CHAR, you’ll need to change your starting character address to 1 because character strings are left justified.
When I try :
SELECT SUBSTR(CHAR(123456789),2,9) FROM SYSIBM.SYSDUMMY1
using SELECT SUBSTR(CHAR(123456789),1,9) FROM SYSIBM.SYSDUMMY1
returns the desired result.
Your .& is not a product of the SQL. It is coming from one of the following:
your DB engine, your middleware, your editor or something unique to your environment.
I hope this helps.