Re: Q: How to ident. 2 diff. fields on form w/same table.field
Posted in 1994
>From: lgrieser@crash.cts.com (Liam Grieser) >Subject: Re: Q: How to ident. 2 diff. fields on form w/same table.field >Date: Wed, 27 Apr 1994 23:56:19 GMT >X-Informix-List-Id: <news.6513> > >I am wondering what the proper method is for retrieving and displaying two >different fields that share the same table and field in a form. The >following is an example of what I mean: > >Form Specification File: >SCREEN >{ > Item:[f001] [f002 ] > >Sub Item:[f003] [f004 ] >} >end > >ATTRIBUTES >f001=parts.itemno SMALLINT; >f002=desc.itemno CHAR; >f003=parts.subitem SMALLINT; >f004=desc.itemno CHAR; > >Notice that f002 and f004 use the SAME table and field. The values that >would be given for each field would most likely be quite different. I would >think that the above example would lead to problems identifying >which field you wanted to display data to when the program was run. > >Any ideas? By the way, I'm using another field to differentiate between >the two different (desc.)itemno's. The two fields do not represent (not >even closely) anything in common, so I believe identifying them both as >f002 would most definitely be incorrect. I4GL or ISQL? I assume I4GL since you've added type info, but the type info isn't in a legal format. I4GL: use screen records or formonly fields or aliases. f002 = formonly.itemno1 TYPE CHAR; f004 = formonly.itemno2 TYPE CHAR; or: f002 = formonly.itemno TYPE CHAR; f004 = desc.itemno; or: -- I haven't consciously tested this notation for years... f002 = formonly.itemno TYPE LIKE desc.itemno; f004 = desc.itemno; ISQL: try using table aliases (I haven't tested this): TABLES desc01 = desc desc02 = desc f002 = desc01.itemno; f004 = desc02.itemno; Alternatively, use LOOKUP attributes; f001=parts.itemno, LOOKUP f002=desc.itemno JOINING *desc.joincolumn; f003=parts.subitem, LOOKUP f004=desc.itemno JOINING *desc.joincolumn; Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> PS: Please be precise when asking questions. And include version numbers of the products -- it's often relevant. And identify SE or OnLine too. It helps those of us who answer to answer more succinctly.