Subject | Re: reserved words as field names at create table? |
---|---|
Author | kandalf4711 |
Post date | 2005-06-20T09:20:26Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
wrote:
> At 06:17 AM 20/06/2005 +0000, you wrote:word
> >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
> with double quotes, both when defining and when querying.many thanks
>
> 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