[comp.databases] Multiple lookups from Informix Perform and a selection trick

rbp@investor.pgh.pa.us (Bob Peirce #305) (11/21/89)

My most recent release of Informix (2.10.00) eliminated a feature/bug
which I had come to rely upon in previous releases.  This is the ability
to do multiple lookups from the same table in perform.   When I brought
this to the attention of Tech Support at Altos they were surprised
anybody would want to do this so you may want to hit <n> at this point.
On the other hand, if you have the need, here is a work around.

If you need to do N lookups, create N identical tables with similar
names.  Go to your *.dbs directory and note the full name of the
*.dat and *.idx files.  Rm all but one set and ln that set back to the
N-1 names.  It turns out Informix seems to think they are still separate
tables and will treat them as such.  At least it seems that way so far.

The following segment shows the way I used to do it followed by the new
version.

v = monthly, queryclear, autonext, default = 0, right,
	lookup descc = description joining *code;
x = quarterly, queryclear, autonext, default = 0, right,
	lookup desca = description joining *code;
w = annual, queryclear, autonext, default = 0, right,
	lookup descb = description joining *code;


v = monthly, queryclear, autonext, default = 0, right,
	lookup descc = codec.description joining *codec.code;
x = quarterly, queryclear, autonext, default = 0, right,
	lookup desca = codea.description joining *codea.code;
w = annual, queryclear, autonext, default = 0, right,
	lookup descb = codeb.description joining *codeb.code;

This code hints at why I need to do this.  Our mailing list contains
entries for clients, prospects and contacts.  We have some more or less
standard mailings we do every month, quarter and year.  It is easiest if
mailings have the same description regardless of their frequency.  For
example, a letter is a letter and a performance report is a performance
report.  It doesn't make sense to duplicate this across three tables
when one will do.  In our client transaction database we have a similar
problem with broker names.  We want to show which broker we used to buy
and sell a security so we need to do two lookups from the same broker
table.  You may have similar applications.  If so, give this idea a
shot.

BTW, another trick we are using on these mailings is to use binary
coding.  A letter is 1, performance is 2, outlook is 4, etc.  Thus any
combination may be expressed as the sum of the individual possibilities
and a bit mask may be used to select the list of names for the mailing. 
Thus we can get all the letter people with 001, all the performance
people with 010 and the people getting both with 011.  This not only
limits the number of fields we have to show on the perform screen but
makes it easier to feed the correct options to the ace program not to
mention writing the ace program itself. 


-- 
Bob Peirce, Pittsburgh, PA				  412-471-5320
...!uunet!pitt!investor!rbp			rbp@investor.pgh.pa.us