B b4auser1 Well-Known Member Licensed User Longtime User Jan 26, 2014 #1 How to get info about types of columns in Cursor (SQL Library) ?
Erel B4X founder Staff member Licensed User Longtime User Jan 26, 2014 #2 See this example: Android SQLite Viewer Upvote 0
B b4auser1 Well-Known Member Licensed User Longtime User Jan 26, 2014 #3 Erel, Thank you for hint, but I didn't find in the example, what I am looking for You used "PRAGMA table_info" to get info about columns in a table, not in Cursor, which can be built as SQL QUERY from several tables and with SUM(), Group By and etc. Upvote 0
Erel, Thank you for hint, but I didn't find in the example, what I am looking for You used "PRAGMA table_info" to get info about columns in a table, not in Cursor, which can be built as SQL QUERY from several tables and with SUM(), Group By and etc.
DonManfred Expert Licensed User Longtime User Jan 26, 2014 #4 Then you have to send out more than one pragma if you want to know more about the types. I think that´s so in any sql-language... Upvote 0
Then you have to send out more than one pragma if you want to know more about the types. I think that´s so in any sql-language...
Erel B4X founder Staff member Licensed User Longtime User Jan 26, 2014 #5 If you are targeting Android 3+ then you can call the following method with JavaObject: http://developer.android.com/reference/android/database/AbstractWindowedCursor.html#getType(int) Upvote 0
If you are targeting Android 3+ then you can call the following method with JavaObject: http://developer.android.com/reference/android/database/AbstractWindowedCursor.html#getType(int)
fbritop Active Member Licensed User Longtime User May 10, 2017 #6 Which class should I use for getType? I'm trying: B4X: Dim jo As JavaObject jo.InitializeStatic("android.database.AbstractWindowedCursor") Log(jo.RunMethod("getType", Array(cursor,index))) Where index is the column index, but it states an error: java.lang.RuntimeException: Method: getType not matched. Upvote 0
Which class should I use for getType? I'm trying: B4X: Dim jo As JavaObject jo.InitializeStatic("android.database.AbstractWindowedCursor") Log(jo.RunMethod("getType", Array(cursor,index))) Where index is the column index, but it states an error: java.lang.RuntimeException: Method: getType not matched.
DonManfred Expert Licensed User Longtime User May 10, 2017 #7 You should always create a new threasd for your questions! more important if the Thread is old (like this one)! Based on https://developer.android.com/reference/android/database/AbstractWindowedCursor.html#getType(int) getType does expect ONE Parameter. the Index of the Column. You are giving two parameters. The error is not: getType not found. The error is: Method: getType not matched. Upvote 0
You should always create a new threasd for your questions! more important if the Thread is old (like this one)! Based on https://developer.android.com/reference/android/database/AbstractWindowedCursor.html#getType(int) getType does expect ONE Parameter. the Index of the Column. You are giving two parameters. The error is not: getType not found. The error is: Method: getType not matched.
fbritop Active Member Licensed User Longtime User May 10, 2017 #8 Just answer myself.... B4X: Dim r As Reflector r.Target=cursor Log(r.RunMethod2("getType", index, "java.lang.int")) Upvote 0
Just answer myself.... B4X: Dim r As Reflector r.Target=cursor Log(r.RunMethod2("getType", index, "java.lang.int"))