Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I hope I am asking this correctly...
I have a SQL select statement and I have been able to use substr to narrow down my field to the 6 numbers I need AGT_6 (123456). now i need to add CL in front so AGT_6 (CL123456)
Hierarchy:
SQL SELECT substr(AGT_CD,3,6) as AGT_6
FROM ZDBA.ZAHRMAGC;
I believe in SQL concatenate function is ||
So it would be like
SQL SELECT 'CL' || substr(AGT_CD,3,6) as AGT_6
FROM ZDBA.ZAHRMAGC;
or
you can do a preceding load
Load 'CL' & AGT_6 as AGT_6;
SQL SELECT substr(AGT_CD,3,6) as AGT_6
FROM ZDBA.ZAHRMAGC;
(updated)
Try:
SQL SELECT 'CL' + substr(AGT_CD,3,6) as AGT_6
FROM ZDBA.ZAHRMAGC;
I believe in SQL concatenate function is ||
So it would be like
SQL SELECT 'CL' || substr(AGT_CD,3,6) as AGT_6
FROM ZDBA.ZAHRMAGC;
or
you can do a preceding load
Load 'CL' & AGT_6 as AGT_6;
SQL SELECT substr(AGT_CD,3,6) as AGT_6
FROM ZDBA.ZAHRMAGC;