Android Question [SOLVED] SQLExample Help

Uederson Ferreira

Member
Licensed User
Hi!
How are you all?
I'm trying to use some of the codes from the sqlexample from the UserGuide.
I don't want to show rows ids, then I changed the first column to show date (ColumnName(0) = "data").
When I select some row and hit the Edit button I'm getting an error:
"android.database.sqlite.SQLiteException: near "10": syntax error (code 1): , while compiling: SELECT * FROM registros WHERE data = 08/08/2017 10:23:43"

If I use table ID, it works fine.
Can someone pls point me what I need to do to use date instead of ID?

Another thing: Is there some document showing how works the table from the SQLExample? It would be great for me because I am very new to B4A. That table is amazing!

Thank you so much, dear friends!
 

klaus

Expert
Licensed User
Longtime User
What type is the date colum?
If it is a TEXT column you must put the date between simpe quotes.
SELECT * FROM registros WHERE data = '08/08/2017 10:23:43'

There is no documentation about the table in the SQLExample.
The table is based on a ScrollView2D object.
Each row contains a Label for each column, these are generated in the AddRow routine.
The first line in the table contains the colum headers which are set with the SetHeader routine.
 
Upvote 0

Uederson Ferreira

Member
Licensed User
Thank you so much by the reply, Klaus!
Yes, it is a Text column.
I am using date as an string and I thought I could use it the way it is. :)
I will study the code with a little more attention to learn how it works!

Cheers!

Uederson
 
Upvote 0
Top