Load the column names into a cursor then print them from there, print comma separately before the column name and not after. You just have to make sure you do not print the comma for the first item of the cursor.
Out of curiosity... is this insert supposed to insert on the same table? like a serpent eating it's own tail?
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Doesn't that just reverse my problem? Still need to remove the pesky comma from the start, rather than the end.
Yes, this inserts into the same table. I'm using it to duplicate a row within a table of many columns, but I need to alter the primary key, and specific data within the row.
Doesn't that just reverse my problem? Still need to remove the pesky comma from the start, rather than the end.
Nope. It doesn't. If you read carefully "You just have to make sure you do not print the comma for the first item of the cursor" which is an easy thing to do since you know when you are fetchng the first one.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks