× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am working on a program that needs to update certain records of a
somewhat large file. Because it could potentially be run multiple times a
day I would like to limit the number of records that it processes by
creating a logical file (preferably with SQL rather than DDS). There are
two fields that need to be looked at. FIELD1 could have numerous possible
values but I'm only interested in A, B, and C. FIELD2 is a status field.
If it's blank then the record needs to be processed. If it has a value
that I assign, such as X, then it has been previously processed and can be
skipped in subsequent runs. Basically I want a logical file that does
something like:

If FIELD2 <> 'X'
If FIELD1 = 'A' or FIELD1 = 'B' or FIELD1 = 'C'
process the record
FIELD1 = 'X'
update the record
ENDIF
ENDIF

I've tried setting up a logical using select and omit but it either
includes or excludes too much. I could probably do it with an open query
file but that introduces a bit of overhead each time the program is run.
Can anybody recommend a good way to do this with SQL? Thanks.


Dave Parnin

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.