将值传递给Worklight SQL适配器中的IN运算符 [英] Pass values to IN operator in a Worklight SQL adapter
问题描述
我已经开始在Worklight中使用SQL适配器,但是我不明白在调用我的适配器过程时如何将值传递给IN条件。
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.
推荐答案
您需要使用适配器的XML以及实现JavaScript编辑您的问题...
此外,请确保阅读SQL适配器培训模块。
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) { ... }
你的SQL查询将使用它们,就像这样(只是作为一个例子,如何将变量传递给任何SQL查询,如果它包含IN条件并不重要):
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];
注意value1(文本)的引号和value2(数字)的引号。
Note the quotation marks for value1 (for text) and lack of for value2 (for numbers).
这篇关于将值传递给Worklight SQL适配器中的IN运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!