George:
How about something like:
3 Dev (0)-> LSELECT ?
This will create a list of {FileName} keys for records whose
field definition value appears in a defined list.
Syntax:
LSELECT File_Name WITH Dict_Name IN LIST1 TO LIST2 [VERBOSE| -V]
Example: SELECT CUSTOMERS SAMPLE 500
SAVE.LIST MY.LIST
LSELECT SALES.ORDERS WITH CUST.NBR IN MY.LIST TO MY.LIST.2
Notes:
If a destination list is not supplied then keys will be left as the active
select list. If a source list is not supplied then the current active
select
list will be used. Lists may be specified as select buffers (0-8) or as
named
lists from SAVEDLISTS.
An example of this is as follows:
3 Dev (0)-> SELECT MASTER "260""605"
2 records selected to list 0.
3 Dev (0)-> SAVE-LIST MY.LIST
2 key(s) saved to 1 record(s).
3 Dev (0)-> LSELECT ARTMASTER WITH CLIENTNO IN MY.LIST VERBOSE
(Parsed Command)
LSELECT ARTMASTER WITH CLIENTNO IN MY.LIST TO 0
(Selected List)
List Source MY.LIST found 2 items.
(Create Temp File)
LSELECT0031 file created with MOD = 5
(Loaded List to Temp File) - 2 items.
977 key(s) saved to 1 record(s).
(Selected Result List)
UDT.COMMAND = select ARTMASTER WITH EVAL
"TRANS('LSELECT0031',CLIENTNO,'@ID','X')" GT "" TO 0
UDT.RESPONSE = ?977 records selected to list 0.??
Destination 0
Named List 0
(Delete Temp File)
LSELECT0031 file deleted...
3 Dev (0)>>
This now has a list of (/*ARTMASTER*/) records that contain a client# in
the original select list, MY.LIST.
HTH,
Bill
Untitled Page
------------------------------------------------------------------------
----- Original Message -----
*From:* ggal...@wyanokegroup.com
*To:* U2 Users List <u2-users@listserver.u2ug.org>
*Date:* 10/17/2012 7:32 AM
*Subject:* Re: [U2] Selection Suggestions for using UV instead of SQL
Yea, MERGE.LIST does work, but sometimes I have issues with it using it in an
EXECUTE from BASIC.
George
Actually, you could leave off the TO 3, and the FROM 3 and it would still work.
The only disadvantage, is MERGE.LIST ALWAYS does a distinct, and you can't use
it to merge on
More than one field, whereas in a JOIN you can.
George
-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Israel, John R.
Sent: Wednesday, October 17, 2012 10:29 AM
To: 'U2 Users List'
Subject: Re: [U2] Selection Suggestions for using UV instead of SQL
This gets a little trickier, but how about:
1) SELECT PEOPLE TO 1.
2) SELECT REGISTRATION WITH EID = '1' SAVING UNIQUE PID.
3) SELECT PEOPLE TO 2.
4) MERGE.LIST 1 DIFF 2 TO 3.
5) SAVE.LIST XXX FROM 3.
This does assume that steps 1 and 2 actually return at least 1 key.
MERGE.LIST is an amazingly powerful command. It only works with the native
UniData (UniVerse?) syntax as do the specific list #s, but it is easy enough to
use the lower case verbs to force the individual commands to run in native mode.
John
-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Wednesday, October 17, 2012 10:20 AM
To: U2 Users List
Subject: Re: [U2] Selection Suggestions for using UV instead of SQL
That was my first try, but the NSELECT only checks PEOPLE for those that are in
the list returned by the first That are not in PEOPLE, it doesn't check for
those in PEOPLE that are not in the list returned.
George
-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Israel, John R.
Sent: Wednesday, October 17, 2012 10:05 AM
To: 'U2 Users List'
Subject: Re: [U2] Selection Suggestions for using UV instead of SQL
Do it in more than one command?
SELECT REGISTRATION WITH EID = '1' SAVING UNIQUE PID NSELECT PEOPLE
Or am I missing something?
John
-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Wednesday, October 17, 2012 9:59 AM
To: U2 Users
Subject: [U2] Selection Suggestions for using UV instead of SQL
Ok.
I have file1 - "people" that has @ID of PID I have file2 - "registration" that
has @ID of PID+EID+RID (EID = event id, RID = registration id)
I want to select people who are not in the registration file with an EID of "1".
With an SQL statement - I could join the two, then do the select or use a
subquery (I'm on UV 10.0.2 - not sure if sub querys work) Just curious how this
could be done with UV Native, and without involving a program.
I first tried "SELECT REGISTRATION WITH EID = '1' SAVING UNIQUE PID" -> "NSELECT
PEOPLE"
But that returned 0 - since the NSELECT only works off the current select list,
not the whole file
Yes, I could create a temporary file, then select off that Yes, I could read
each people record, then loop through registration to see if it doesn't exist.
Both of the above require programming
I guess I could create a subroutine that does the looping through registration,
and put that into an I descriptor - looking for another option.
George
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users