Re: Query By Example in 4GL
Posted in 1992
Andy Watson asks: > >When one uses the CONSTRUCT command in 4GL it blanks the listed screen >fields before allowing user input. Does anyone know of a means of >avoiding this, or alternative ways of achieving the functionality below. > >a) To allow the user to edit his previously entered criteria (e.g. his >first search returns far less than he expected) > >b) Use a QBE on two fields to search Table 1. Only if that fails search >using the same values on table 2. One way I've thought of is to replace >the Table 1 column names in the return field of the original CONSTRUCT. > >Informix 4GL V1.1 by the way, but V4.0 manuals don't look any different > >Thanks in Advance > Andy, You can of course upgrade to 4.1, but not all of us have nice budgets lying around. The work-around that we use in 4.0 and earlier versions is to use an INPUT statement instead of CONSTRUCT. If you use the WITHOUT DEFAULTS attribute, the INPUT will not clear the form, and you have full control of user entry with BEFORE and AFTER field constructs. All you have to do is take the users entry and bulid your own WHERE clause. The examples of what a normal WHERE clause built with CONSTRUCT looks like are in the book. Since you built the WHERE clause, you can control the FIELD names in it for problem (B) above. Cheers ----------------------------------------------------------------------------- Bob Kane Internet: bob@worms-emh2.army.mil (IP 134.235.9.2) TechDyn Systems Voice: (049) 6241-487306 (WORMS, GERMANY) CMR 421, BOX 706 Fax: (049) 6241-49560 APO AE 09056 CIS: 71054,2661