Re: Exclusion list in a query-by-example
Posted in 1997
This is a multi-part message in MIME format. --------------3D8D6B675D79 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jacob Salomon wrote: > > For the purpose of this question, I am assuming forms with the > instruction: > DELIMITERS "<>" > > A colleague asked me a kicker of a question today: > > When the user is entering a query (in either 4GL or ISQL) it is easy to > put matching paterns between the brackets. For example, if I (the user) > would query for all states beginning with "M" or "N", I would enter tyhe > following between the delimiters on the screen: > <[MN]*> > > A lesser known factoid: If I want all states that do NOT begin with M or > N, the match pattern looks like: > <[^MN]*> > > If I wish to match all states in the list {NY NJ MN} I would enter: > <NY|NJ|MN> > > OK, so much for the preliminaries. Now I want query on all states NOT > in that list. i.e. the constructed WHERE clause of the query would be: > WHERE state NOT in ("NY", "NJ", "MN"). I believe what I am looking for > is called an EXCLUSION LIST > > Is there any way for a user to enter exclusion list/pattern on the query > form? > > I have thought of an indirect method: Let the user press a function key > to pop up a window with a screen arrat and type in a list of exclusions > in that window. However, that method is inappropriate to the targeted > user. No, there is no meta-sequence for this. However, as I always say, you can do anything in 4GL. There are several options, as you say a popup window for entering a list is one. Something slightly simpler might be to add a single char field next to the input field. The user would enter the same list as NY|NJ|MN but then has the option of checking the new field if these values are to be negated. You then need a bit of code to trundle through the generated where clause string and insert the relevant NOT keyword. Hope that helps, -- --------------3D8D6B675D79 Content-Type: text/plain; charset=us-ascii; name="ATT_SIG.TXT" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ATT_SIG.TXT" Mark. +------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +-----------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work, force it! | |Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!| |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+-----------------------------------------+ --------------3D8D6B675D79--