How to ALTER a Column using ADS SQL

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4774
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

How to ALTER a Column using ADS SQL

#1 Post by rdonnay »

The Advantage documentation for ALTER TABLE ALTER COLUMN is terrible.

I want to use SQL to change a field name but cannot figure out a syntax that works.

We have a lot of fields in a lot of tables that need to be changed from USER to USR.

Any ideas?
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4774
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to ALTER a Column using ADS SQL

#2 Post by rdonnay »

It took a while to figure out that the column names must be quoted. I had to look in my SqlQuery.prg code to see how I did it 2 years ago.

I forgot.

This is correct syntax:

ALTER TABLE mn_drv
ALTER COLUMN "user" "usr" char(10)
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1205
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: How to ALTER a Column using ADS SQL

#3 Post by Tom »

The Advantage documentation for ALTER TABLE ALTER COLUMN is terrible.
This is true for the complete documentation.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply