COMPARE ID VALUE

Hi, i have a question, I need compare the id value of table with a number variable, is this possible? how do it?

Hello and welcome to the Corona community forums. Since this started as a support ticket, here is what I responded there:

If you have a table like: myTable.id and id is a number you can simply do:

if myTable.id == youNumericId then     -- whatever you need to do end

Rob

Yes, I understand than but I have a sql table, I have use the option [[DELETE * FROM tabla WHERE id==value]], how do that?

Something like:

[[DELETE \* FROM tabla WHERE id=]] .. value

[[and]] are just a type of quote around the SQL query string.

… is the string concatenation operator

assuming value is a number and your SQL id field is a number, that will work. If id is a string, you would need some additional quotes like this:

[[DELETE \* FROM tabla WHERE id="]] .. value .. [["]]

Rob

Hello and welcome to the Corona community forums. Since this started as a support ticket, here is what I responded there:

If you have a table like: myTable.id and id is a number you can simply do:

if myTable.id == youNumericId then     -- whatever you need to do end

Rob

Yes, I understand than but I have a sql table, I have use the option [[DELETE * FROM tabla WHERE id==value]], how do that?

Something like:

[[DELETE \* FROM tabla WHERE id=]] .. value

[[and]] are just a type of quote around the SQL query string.

… is the string concatenation operator

assuming value is a number and your SQL id field is a number, that will work. If id is a string, you would need some additional quotes like this:

[[DELETE \* FROM tabla WHERE id="]] .. value .. [["]]

Rob