I found an old example on line that might get you started

SELECT TO SLIST 0 FROM CUSTOMERS WHERE STATE = 'AZ';
SAVE.LIST CUSTOMER.LIST

SELECT * FROM ORDERS WHERE CUSTOMER.ID IN (SELECT EVAL " <at> RECORD" FROM
&SAVEDLISTS& 'CUSTOMER.LIST');

The extra syntax that might help is

SELECT TO SLIST <savedlist #> FROM ORDERS ....

If CUSTOMER.LIST is your X.INFO and ORDERS is your Y.INFO...

Rick

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Hilk, Brandon
Sent: Tuesday, August 27, 2013 1:24 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Select from one file with save-list from another file

Hello! 

 

UniVerse 10.1, HP/UX, Pick.

 

Is there a way I can build a save-list from a selection from one file
X.INFO (where the record ID is an 8 digit number) and use that list to
select from file Y.INFO (where that 8 digit number is not the record ID
but does exist as a "foreign key" elsewhere in the file). In SQL this
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 but can't
build a save-list from it because I don't know the UniVerse/SQL syntax
to do so.

 

So to summarize, is there a way to use a save-list built from X.INFO to
make another save-list comprised of the record ID's from Y.INFO?

 

Thanks for any advice you can give.

 

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

Reply via email to