test form MYSQL is ok :
"SELECT name FROM " & DBTableName & " WHERE (left(name,1)) ='C'"
but for this is not ok on sqllite-android.
message error :
cur = SQL.ExecQuery(Query)
androir.databse.sqlite.sqlexcepion:near "(":syntax error (code1):
while compiling:.....
what is equivalence for lesft(name,1)='C'
Hi Barry:
If you use SQLite version Personal version 3.4.51 on your PC, you can use INSTR simialr to the way you had it in your code. It works. You will not get an error. Perhaps the native SQLite engine version used by Android has not caught up yet. Maybe Erel can shed some light on that.
Just a side step from the above questions .. I notice in a lot of posts re SQL statements a string variable is declared ,then then variable inserted into the actual SQL query /statement ie,
B4X:
Dim Query As String
Dim DBTableName As String
Query="SELECT name FROM " & DBTableName & " WHERE SUBSTR(name,1,1) ='C'"
cur = SQL.ExecQuery(Query)
Versus ...
B4X:
cur = SQL.ExecQuery("SELECT name FROM " & DBTableName & " WHERE SUBSTR(name,1,1) ='C'")
Is this just the more "professional' way,is there any benifit to word statements this way , or does it come down to personal choice.