Re: New reserved word?
Posted in 1994
>From: Eliot Everingham <ete@trac3000.ueci.com>
>Subject: New reserved word?
>Date: Wed, 2 Nov 1994 11:05:38 -0500 (EST)
>X-Informix-List-Id: <list.4971>
>
>I'm running 4.12. ISQL and 5.02. Online for OSF/1 v2.0 and having a problem
>that seems to be caused by the use of a reserved word. The following SQL
>statement produces a syntax error (the same statement works fine if "primary"
>is changed to some other, unreserved word).
>
>create table foo (primary char(1));>
>Can anyone verify this? Does the syntax error generated by the use of the
>reserved word come from ISQL, or from the engine?
Yes, this is a genuine reserved reserved word. The error is produced by
the engine. In general, you can do ludicrous things in your create table
statements:
CREATE TABLE VIEW
(
DECIMAL CHAR(30),
NOT INTEGER NOT NULL,
SERIAL DATE NOT NULL,
NULL CHAR(1) NOT NULL,
INTEGER DECIMAL(13,6) NOT NULL
);
However, you cannot use the names PRIMARY, CHECK, FOREIGN, UNIQUE or
DISTINCT as column names. The detailed reasons for this must have to do
with the Yacc grammars used to parse the SQL, but these words are the
keywords used to introduce the 'Constraint-Definition Option' (p1-93 of the
6.00 Guide to SQL: Syntax Manual or p7-77 of the Informix Guide to SQL:
Reference Dec 1991 Manual). It does not document there that these words
are reserved. I don't know of any other reserved reserved words.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>