Tony:

I use a simple program, inspired by a U2 tech note at <https://u2devzone.rocketsoftware.com/accelerate/articles/u2-select>, that does the following:

LSELECT ARTVIOLATION WITH UNITID IN DEFAULT.LIST.NAME

The list is simply generated then used in the statement. So, I can create a select list of unit#s from anywhere and name it "DEFAULT.LIST.NAME". Then can search the ARTVIOLATION file items whose unit ID is anywhere in the select list.

[...added comments...]
This becomes required when one does something like:

SELECT SOMEFILE 'a''b''c'...'{n}'

...and the number of items to select exceed 256 (UD barfs on this). Now, I just change the code to do a select first, like:

SELECT SOMEFILE 'a''b''c'...'{n}'
SAVE.LIST MY.LIST
LSELECT ANOTHERFILE WITH KEY IN MY.LIST

This turned out to be a simple solution when web'izing our application, knowing users will be selecting keys (not values) to submit to a select statement that does something (lots of things, actually). :-)

Bill
Untitled Page


------------------------------------------------------------------------
----- Original Message -----
*From:* 3xk547...@sneakemail.com
*To:* u2-users@listserver.u2ug.org
*Date:* 8/28/2013 5:18 AM
*Subject:* Re: [U2] Select from one file with save-list from another file
Not sure where to toss this into this thread so I'll start at the
beginning. I wanted to see the solutions that would be offered. I
blogged on exactly this topic back in 2008. The solution I published
for D3 uses @environment variables to allow us to do inner queries
with a tiny bit of simple and reusable code, no dict items, no work
files, and no save-lists. Perhaps someone can describe the
UD/UV-specific equivalents so that we can accomplish this here using
similar methods? I'll be happy to add the U2 solution to the blog for
future reference.
http://Nebula-RnD.com/blog/tech/mv/2008/03/d3shell1.html



Tony Gravagno   
Nebula Research and Development         
TG@ remove.pleaseNebula-RnD.com         
http://Nebula-RnD.com/blog      
http://LinkedIn.com/in/TonyGravagno     
http://Twitter.com/TonyGravagno         
http://PickWiki.com     
http://groups.google.com/group/MVDBMS           
http://www.LinkedIn.com/groups/Pick-Users-Group-64935   
http://BitBucket.org/FOSS4MV/


From: Hilk, Brandon
UniVerse 10.1, HP/UX, Pick.
Is there a way I can build a save-list from a selection from onefile
X.INFO (where the record ID is an 8 digit number) and use that listto
select from file Y.INFO (where that 8 digit number is not the recordID
but does exist as a "foreign key" elsewhere in the file). In SQLthis
would be considered a join and would look something like this:

select *
from X.INFO, Y.INFO
where X.INFO.packet.id=Y.INFO.packet.id
and X.INFO.status='ccc';

I can run this in TCL and have it return the results I want butcan't build
a save-list from it because I don't know the UniVerse/SQL syntax todoso.
So to summarize, is there a way to use a save-list built from X.INFOto
make another save-list comprised of the record ID's from Y.INFO?


_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to