I solved it.
Apparently, my primary key was spelled incorrectly.
Also, I did casting to integer when inserting/updating.
Thanks, Marcia