Pass values to IN operator in a Worklight SQL adapter

Deadly 提交于 2019-12-12 03:45:25

问题


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).



来源:https://stackoverflow.com/questions/16012017/pass-values-to-in-operator-in-a-worklight-sql-adapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!