🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #410

Re: Change a field name that is a reserved word

#410
From: Martijn Tonies
Date: Mon, 03 Mar 2008 15:53
53 lines
2671 bytes
> >>> You need to double quote the reserved words.  Remember this makes it
> > case
> >>> sensitive so make sure the column is all caps.
> >>
> >> The two columns I am dealing with are PERCENT and TYPE.  In IBConsole,
> > using
> >> Interactive SQL, I put in this statement:
> >>
> >> ALTER TABLE footage ALTER "PERCENT" TO pct;
> >>
> >> I get back:
> >>
> >> SQL error code = -104
> >> Token unknown - line 1, char 26
> >> "PERCENT"
> >>
> >> There is definitely a column named PERCENT.
> >>
> >> Any thoughts?
> >
> > What is the connection dialect?
> >
> > I think you need to use dialect 3 to use delimited identifiers.
>
>
> Thanks. I did it manually through IBConsole and it worked. How would I do
> this programmatically? Basically I want to be able to restore the backup
and
> run a script to change all the of the columns and such. I can do "SET SQL
> DIALECT" but that is only for the client. Is there an ALTER command or
> something to change the dialect? I've looked through the help and can't
seem
> to find it.  I would be doing this through IBExpress components in a
> Delphi2007 app.

You can set the database dialect by using the Services API (components).

Do note, however, that numeric columns based on NUMERIC or DECIMAL
won't change the underlying storage types (which can be SMALLINT to DOUBLE)
to the new int64.


-- 
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Technical Details
Message-ID: <47cc1e94$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <C3EB7CF4.80BC%sleake@gmail.com> <47c61ec2$1@newsgroups.borland.com> <C3ECB1D8.8242%sleake@gmail.com> <47c7cc94@newsgroups.borland.com> <C3F030AB.8475%sleake@gmail.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,12d183e78a7d5da7
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Martijn Tonies" <m.tonies@upscene.removethis.com>
Newsgroups: borland.public.interbase.sql
References: <C3EB7CF4.80BC%sleake@gmail.com> <47c61ec2$1@newsgroups.borland.com> <C3ECB1D8.8242%sleake@gmail.com> <47c7cc94@newsgroups.borland.com> <C3F030AB.8475%sleake@gmail.com>
Subject: Re: Change a field name that is a reserved word
Date: Mon, 3 Mar 2008 16:53:18 +0100
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1914
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914
NNTP-Posting-Host: 212.238.159.172
Message-ID: <47cc1e94$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1204559508 212.238.159.172 (3 Mar 2008 07:51:48 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail