I'm with Ian.
Maybe Ian and I don't understand the question. The other answers seem so complicated.

Brandon, Replace Ian's example "Y.PACKET.ID" with whatever is thereal name in DICT X.INFO pointing to what you describa ase Y.INFO's key exists as a "foreign key" somewhere in X.INFO.

Give Ian's code a try and see if it gives you what you want.
You don't even need to do the SAVE.LIST & GET.LIST. That's just so you can have the list for later use or examination.

Chuck


On 8/28/2013 1:32 AM, McGowan, Ian wrote:
At least on Unidata you can put the foreign key in the select statement, and 
that's the id that will be used:

#SELECT X WITH STATUS = "ccc" Y.PACKET.ID
#SAVE.LIST L1
#GET.LIST L1
#LIST Y

If you put two atb names in the select, they are interleaved in the resulting 
saved list, which can be a quick way to export some data...

-----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

Reply via email to