Board index » delphi » Keyword & fields name in Interbase

Keyword & fields name in Interbase

I'm translating a Microsoft SQLServer database on an Intrebase database. I have some difficulties on fields such as: password, auto, position. These fields name are not allowed in Interbase because you can't use a keyword for name of a fields.
How can I do?
Tankyou for your answers,
Giancarlo

 

Re:Keyword & fields name in Interbase


Well, you could rename the fields/tables.

Alternatively, you can use double quotes ( " ) around the names - but
beware, the names will be case sensitive if you do this!

Example:

create table "PASSWORD"
(
  pk integer not null
)

You need to do this:

select * from table "PASSWORD"
--
Martijn Tonies
Upscene Productions

InterBase Workbench - The Developer Tool for InterBase
http://www.interbaseworkbench.com

"Giancarlo Ruffinoni" <giancarlo.ruffin...@lario.com> schreef in bericht
news:3bfa62cc$1_1@dnews...

Quote

> I'm translating a Microsoft SQLServer database on an Intrebase database. I

have some difficulties on fields such as: password, auto, position. These
fields name are not allowed in Interbase because you can't use a keyword for
name of a fields.
Quote
> How can I do?
> Tankyou for your answers,
> Giancarlo

Re:Keyword & fields name in Interbase


With interbase 6.0 and Dialect 3 you can work with Quotes for example :

CREATE TABLE "password"
(
  "Name" Char(30) NOT NULL,
  "Encoded" Char(50) NOT NULL
)

But i would not use it, because you then have to use the quotes allways in
select statements etc.
My advise is the choose other table-names for the tables. See SQL reserved
words.

Greetz,
Arno

"Giancarlo Ruffinoni" <giancarlo.ruffin...@lario.com> schreef in bericht
news:3bfa62cc$1_1@dnews...

Quote

> I'm translating a Microsoft SQLServer database on an Intrebase database. I

have some difficulties on fields such as: password, auto, position. These
fields name are not allowed in Interbase because you can't use a keyword for
name of a fields.
Quote
> How can I do?
> Tankyou for your answers,
> Giancarlo

Other Threads