George - it's not so much the with - I think it's more the "=". It's a case
of it doing precisely what you ask as opposed to what you are thinking you
are doing. The "=" is creates "selection criteria" otherwise it considers
whatever follows as a record ID and ignores the outstanding select list.

Bill - don't forget the REQUIRE.SELECT keyword in UniData. It tests the
select list for you.

You can even combine them and get consistent (albeit even more confusing)
results.

Eg:
SELECT FILENAME # "EXISTING_ID"
54 records selected to list 0.
>SELECT FILENAME "EXISTING_ID"
1 records selected to list 0.
>CLEARSELECT
SELECT FILENAME # "EXISTING_ID" 
54 records selected to list 0.
>SELECT FILENAME = "EXISTING_ID"
No data retrieved from current (S)SELECT statement.
SELECT FILENAME # "EXISTING_ID"
54 records selected to list 0.
>select FILENAME "EXISTING_ID" REQUIRE.SELECT
1 records selected to list 0.
>CLEARSELECT
select FILENAME "EXISTING_ID" REQUIRE.SELECT
No active select list. Processing terminated.

Hth
Colin Alfke
Calgary, Canada

-----Original Message-----
From: Bill Haskett

I'm not sure about that.  This, I believe, has always been the case.  
I've always had problems worrying about whether the 1st select returned 
anything; that's why I always do a SYSTEM(11) test after the initial 
select, and rarely use the trick of loading TCL commands into an array 
to execute all at once (unless I know for sure this condition won't occur).

UD v7.2.7 responds as I've always expected:

5 Dev (0)-> BPTEST CMD = \SELECT SOMEFILE WITH INVNO = "1234567"\ ; 
CMD<-1> = \SELECT SOMEFILE "3
71*1"\ ; EXECUTE CMD ; END

Compiling Unibasic: SAVEDLISTS\BpTest_334914081 in mode 'p'.
compilation finished

No data retrieved from current (S)SELECT statement.

1 records selected to list 0.

...which treats the 2nd execute as its own if the 1st execute returns no 
data from its select.

HTH,

Bill

>>>
>>> On 7/7/2011 11:02 AM, George Gallen wrote:
>>>> UV on Unix - Version 10.0.1
>>>>
>>>> If you do:
>>>> SELECT FILENAME WITH FIELD = SOMETHING
>>>> And you want to know if ITEM 1234 is in that list
>>>> SELECT FILENAME 1234
>>>> Will always return a hit (unless it doesn't exist in the FILE) and
>>>> ignores the active list
>>>>
>>>> whereas
>>>>
>>>> SELECT FILENAME WITH FIELD = SOMETHING
>>>> SELECT FIELNAME WITH @ID = 1234
>>>> Will return a zero if it's not in the active list
>>>>
>>>> So....if you don't specify a "WITH" qualifier, it will ignore any
>>>> active list and treat it
>>>>      as if it's a new SELECTion
>>>>
>>>> moral of the story, don't get used to omitting the WITH @ID when doing
selects
>>>> otherwise, it will bite you if your working with an active list.
>>>>
>>>>
>>>>
>>>> George Gallen


_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to