fixed runSqlFromFile self undefined exception and primary key without auto increment always returns wrong integer after save

This fixed two problems:
* issues #82
* primary key without auto increment, such as GUID string, always returns wrong integer after save.