John,

        Does the RECORD_A field in FILE_A contain item-id's from FILE_B?
A "foreign key" into FILE_B in SQL parlance?

        I'm on UV, so sorry if this doesn't work for UD....

SELECT FILE_A WITH NOT EACH RECORD_A "AA""BB""CC" AND WITH A_IN_B

        Where the Dictionary item A_IN_B would look like this if single
valued:

     A_IN_B
0001 I
0002 TRANS("FILE_B",RECORD_A,0,"X")
0003 
0004 FILE_B key
0005 L
0006 10
0007 S

        If it's multi-valued, you'd have to write a cataloged subroutine
and make line 2 of the DICT item a SUBR call.

        This statement would then exclude any FILE_A records if they had
AA, BB, or CC in the RECORD_A field (works for both single and
multi-valued fields), and if the A_IN_B dict item found that the foreign
key in the RECORD_A field existed in FILE_B.

        Play with it and see what you get....

--Ron P.

>-----Original Message-----
>From: Aherne, John
>
>Hi all,
>       I want to do a complicated select statement in UD. 
>Basically, I have a list of items "AA", "BB", "CC". I want to do a 
>select along these
>lines:
>
>SELECT FILE_A WITH RECORD_A IN (SELECT FILE_B WITH NO @ID = "AA" "BB"
>"CC")
>
>RECORD_A is MV
>
>
>Is there a way to do this in UD?
>
>TIA,
>    John Aherne
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to