Date:         Wed, 15 Feb 1995 15:16:43 EST
Reply-To:     The NOMAD2 Discussion List
Sender:       The NOMAD2 Discussion List
From:         Ken Lignelli
Subject:      Re: How to select multiple-key master using arrays?

> The question is simple:

 No, not really....  ;)

> I have those key values in arrays. How can I
> select records with these key values?

 Unfortunately, it is a lengthy process.  You must dynamically build
your selection criteria using TRANS and Symbolic substitution.
Here is an example:

 &myselect=' ';
  FOR &i=1 to cnt(&x_key1) DO;
     If &i=1 then &myselect =  '(Key1=' cat &x_key(1) catb
        ' and Key2=' cat &x_key2(1) catb ')';
     Else &myselect=&myselect catb ' or (Key1=' cat &x_key(&i) catb
        ' and Key2=' cat &x_key2(&i) catb ')';
 END;
  TRANS;
  SELECT ?(&myselect);
  UNTRANS;
--------------------------
This will end up looking to NOMAD like:

  Select (key1=1 and key2=1)
        or (key1=2 and key2=2)
        or ..... etc. .... ;
back to index