🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Change a field name that is a reserved word

#406
From: Scott Leake
Date: Sun, 02 Mar 2008 15:23
35 lines
2332 bytes
On 2/29/08 4:14 AM, in article 47c7cc94@newsgroups.borland.com, "Martijn
Tonies" <m.tonies@upscene.removethis.com> wrote:

>>> 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.
Technical Details
Message-ID: <C3F030AB.8475%sleake@gmail.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,12d183e78a7d5da7
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
User-Agent: Microsoft-Entourage/11.4.0.080122
Date: Sun, 02 Mar 2008 10:23:39 -0500
Subject: Re: Change a field name that is a reserved word
From: Scott Leake <sleake@gmail.com>
Newsgroups: borland.public.interbase.sql
Message-ID: <C3F030AB.8475%sleake@gmail.com>
Thread-Topic: Change a field name that is a reserved word
Thread-Index: Ach8eWP1omvy5OhsEdyfjwAWy5+PFw==
References: <C3EB7CF4.80BC%sleake@gmail.com> <47c61ec2$1@newsgroups.borland.com> <C3ECB1D8.8242%sleake@gmail.com> <47c7cc94@newsgroups.borland.com>
Mime-version: 1.0
Content-Type: text/plain;
 charset="US-ASCII"
Content-transfer-encoding: 7bit
NNTP-Posting-Host: 72.84.195.233
X-Trace: newsgroups.borland.com 1204471419 72.84.195.233 (2 Mar 2008 07:23:39 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail