Construct with Array??
Posted in 2001
Question: can an INFORMIX-4GL CONSTRUCT span both a header field and a screen array field so the user can query for matching components? Answers confirm yes — you write CONSTRUCT ... ON tab1.col1, tab2.col1 FROM scr_rec.field1, scr_array.field1, omitting subscripts/brackets on the array fields; the form just needs the header field plus the array lines, with results displayed back into the array. A suggested extra — letting users fill several array lines to build OR conditions (Paradox-style QBE) — was tried by one poster but judged not implementable in 4GL, and others noted users rarely grasp OR queries and such queries can hammer the database. The main question was answered.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Platform-Specific Issues
Could I have a construct by a header field and a array field, so that I can select all the suitable components from the database?? Any example or program to show me how to do it?? Thanks. -- ********************************************* *news://news.3home.net/3sport.snooker *news://news.tatgod.com/tatgod.sports.snooker * *A new guy in Linux!! * *Best Regards, * Linux Infant *********************************************
Your form would have to look something like Header Field [a ] Array Field [a1 ] Array Info [b ][c ][d ][e ] [b ][c ][d ][e ] [b ][c ][d ][e ] [b ][c ][d ][e ] [b ][c ][d ][e ] You would then build your construct around the first two fields and display whatever Array info back to fields [b-e] or whatever Note that a1 and b might be the exact same data element. Example: Header Field = Customer ID Array Field = Ship To Location Array of all Order info by Customer/ShipTo??? Dumb example I know but my brain is fried... Any other questions??? Rob Vorbroker Linux Infant <linux_infant@hongkong.com> wrote in message news:3A802D8B.8C01AA6E@hongkong.com... > Could I have a construct by a header field and a array field, so that I > can select all the suitable components from the database?? > Any example or program to show me how to do it?? > Thanks. > > > -- > ********************************************* > *news://news.3home.net/3sport.snooker > *news://news.tatgod.com/tatgod.sports.snooker > * > *A new guy in Linux!! > * > *Best Regards, > * Linux Infant > ********************************************* > >
Linux Infant wrote in message <3A802D8B.8C01AA6E@hongkong.com>... >Could I have a construct by a header field and a array field, so that I >can select all the suitable components from the database?? >Any example or program to show me how to do it?? >Thanks. > construct query_str on tab1.field1, tab1.field2, tab2.field1, tab2.field2 from scr_rec.field1, scr_rec.field2, scr_array.field1, scr_array.field2 is entirely possible, even though scr_array is declared as a screen record array. Note that I haven't put [ or ] or indexes into the construct statement. If you mean something cooler than that: Several years ago, I toyed with the idea of allowing the user to build "OR" expressions into the query by filling in multiple rows. Why? Because Paradox could do it and it sounded like a Good Idea... Like this: col1 col2 [10 :abc* ] [9 :def* ] where the two sets of conditions are glued into the construct string as expressions on either side of an OR. But, when I looked at implementing this, I didn't. Can't. As far as I can see...
Andrew Hamm wrote: > > Linux Infant wrote in message <3A802D8B.8C01AA6E@hongkong.com>... > >Could I have a construct by a header field and a array field, so that I > >can select all the suitable components from the database?? > >Any example or program to show me how to do it?? > >Thanks. > > > construct query_str > on tab1.field1, tab1.field2, tab2.field1, tab2.field2 > from scr_rec.field1, scr_rec.field2, scr_array.field1, scr_array.field2 > > is entirely possible, even though scr_array is declared as a screen record > array. Note that I haven't put [ or ] or indexes into the construct > statement. > > If you mean something cooler than that: > > Several years ago, I toyed with the idea of allowing the user to build "OR" > expressions into the query by filling in multiple rows. Why? Because Paradox > could do it and it sounded like a Good Idea... > > Like this: > > col1 col2 > [10 :abc* ] > [9 :def* ] > > where the two sets of conditions are glued into the construct string as > expressions on either side of an OR. > > But, when I looked at implementing this, I didn't. Can't. As far as I can > see... Which is probably just as well, as 90% of users can't even seem to grapple with the concept of AND contructs i.e. query by form. Throw in OR and you might as well say ThoatWobblerMangrove to them. Brett Randall
Brett Randall wrote in message <3A829E2E.9DFD571C@hotmail.com>... > >Which is probably just as well, as 90% of users can't even seem to >grapple with the concept of AND contructs i.e. query by form. Throw in >OR and you might as well say ThoatWobblerMangrove to them. > Well, it never fussed the Paradox users, but perhaps the PC users from late '80s were more sophisticated than those of today. Maybe it went with the territory in those bleeding edge days, where computer users were more likely to be the go-getters. Today, with computers _everywhere_ we are seeing a larger cross-section of society as users. I just don't teach people beyond their abilities. Some users, I haven't explained more than * to them for QBE - some people struggle with ?. Only some users can handle 10:20 and similar more powerful QBE. The worst thing when training users is to force them to have to understand everything. It's not ripping them off to only tell them about 10% of features. I'm don't weakening facilities just because some people don't get them. If you are the Brett Randall I know in passing from years ago, I think you'll agree with me that limiting to lowest common understanding does not result in good work - if you know what I mean. I'd like _this_ thread continued offline if you would like to reply, to protect the innocent. Talk to me about our common experience...
In article <3A829E2E.9DFD571C@hotmail.com>, Brett Randall <brett_s_rREMOVECAPITALS@hotmail.com> wrote: > > Andrew Hamm wrote: > > > > Linux Infant wrote in message <3A802D8B.8C01AA6E@hongkong.com>... > > >Could I have a construct by a header field and a array field, so that I > > >can select all the suitable components from the database?? > > >Any example or program to show me how to do it?? > > >Thanks. > > > > > construct query_str > > on tab1.field1, tab1.field2, tab2.field1, tab2.field2 > > from scr_rec.field1, scr_rec.field2, scr_array.field1, scr_array.field2 > > > > is entirely possible, even though scr_array is declared as a screen record > > array. Note that I haven't put [ or ] or indexes into the construct > > statement. > > > > If you mean something cooler than that: > > > > Several years ago, I toyed with the idea of allowing the user to build "OR" > > expressions into the query by filling in multiple rows. Why? Because Paradox > > could do it and it sounded like a Good Idea... > > > > Like this: > > > > col1 col2 > > [10 :abc* ] > > [9 :def* ] > > > > where the two sets of conditions are glued into the construct string as > > expressions on either side of an OR. > > > > But, when I looked at implementing this, I didn't. Can't. As far as I can > > see... > > Which is probably just as well, as 90% of users can't even seem to > grapple with the concept of AND contructs i.e. query by form. Throw in > OR and you might as well say ThoatWobblerMangrove to them. > > Brett Randall > And watch your database come to it's knees as they get way more data than they realized. Will Sent via Deja.com http://www.deja.com/
William Rice wrote in message <9611ip$s3$1@nnrp1.deja.com>... > >And watch your database come to it's knees as they get way more data >than they realized. > Big chuckle - yeah worse chance for that. But then again, users can get ridiculous queries with POPDQ! But like I said, it was just an idea, and it never got anywhere. It kinda sounded like wot the Linux Infant was talking about, if he was talking about more than the obvious.
Andrew Hamm wrote in message <3a84ff47$1@news.iprimus.com.au>... >> >Big chuckle - yeah worse chance for that. But then again, users can get >ridiculous queries with POPDQ! > Oops, small correction to that poorly thought-out instant-acronym there: POPDQ -> POQBE Plain Ole' ...