Sqlite fields ID

Hello.
Can anyone advise me?
I have sqlite db: id, ev1, ev2, ev3, ev4 ....
All fields are of type TEXT.
The ID is the primary key.
If I know the value of ev2 in any record, how do I find the value of id?
I am interested in the SELECT construction ...
Ondrej

Your SQL statement would look like

SELECT id FROM tablename WHERE ev2 = 'yourvalue'

Expect a column ('\n' delimited list) of id values, since you don't know how many rows have ev2 = 'yourvalue'.
You might also have to check for something like (0 rows returned) if the SELECT came up empty.

Search the web for 'SQLite syntax'

Hello. Is there any alternative to the SQLite1 SelectSQL call block, but without bindParams? I don't see it anywhere in the SQLite1 extension.
Ondrej

Hello. One more question ... sorry ... Is there a possibility in the SQLite1 extension to "read" the table sequentially from start to finish and to find out, for example, the value of an item in a sentence? An example would help a lot ... Thank you.
Ondrej

Which sqlite extension are you using ?

What are the bindParams for in your project? Possibly you mean this?

Use the
"SELECT * FROM tbl1 WHERE X contains 'Y';"
or
"SELECT * FROM tbl1 WHERE X LIKE '%Y%';"
or
"SELECT * FROM tbl1 WHERE instr(X, 'Y') > 0;"

query to find the value in a sentence

See also here:

my sqlite extension offers an Execute method which can do anything you like...

select * from myTable where myColumn LIKE '%myItem%'

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.