I have started to work with SQL adapters in Worklight, but I do not understand how can I pass values to an IN condition when invoking my adapter procedure.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You will need to edit your question with your adapter's XML as well as implementation JavaScript... Also, make sure to read the SQL adapters training module.
What you need to do is have your function get the values:
function myFunction (value1, value2) { ... }
And your SQL query will use them, like so (just as an example how to pass variables to any SQL query, doesn't matter if it contains an IN condition or not):
SELECT * FROM person where name='$[value1]' or id=$[value2];
Note the quotation marks for value1 (for text) and lack of for value2 (for numbers).