Subject Re: [firebird-support] reserved words as field names at create table?
Author Helen Borrie
At 06:17 AM 20/06/2005 +0000, you wrote:
>Hello together,
>
>we habe a problem with the create table syntax which no other database
>has.
>
>We can't create our tables because firebird can't create tables where
>the field name ist equal to the data type name.
>
>Example:
>create table test (TIMESTAMP timestamp NOT NULL);
>
>Can anobody help me?

You can use reserved words as identifiers, provided you enclose the word
with double quotes, both when defining and when querying.

Thus:

create table test ("TIMESTAMP" timestamp NOT NULL);

select * from test
where "TIMESTAMP" > cast ('now' as timestamp) - 1;

insert into test ("TIMESTAMP")
values('now');

and so on....

Note that identifiers so defined are case-sensitive.

./heLen