Android SQL Query Notworking for retriving data from DataBase
<p>I am not able to retrieve the data from database even-though i changed some changes what ever i got suggestions then also my query not working. below is my Sql Query and Log-cat errors</p>

<p>SQL Query:--</p>

<pre><code>Cursor cur3 = db3.rawQuery("SELECT "+pretestTable+"."+columnID+","+
                " "+pretestTable+"."+DDL_Testing_Session+","+
                " "+pretestTable+"."+Text_Reason+","+
                " "+pretestTable+"."+Text_Howmany+","+
                " "+pretestTable+"."+Text_Ques1+","+
                " "+pretestTable+"."+RBL_Ques2a+","+
                " "+pretestTable+"."+RBL_Ques2b+","+
                " "+pretestTable+"."+RBL_Ques3+","+
                " "+pretestTable+"."+TXT_Ques4+","+
                " "+pretestTable+"."+RBL_Ques5+","+
                " "+pretestTable+"."+RBL_Ques6+","+
                " "+pretestTable+"."+RBL_Ques7+","+
                " "+pretestTable+"."+RBL_Ques8+","+
                " "+pretestTable+"."+RBL_Ques9+","+
                " "+pretestTable+"."+DDL_Sick+","+
                " "+pretestTable+"."+TXT_Ques11+","+
                " "+pretestTable+"."+RBL_Ques12+","+
                " "+pretestTable+"."+TXT_Ques13+","+
                " "+pretestTable+"."+TXT_Ques14+","+
                " "+pretestTable+"."+RBL_Ques15+","+
                " "+pretestTable+"."+RBL_Ques16+","+
                " "+pretestTable+"."+RBL_Ques17+","+
                " "+pretestTable+"."+TXT_Ques18+","+
                " "+pretestTable+"."+TXT_Vct+" FROM "+pretestTable+"SELECT "+fingerTable+"."+Template11+"FROM"+fingerTable+" WHERE " + pretestTable+"."+columnID+" = "+fingerTable+"."+Template11+" AND "+pretestTable+"."+"pretest_id=?" ,  null);
</code></pre>

<p>Logcat Errors:---</p>

<pre><code>10-20 23:07:34.771: ERROR/AndroidRuntime(1296): FATAL EXCEPTION: main
10-20 23:07:34.771: ERROR/AndroidRuntime(1296): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.a1technology.remoteid/com.a1technology.remoteid.Screening}: android.database.sqlite.SQLiteException: near ".": syntax error: , while compiling: SELECT tbl_pre_test.ID, tbl_pre_test.ddlTestingSession, tbl_pre_test.txtReason, tbl_pre_test.txthowmany, tbl_pre_test.txtques1, tbl_pre_test.rblques2a, tbl_pre_test.rblques2b, tbl_pre_test.rblques3, tbl_pre_test.txtques4, tbl_pre_test.rblques5, tbl_pre_test.rblques6, tbl_pre_test.rblques7, tbl_pre_test.rblques8, tbl_pre_test.rblques9, tbl_pre_test.ddlsick, tbl_pre_test.txtques11, tbl_pre_test.rblques12, tbl_pre_test.txtques13, tbl_pre_test.txtques14, tbl_pre_test.rblques15, tbl_pre_test.rblques16, tbl_pre_test.rblques17, tbl_pre_test.txtques18, tbl_pre_test.txtVCT FROM tbl_pre_testSELECT tbl_finger.templateFROMtbl_finger WHERE tbl_pre_test.ID = tbl_finger.template AND tbl_pre_test.pretest_id=?
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.os.Looper.loop(Looper.java:123)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.ActivityThread.main(ActivityThread.java:3647)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at java.lang.reflect.Method.invokeNative(Native Method)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at java.lang.reflect.Method.invoke(Method.java:507)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at dalvik.system.NativeStart.main(Native Method)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296): Caused by: android.database.sqlite.SQLiteException: near ".": syntax error: , while compiling: SELECT tbl_pre_test.ID, tbl_pre_test.ddlTestingSession, tbl_pre_test.txtReason, tbl_pre_test.txthowmany, tbl_pre_test.txtques1, tbl_pre_test.rblques2a, tbl_pre_test.rblques2b, tbl_pre_test.rblques3, tbl_pre_test.txtques4, tbl_pre_test.rblques5, tbl_pre_test.rblques6, tbl_pre_test.rblques7, tbl_pre_test.rblques8, tbl_pre_test.rblques9, tbl_pre_test.ddlsick, tbl_pre_test.txtques11, tbl_pre_test.rblques12, tbl_pre_test.txtques13, tbl_pre_test.txtques14, tbl_pre_test.rblques15, tbl_pre_test.rblques16, tbl_pre_test.rblques17, tbl_pre_test.txtques18, tbl_pre_test.txtVCT FROM tbl_pre_testSELECT tbl_finger.templateFROMtbl_finger WHERE tbl_pre_test.ID = tbl_finger.template AND tbl_pre_test.pretest_id=?
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:92)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:65)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:83)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:49)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1356)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1324)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at com.a1technology.remoteid.Screening.onCreate(Screening.java:320)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
10-20 23:07:34.771: ERROR/AndroidRuntime(1296):     ... 11 more
</code></pre>
