Re: Look up on two fields in a form in SQL
Posted in 1995
Topics: SQL Development & Query Writing, Stored Procedures & SPL
Kate Juliff <kcj@netcom.com> wrote:
>I want to look up a field for display that would need a join on two
>columns, ie order # and lineitem #. I want to display the product and
>have the order # and lineitem # entered into the field. I can only
>reference the product by supplying both order number and item number. Any
>pointers?????
Check out the COMPOSITES keyword in the INSTRUCTIONS section of the form
definition. Note - this only works for joins, not lookups. AFAIK,
there's no way to do a composite lookup in perform.
If your tables look like:
CREATE TABLE items (
it_desc CHAR(20),
it_order INTEGER,
it_lineitem INTEGER
);
CREATE TABLE order (
or_name CHAR(30),
or_order INTEGER,
or_lineitem INTEGER
);
Then the form could include:
ATTRIBUTES
f000 = or_name;
f001 = it_order;
= or_order;
f002 = it_lineitem;
= or_lineitem;
f003 = it_desc;
END
INSTRUCTIONS
COMPOSITES <or_order, or_lineitem> <it_order, it_lineitem>
and it will work as you expect.
Hope this helps.
--
Mark Rafn dagon@halcyon.com http://www.halcyon.com/dagon/