I'm trying to pass an array parameter to the function executeSql of SQLiteObject in Ionic to make it a value for my SQL query.
For example
var sqlQuery: string = "SELECT * FROM Property WHERE ID IN (?) AND Status = ?"
var ids: number[] = [123, 321, 456];
and I'm trying to pass it here,
var db: SQLiteObject
db.executeSql(sqlQuery, [ids, 0])
So basically I want to insert all the values of ids to the IN operator and 0 for Status. But I think the SQL interprets it differently.
I tried to pass it as a string db.executeSql(sqlQuery, [ids.toString(), 0]) to remove the unnecessary characters and such. But still, it doesn't return anything.
NOTE I know I need it to enclose to a promise or something, but I just sliced it and summarise it to remove the unnecessary codes. Thanks.