Board index » delphi » how to convert reserve word to collumn name

how to convert reserve word to collumn name

Hi,everybody:
I want to convert MS-access DB to InterBase,but I meet some column name like "password","year" etc. in Access is enabled,but in InterBase it is not work, so I can't create table when table have these column name, Have any method to create these column name unless avoiding to use them?Thank.

 

Re:how to convert reserve word to collumn name


Hallo,

use " i.e. create table .... "password" char(128), "year" integer ....

Oliver

"cedric" <cedric.t...@inforich.com.tw> schrieb im Newsbeitrag
news:3bf88c71$1_1@dnews...

Quote

> Hi,everybody:
> I want to convert MS-access DB to InterBase,but I meet some column name

like "password","year" etc. in Access is enabled,but in InterBase it is not
work, so I can't create table when table have these column name, Have any
method to create these column name unless avoiding to use them?Thank.

Re:how to convert reserve word to collumn name


thanks, but when I create table use this syntax
create table employee(
    sseq integer not null,
    employee_pk numeric(12,0) default 0,
    division_pk numeric(12,0),
    code varchar(50),
    name varchar(20),
    use_epos_flag varchar(1),
    brand_pk numeric(12,0),
    store_pk numeric(12,0),
    store_title varchar(2),
    onboard_date date,
    quit_date date,
    "password" varchar(6),
    id varchar(10),
    birthday date,
    tel varchar(10),
    slevel varchar(1),
    create_date date default 'now',
    create_user numeric(12,0),
    last_modify_date date default 'now',
    last_modify_user numeric(12,0)
);
if any error  above describe, I still can't create table, the
error message is

SQL error code = -104
Token unknown - line 13, char 3
"password"
Statement: create table employee(
  sseq integer not null,
  employee_pk numeric(12,0) default 0,
  division_pk numeric(12,0),
  code varchar(50),
....
what is wrong ?
thanks

Re:how to convert reserve word to collumn name


"cedric"

Quote
>     "password" varchar(6),

Quoted names should work only with Dialect 3 databases.

HTH

Ciao,
    Max

Re:how to convert reserve word to collumn name


Thanks, I can do it.
I have another problem, how to set InterBase field value case insensitive, like in my program  have this command "select * from employee where name='cedric'", I want to select result "Cedric" or "cedric" or "cedRic"..
Have any method when I set DB properties to case insensitive and without changing my program or sql command to upper my field value.
      Cedric Tsan

Quote
"Massimo Battiston" <NOSPAM_m.battis...@tin.it> wrote:
>"cedric"
>>     "password" varchar(6),

>Quoted names should work only with Dialect 3 databases.

>HTH

>Ciao,
>    Max

Re:how to convert reserve word to collumn name


try
select * from employee where upper(name)='CEDRIC'".
If you want to use it with international characters you have to write an udf
Thanks
Mail me if you want an udf written in delphi
Quote
"cedric" <cedric.t...@inforich.com.tw> wrote in message

news:3bf8d8f9$1_1@dnews...
Quote

> Thanks, I can do it.
> I have another problem, how to set InterBase field value case insensitive,

like in my program  have this command "select * from employee where
name='cedric'", I want to select result "Cedric" or "cedric" or "cedRic"..
Quote
> Have any method when I set DB properties to case insensitive and without

changing my program or sql command to upper my field value.
Quote
>       Cedric Tsan

> "Massimo Battiston" <NOSPAM_m.battis...@tin.it> wrote:
> >"cedric"
> >>     "password" varchar(6),

> >Quoted names should work only with Dialect 3 databases.

> >HTH

> >Ciao,
> >    Max

Other Threads