You need the concatenation operator:
SELECT ALL
SUBSTR(UANOTL,1,4) AS CODE1,
SUBSTR(UANOTL,5,7) || '0' AS ORDER#,
UAATHN, UANOTD
FROM ASTDTA.NOTEH1 T01
WHERE SUBSTR(UANOTL,1,4) = 'REM '
Вопрос
This sql is working but the second substring, is the order num. For these we need to add a '0' at the end, to make it 8 pos now. Not sure how to do this in SQL.
SELECT
ALL SUBSTR(UANOTL,1,4) AS CODE1, SUBSTR(UANOTL,5,7) AS ORDER#,
UAATHN, UANOTD
FROM ASTDTA.NOTEH1 T01
WHERE SUBSTR(UANOTL,1,4) = 'REM '
Решение
You need the concatenation operator:
SELECT ALL
SUBSTR(UANOTL,1,4) AS CODE1,
SUBSTR(UANOTL,5,7) || '0' AS ORDER#,
UAATHN, UANOTD
FROM ASTDTA.NOTEH1 T01
WHERE SUBSTR(UANOTL,1,4) = 'REM '
Другие советы
you just put an & operator before the string and the 0 you want to add
so 0 in front would be
select ('0' & ORDER#)
and at the end would be
select (ORDER# & '0')