Re: "count" attribute in a table !!!!
Posted in 1995
>From: Alain.Leroy@csl.sni.be (Alain Leroy)
>Date: 9 Mar 1995 13:32:28 GMT
>X-Informix-List-Id: <news.12102>
>
>* Try this :
>
> Create table tabname
> ( count integer,
> other integer );>
> It'll work on Informix 5.0C on-line
> It won't work on Informix 4.0B on-line
I take it those should be something like 5.00.UC1 and 4.00.UC1. No-one but
no-one, not even internally within Informix, not even R&D types, gets to
play with a release with a B in its version string.
The 4.00 versions had reserved words; the 4.1x versions went through a
process called keyword elimination which meant that almost all keywords can
be used as column names now. There are some exceptions, still -- you can't
create a table with a column called primary in 5.0x and above, for example.
>* The question is : Given that I can crete the table with a "count"
> attribute, I must be able to retrieve it (unless it's a bug in 5.0C).
> HOW ????
> OK, don't tell me "select count from tabname". It'll generate
>a syntax error. What else ?
SELECT T.Count FROM Tabname T;
This sort of trick (prefixing a word with an table name or table alias)
generally works. It was documented in the 4.1x supplements (eg I4GL
Supplement 4.10, page S-32: Using the Formerly Reserved Words). There
doesn't seem to be a corresponding section in the 5.00 documentation.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>