Re: Can I sort on a lookup? i4gl basics
Posted in 1997
RECORD LIKE is evil.
SELECT * is *really* evil.
Don't use either!
Take the miniscule length of time required to type in the names of
the columns (or write a little shell script to do it for you).
Cheers,
Kerry S
In article <3469eb87.17322215@news1.alterdial.uu.net>,
nfredsel@cornercap.com (Nelson Fredsell) wrote:
>I'm trying to display data from two tables and want to make use
>of the asterisk (*) convention when defining RECORD. Also,
>I want to sort on the column coming from the subservient/child
>table.
>
>I'm able to use the asterisk in the SQL statement:
>
>SELECT table1.*, table2.col1
> FROM table1, OUTER table2
> ORDER BY table2.col1, table1.col1
>
>I haven't see a correlation to this for the DEFINE RECORD statement.
>
>DEFINE pr_table1 RECORD LIKE table1.*
>won't let me integrate table2.col1. (Keyword THRU doesn't seem to be
>an option as it is with SCREEN RECORD.)
>
>Can I avoid explicitly naming all the fields in table1?
>
>DEFINE pr_form1 RECORD
> col1 LIKE table1.col1,
> col2 LIKE table1.col2,
> ...
> col1 LIKE table2.col1
> END RECORD
>
>Originally (hours ago), I defined a record on table1, then did a
>lookup on table2.col1. Then I realized how nifty it would be to sort
>on this looked up column.
>
>Thanks for your angles,
>Nelson
>
>Nelson Fredsell
>Cornerstone Capital
>Atlanta, GA
>nfredsel@cornercap.com
--
------------------------------------,------------------------------------------
Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ v2.10 May 1997
Quanta Systems, Auckland | http://www.iiug.org/techinfo/faq/
New Zealand. Work: +64 9 377-4473 | ftp://ftp.iiug.org/pub/informix/faq
Home: +64 9 279-3571 | ftp://kcbbs.gen.nz:/pub/informix/