Android SQLite with Triggers tutorial debugging -
i've been keen learn triggers in android , sqlite. found great tutorial at:
http://android-pro.blogspot.com/2010/10/using-sqlite-database-with-android.html
however, having imported project eclipse , tried running it, error:
android.database.sqliteexception: no such column employeename while compiling: select _id,employeename, age, deptname viewemps deptname=?
this occurs when trying view information database after selecting items foreign key. e.g. add person dept it. go view screen, select , error occurs.
the author of tutorial has tried solve issue saying increase database version doesn't seem have worked anyone. part of code causes error seems this:
db.execsql("create view "+viewemps+ " select "+employeetable+"."+colid+" _id,"+ " "+employeetable+"."+colname+","+ " "+employeetable+"."+colage+","+ " "+depttable+"."+coldeptname+""+ " "+employeetable+" join "+depttable+ " on "+employeetable+"."+coldept+" ="+depttable+"."+coldeptid );
i have tried chopping , changing bits , tried debug myself have gotten it. if has ideas appreciated. if download code website above , try see results helpful seems happening few people. if more information required let me know , try help.
edit: if wants download source have uploaded mediafire people have been having problems other mirror. grab at: http://www.mediafire.com/?2ya4jsbcuiyq3m5
try change to:
db.execsql("create view "+viewemps+ " select "+employeetable+"."+colid+" _id,"+ " "+employeetable+"."+colname+" "+colname+","+ " "+employeetable+"."+colage+" "+colage+","+ " "+depttable+"."+coldeptname+" "+coldeptname+ " "+employeetable+" join "+depttable+ " on "+employeetable+"."+coldept+" ="+depttable+"."+coldeptid );
just added
as ....
to columns in select.
Comments
Post a Comment