on 10-17-2007 4:11 PM
Hi,
I have an array with multiple values stored in it. I would like to use these values in the filter expression of another query using the "IN" clause (data is coming from a sql dataabse). Is there a way to achieve this, I did not see an option in the std query template for using the "IN" expression.
Thanks.
Do a Fixed Query.
select * from xyz where abc IN('[Param.1]','[Param.2]',.....)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or, to save Params, pass in a comma separated list of match values:
select * from mytable where mycolumn in ([Param.1])
And if you are getting the comma separated list from say an iBrowser, here are two quick utilities to build a comma separated list of the iBrowser values or iBrowser Datalink values:
// returns comma separated list of DATALINK values from iBrowser.
// if none selected, returns list of all values
function getCSLDatalinkValues(myApplet) {
var selValues = "";
var selCount = myApplet.getBrowserObject().getSelectedItemCount();
if(selCount) {
for(var i=1; i<= selCount; i++) {
selValues += myApplet.getBrowserObject().getSelectedDatalinkValueAt(i) + "','";
}
} else {
for(var i=1; i<= myApplet.getBrowserObject().getItemCount(); i++) {
selValues+= myApplet.getBrowserObject().getDatalinkValueAt(i) + "','";
}
}
// remove trailing ","
selValues = selValues.substring(0,selValues.length-2);
// insert begin "'"
selValues = "'" + selValues;
return selValues;
}
// returns comma separated list of values from iBrowser.
// if none selected, returns list of all values
function getCSLValues(myApplet) {
var selValues = "";
var selCount = myApplet.getBrowserObject().getSelectedItemCount();
if(selCount) {
for(var i=1; i<= selCount; i++) {
selValues += myApplet.getBrowserObject().getSelectedItemAt(i) + ",";
}
} else {
for(var i=1; i<= myApplet.getBrowserObject().getItemCount(); i++) {
selValues += myApplet.getBrowserObject().getItemAt(i) + ",";
}
}
// remove trailing ","
selValues = selValues.substring(0,selValues.length-1);
return selValues;
}
User | Count |
---|---|
9 | |
7 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.