I am creating a NACHA file, and if the number of entries in the file is not a multiple of 10, we need to insert enough "dummy" entries filled with nines ( replicate('9',94)) to get to the next tenth place.
I know that I could write a loop or maybe fill a temp table with 10 entries filled with nines and select the top part of N. But these parameters seem awkward.
I tried to come up with one select statement that could do this for me. Any ideas?
select nacha_rows
from NACHA_TABLE
union all
select replicate('9',94)
source
share