I'm trying to filter a database content to display item that match with a particular text string.
My database contain 1 table (StationsList) and 4 fields (F1, F2,F3,F4)
I'm trying to set a search field with a script that display in a datagrid the result of the search/filtering
Search field code :
Code: Select all
on keyDown theKey
put theKey after fld "ftext"
put fld "ftext" into rval
put "StationsList" into tTableName
-- Start of the QUERY building
put "SELECT * FROM " & tTableName & " LIKE "& "'%" &rval& "%'" into tSQL
put textdecode (revDataFromQuery(tab, cr, dbID, tSQL),"UTF8") into triData
set the DGtext of group "StationsListe2" to triData
end keyDown
revdberr,Database Error: SQL error or missing database
Query: SELECT * FROM StationsList LIKE '%mom
(where '%mom' is the 'rval' variable conbinated with '%' but without the last '% ?)
I'm a beginner in SQlite, I've tried a lot of variations of syntax and some googled formulas, without result.
Did you get a hint to manage with with ?