I have a table that I am trying to concatenate the alpha, next_number, suffix, and length fields together with leading zeros. I cannot get the length to work correctly. If I put 10 in the field "LENGTH" then it work fine. However, I want the user to be able to define the length via a table.
Table Field Below:
SELECT LPAD(ALPHA||NEXT_NUM||SUFFIX, LENGTH, '0')
So the above concatenate the alpha, next_num, and suffix together. The leading zeros is the length so for this example, say 10. If my alpha, next_num, and suffix is 12345, it should display as 0000012345 with 0 leading zeros since my length is 10.