importcur function was casuing an sql error as I was inserting the database object rather than the first member integer.