Can you do a QBE on formonly field
Posted in 1994
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
Is it possible to perform a query by example on a formonly field? I would really appreciate any help/suggestions that you could give me. My problem is that i have a form with a virtually identical top and bottom half (the same fields are used on both the top and bottom of the form). Because each form's fields must have unique identifiers, the duplicate fields must be identified as formonly fields. Because a query by example is CONSTRUCTed using valid table.fieldnames, a formonly field cannnot be used (this is what Informix tech. support has told me). I just cannot believe this to be true. The CONSTRUCT statement uses the following syntax: CONSTRUCT variable ON column-list FROM field-list variable is the program variable used column-list is the list of 1 or more database column names field list is the screen variables used Example: CONSTRUCT query ON col1,col1 FROM var1, formonly.var2 Is it possible to identify the formonly field within the 4gl program? Anyway, I still have one more concern. Though the fields shown in the above construct example (var1,var2) are the same field, they might not hold the same data. The data is dependant on another field in the same table called TYPE. If we are looking at var 1, it will hold data that represents a type of 1. Var2 will hold data representing type 2. This is easily demonstrated by viewing the examples of the tables used and the form specification file below. Tables Field Type sign lesson_no integer KEY sign_type char KEY <- determines if supervisor or planner update_date date approved char login char rmrks lesson_no integer KEY remark_type char KEY <- determines if supervisor or planner remarks text(Blob) Form Specification File DATABASE lessons SCREEN { Lesson number:[f001 ] Supervisor approval (Y,N):[g] Updated by:[f002 ] Date:[f003 ] Comments: [f004 ] [f004 ] [f004 ] Planner Information Updated by:[f005 ] Approval (Y,N):[h] Date:[f006 ] Comments: [f007 ] [f007 ] [f007 ] ... } end TABLES sign, rmrks ATTRIBUTES f001=sign.lesson_no TYPE integer; g =sign.approved TYPE char, INCLUDE=("Y","N"); f002=sign.login TYPE char; f003=sign.update_date TYPE date; f004=rmrks.remarks TYPE TEXT, PROGRAM="pico"; f005=formonly.login TYPE LIKE sign.login; h =formonly.approved TYPE LIKE sign.approved; f006=formonly.update_date TYPE LIKE sign.update_date; f007=formonly.remarks TYPE LIKE rmrks.remarks, PROGRAM="pico"; INSTRUCTIONS DELIMITERS = " " As you can see, many fields are being used on the form twice. The tables show that the sign_type and remark_type fields are used to determine which data is displayed/edited/queried in the form. Again, any help will be most appreciated! Many thanks in advance, Liam Grieser lgrieser@cts.com