count attribute in a table !!!!
Posted in 1995
> This is a question for Informix gurus :
>* 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
>
>* 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 ?
[...sig deleted...]
RTFM, dude. As it plainly states (after only an hour of frustrated
searching) in the Informix SQL Reference Manual Supplement version 4.1
on pages S-14 thru S-25:
In release 4.1 of ISQL, very few words are reserved...
However, using some of the formerly reserved words can
cause ambiguities in your ISQL statements...
The fix, on page S-15, is paraphrased:
You can avoid this ambiguity by including a table name with
the column name, as shown in the following example:
SELECT mytab.count FROM mytab
There is a whole load of problems associated with using reserved words,
and this book lists sleazy ways around most of them. You would be much
better off not using reserved words at all. Someday you will want to
use one of the ODBC products, or some other snazzy database, and those
columns will not work. It is a mistake, I think, for Informix to free
those words for use. OTOH, maybe that serves to bind you more tightly
to their product, as local extensions to standard SQL do.
I'll leave it to you to post this to CDI, so please do.
Let us know if you have any *tough* questions... :)
Good luck,
__________________________________________________________________
| Clem Akins Standard Disclaimers Apply |
|Reynolds Metals Co, Alloys Plant "Climb High, Cave Deep!" |
| Muscle Shoals, Alabama USA cwakins@leia.alloys.rmc.com |
|________________________________________________________________|