If you're writing pl/sql or even sql to create it, just append that to the end of your string. When I'm doing something like this, I would do something like put the union all at the beginning of the loop code when I'm not on the first record so I don't get an extra one at the end. Or, if you know you are getting an extra union all at the end of the string, you could trim it by 9 characters to trim it off. Then you add the semi-colon after the loop. If you need more help, feel free to post your code and I can look at it.
↧