in reply to DBI error
It's probably not causing the error that you getting, but you my want to keep an eye on your NULLs.
'NULL' will be a literal, while NULL will be an actual database null.