Had the same problem with the to_sql. Return value was negative.
to_sql
Eventually figured out I had an insert trigger on db table which prevented the insert... :D