|
You should either do A) (in pseudocode) <@FOR array=checkedboxarray> <@ADDROWS myfinalarray <@FILTER
my30colarray expr=”#1 = <@COL 1>”>> </@FOR> Or B) Hit the DB again with an “where …
is in” clause The larger the dataset, the more likely
the SQL hit will be faster. Robert From: Ted Wolfley
[mailto:[EMAIL PROTECTED] What I am doing is bring back information
from a 30 column table and putting it into an array. The array is used to
create a selection form using the unique id for the checkbox value.
After the submit, I use the <@POSTARG NAME='a_userid' TYPE=ARRAY> to create an one column
array of the checked selections. What I am trying to do is to use the
selected values to bring back data from the orignial array to create a
confirmation page before I preform the next action. Since I already have
the data in an array I thought I could use it. The <@union> tag won't
work because it combines. The <@intersect> tag requires that the two
arrays have the same number of columns. May be I should just use an
another Direct DBMS action instead. Ted From: Robert
Garcia [mailto:[EMAIL PROTECTED] Looping through rows should be avoided in witango whenever another
solution is possible. Row looping is an expensive task. Try something like this, since it is a comma delimited list, you can
turn into an array and filter. You can turn into array with the <@array>
tag, or: <@assign request$temp <@transpose <@tokenizer "<@var
request$vdeletelist>" chars=",">> <@! now you have a 1 column array with you items > Then you can use <@union> to see where the arrays intersect. -- Robert Garcia President - BigHead Technology VP Application Development - eventpix.com Magalia, Ca 95954 ph: 530.645.4040 x222 fax: 530.645.4040 On May 4, 2005, at 12:01 PM, Ted Wolfley wrote:
I couldn't
get this to work, I think it is because of a comma delimited list of values and
contains uses only one value. I went with using a row loop inside
another row loop. ted From: Ben Johansen [mailto:[EMAIL PROTECTED]] Try this <@ASSIGN NAME="vconfirmlist" VALUE="<@FILTER ARRAY='varrayout' EXPR=” ‘@@request$vdeletelist’
contains #usrid>" SCOPE="request"> Might work, I did this
once but cant find code
Ben
Johansen - http://www.pcforge.com From: Ted Wolfley [mailto:[EMAIL PROTECTED]]
Hi,
I am trying to
<@filter> an array by using values already selected from the array.
The sql equivalent is "select * from array where userid in (selected
list)". Can a list of values be
used in the filter action?
<@ASSIGN NAME="vconfirmlist" VALUE="<@FILTER ARRAY='varrayout' EXPR='#usrid in (@@request$vdeletelist)'>" SCOPE="request"> @@request$vdeletelist has numeric values that
are separated by commas and #usrid is a numeric column.
Thanks. Ted Wolfley
________________________________________________________________________TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf________________________________________________________________________TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf________________________________________________________________________TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf________________________________________________________________________TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf |
- RE: Witango-Talk: filtering arrays Robert Shubert
- Re: Witango-Talk: filtering arrays Robert Garcia
- Re: Witango-Talk: filtering arrays Robert Garcia
- RE: Witango-Talk: filtering arrays QSN Janet Case
- RE: Witango-Talk: filtering arrays Ted Wolfley
- Re: Witango-Talk: filtering arrays John McGowan
- RE: Witango-Talk: filtering arrays Ted Wolfley
