j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Exception:queryForLong from database failed #49

Closed helengray closed 9 years ago

helengray commented 9 years ago

I had a BaseHelper which extends OrmLiteSqliteOpenHelper,and create the table Test.class.But,when I add the data,it throw the exception 'queryForLong from database failed: SELECT COUNT(*) FROM tb_test111 WHERE id = ?'

j256 commented 9 years ago

Please post the full exception. Typically the cause by blocks at the bottom of the exception provide more information that should help you figure out the issue.

helengray commented 9 years ago

Thanks. I had solved the problem. It was caused by, don't create the table success. Just upgrade version number or uninstall the application.

hafs-r commented 8 years ago

java.sql.SQLException: queryForLong from database failed: SELECT COUNT(*) FROM <tablename> WHERE tableNameId = ? //I'm getting this error while trying to insert data.

j256 commented 8 years ago

Please post your own issue @hafsalrahman with a lot more details. The full exception for starters.