DECLARE the loop variable before using it
Replace hyphens in TriggerGenerator.prefix
Always fully qualify columns in triggers