java - Failed to Execute Simple "Select" Query using SQLITE in Android? -
here select query.every time getting error :
select mf.id, mf.field_type_id, mf.field_label, mf.field_values mf_values, mf.is_required, sfv.field_value sfv_value menu_fields mf left outer join site_field_values sfv on mf.id=sfv.menu_fields_id , sfv.proposal_id=100000 mf.menu_id=2;
here logcat:
02-06 22:36:05.010: e/sqlitelog(27524): (1) near "mf": syntax error 02-06 22:36:05.015: d/androidruntime(27524): shutting down vm 02-06 22:36:05.015: w/dalvikvm(27524): threadid=1: thread exiting uncaught exception (group=0x41bdf2a0) 02-06 22:36:05.030: e/androidruntime(27524): fatal exception: main 02-06 22:36:05.030: e/androidruntime(27524): android.database.sqlite.sqliteexception: near "mf": syntax error (code 1): , while compiling: select mf.id,mf.field_type_id,mf.field_label,mf.field_values mf_values mf.is_required, sfv.field_value sfv_value menu_fields mf left outer join site_field_values sfv on mf.id=sfv.menu_fields_id , sfv.proposal_id=100000 mf.menu_id=2 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqliteconnection.nativepreparestatement(native method) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqliteconnection.acquirepreparedstatement(sqliteconnection.java:1012) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqliteconnection.prepare(sqliteconnection.java:623) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqlitesession.prepare(sqlitesession.java:588) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqliteprogram.<init>(sqliteprogram.java:58) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqlitequery.<init>(sqlitequery.java:37) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqlitedirectcursordriver.query(sqlitedirectcursordriver.java:44) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqlitedatabase.rawquerywithfactory(sqlitedatabase.java:1314) 02-06 22:36:05.030: e/androidruntime(27524): @ android.database.sqlite.sqlitedatabase.rawquery(sqlitedatabase.java:1253) 02-06 22:36:05.030: e/androidruntime(27524): @ com.mrfs.android.surveyapp.db.sitecrud.getallsite(sitecrud.java:71) 02-06 22:36:05.030: e/androidruntime(27524): @ com.mrfs.android.surveyapp.activities.fragments.sitefragmentactivity.oncreateview(sitefragmentactivity.java:51) 02-06 22:36:05.030: e/androidruntime(27524): @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:871) 02-06 22:36:05.030: e/androidruntime(27524): @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1083) 02-06 22:36:05.030: e/androidruntime(27524): @ android.support.v4.app.backstackrecord.run(backstackrecord.java:635) 02-06 22:36:05.030: e/androidruntime(27524): @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1431) 02-06 22:36:05.030: e/androidruntime(27524): @ android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:420) 02-06 22:36:05.030: e/androidruntime(27524): @ android.os.handler.handlecallback(handler.java:615) 02-06 22:36:05.030: e/androidruntime(27524): @ android.os.handler.dispatchmessage(handler.java:92) 02-06 22:36:05.030: e/androidruntime(27524): @ android.os.looper.loop(looper.java:137) 02-06 22:36:05.030: e/androidruntime(27524): @ android.app.activitythread.main(activitythread.java:4898) 02-06 22:36:05.030: e/androidruntime(27524): @ java.lang.reflect.method.invokenative(native method) 02-06 22:36:05.030: e/androidruntime(27524): @ java.lang.reflect.method.invoke(method.java:511) 02-06 22:36:05.030: e/androidruntime(27524): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1006) 02-06 22:36:05.030: e/androidruntime(27524): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:773) 02-06 22:36:05.030: e/androidruntime(27524): @ dalvik.system.nativestart.main(native method)
you're missing comma between these 2 columns in select clause
mf_values mf.is_required
Comments
Post a Comment