• Triggers are hard to test and debug, have you tested the insert string outside of the trigger (obviously needs a bit of rewriting) ?

    Your problem sounds like less to do with the fact that it is in a trigger and more to do with the actual insert.

    I had a similar hiccup when trying to write to MySQL, turned out to be different data types related.