Re: converting an sql query into an array
Posted: Fri Mar 20, 2020 3:08 pm
Hi Paul,
probably wrong use of the IN operator, IN exspects a comma separated list!
Try this (and please use the CODE tags after pasting your script here):
I always refresh my poor knowledge of SQL here when it comes to working with databases:
https://www.w3schools.com/sql/default.asp
Best
Klaus
probably wrong use of the IN operator, IN exspects a comma separated list!
Try this (and please use the CODE tags after pasting your script here):
Code: Select all
command select_push_keys_for_selected_group_members
put tune_group_id & "_members" into table_name
## !!!
put "nancy,ben" into selected_group_members
## !!!
put "SELECT push_device_key FROM " & table_name & " WHERE member_name IN (:1)" into tSQL
put revDataFromQuery(tab, cr, tDatabaseID_tuune, tSQL, "selected_group_members") into push_keys_for_seleceted_members
if item 1 of other_members = "revdberr" then
answer error "There was a problem querying the database:" & cr & push_keys_for_seleceted_members
else
put "search was successful" && push_keys_for_seleceted_members
end if
end select_push_keys_for_selected_group_members
https://www.w3schools.com/sql/default.asp
Best
Klaus