Hope this helps.  Paste it into a results action.  Let me know if the code
has been corrupted in transit.



<@ASSIGN request$reportArray <@ARRAY
VALUE="1,10,12;2,14,10;3,11,9;4,12,11;5,100,0">>

<@ASSIGN request$toArray <@ARRAY VALUE="12,Boston;10,Dallas;9,New
Orleans;11,Los Angeles;">>

<@ASSIGN request$fromArray <@ARRAY VALUE="10,Toronto;14,Karachi;11,Kim
Chasa;12,Bangkok;">>

reportArray: <br>
<@VAR request$reportArray> <br>

fromArray: <br>
<@VAR request$fromArray> <br>


toArray: <br>
<@VAR request$toArray> <br>

<hr>

<table border="1">
<tr>
<th>ID</th>
<th>From ID</th>
<th>From</th>
<th>To ID</th>
<th>To</th>
</tr>

<@ROWS ARRAY=request$reportArray>
<tr>
<td><@COL 1></td>
<td><@COL 2></td>

<td>
<@ASSIGN request$tmp <@FILTER ARRAY=request$fromArray EXPR="#1='<@COL 2>'">>
<@IF EXPR="<@NUMROWS ARRAY=request$tmp> = 1">
<@VAR request$tmp[1,2]>
<@ELSE>
[Problem!]
</@IF>
</td>

<td><@COL 3></td>

<td>
<@ASSIGN request$tmp <@FILTER ARRAY=request$toArray EXPR="#1='<@COL 3>'">>
<@IF EXPR="<@NUMROWS ARRAY=request$tmp> = 1">
<@VAR request$tmp[1,2]>
<@ELSE>
[Problem!]
</@IF>
</td>

</tr>
</@ROWS>
</table>


-----Original Message-----
From: Wolf, Gene [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 05, 2007 11:45 AM
To: [email protected]
Subject: RE: Witango-Talk: Question of joins


   I knew this wasn't going to be clear the first time. *laughs*

   Assume a record with the following fields and data:

  Field names:        RecID    FromLoc    ToLoc
                                1            10            12
                                2            14            10
                                3            11             9
                                4            12            11


Now, the from and to locations are simply keys to another table containing
the description. My question is, what is the easiest way to display the text
value of the from and to location values other than iterating through an
array and looking up each individual value?




From: Jesse Parker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 05, 2007 11:32 AM
To: [email protected]
Subject: RE: Witango-Talk: Question of joins


I'm not sure I'm following you.  I think you have a file that contains an
"array" of values, and you want to do a join-like operation with your DB for
reporting purposes.

If this is the case, you can probably use <@FILTER> to get only the relevant
records from each array.  If you post more detail, I will try to give you
the filter expression.

I think you might be happier in the long run if you put your list of values
in the DB, instead of using the file to store these values - that way you
can use a simple join, and it's likely to be much faster than any file-based
operations.

-----Original Message-----
From: Wolf, Gene [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 05, 2007 11:00 AM
To: [email protected]
Subject: Witango-Talk: Question of joins


   This is probably simplistic and perhaps more of a SQL question than a
Witango question but I'm going to ask anyway. *laughs* I have an application
set up where a user selects a from location and a to location, from a
dropdown list, of something they are shipping. The dropdown list is
populated from a file and the resulting from and to location codes are
recorded to a database record in separate fields named shipfrom and shipto.
No problem so far. Everything works perfectly.
   Now, in reporting I want to show the description of the ship from and
ship to locations. I can read the records into an array and look up each
location from the database and then display the array when done but that
seems inefficient, especially when I have to use a for loop to process the
array. Is there some way to join two different fields on the same lookup
table, in a Witango search action, in order to pull different text values
for each of the fields?
Gene Wolf
Supervisor, Business Systems
DRS Sensors & Targeting Systems-Optronics
2330 Commerce Park Drive NE
Palm Bay, Florida 32905
Phone: 321-309-0685
           321-309-0202 (fax)
Dictionary.com Word of the Day
http://dictionary.reference.com/wordoftheday/
This e-mail, including any attached files, may contain confidential and
privileged information for the sole use of the intended recipient. Any
review, use, distribution, or disclosure by others is strictly prohibited.
If you are not the intended recipient (or authorized to receive information
for the intended recipient), please contact the sender by reply e-mail and
delete all copies of this message.
"This (document/presentation) may contain technical data as defined in the
International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of
this material is restricted by the Arms Export Control Act (22 U.S.C. 2751
et seq.) and may not be exported to foreign persons without prior written
approval from the U.S. Department of State."
________________________________________________________________________
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

Reply via email to