Ask Your Question
0

How to rename a column in base?

asked 2016-11-25 20:38:25 +0200

Quarto Die gravatar image

updated 2016-11-25 20:49:10 +0200

I have migrated a few of my databases over to SQL 2.3. Now I have tried to rename a column in base with this command:

Alter table "TABLE NAME" rename column "COLUMN NAME" to "NEW COLUMN NAME"

If I use "table name" and "column name"... I get this;

unexpected token: COLUMN required: TO

If I use no quotation marks, I get this:

user lacks privilege or object not found: PUBLIC.TABLE NAME

Also I note that in the GUI in Base, when open the table to edit by right clicking, I can no longer change the names of the columns and save the changes as I could under HSQL 1.8.

One the same token I note that a table itself cannot be renamed anymore simply by right clicking.

Are there any solutions?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-11-25 21:20:46 +0200

Ratslinger gravatar image

Although many benefits to a 'split DB', the one determent is the inability to CHANGE existing fields. You can still delete and add new fields though. In answer to your question, the following will change a column name:

ALTER TABLE THETABLENAME ALTER COLUMN  MYCOLUMNNAME RENAME TO NEWCOLUMNNAME

As an aside, using split db's, MySQL, HSQL server and others, I have found using a separate tool for SQL work/testing to be of great value. With one tool I can access a variety of data sources and even transfer data between them. Note this is NOT for embedded DB's. I use SQL Workbench/J found here. It will require a connector (JDBC, ODBC etc.) to connect to the appropriate DB and some connection strings depending upon the DB. Might be thought for future.

edit flag offensive delete link more

Comments

Thank for the help.

Quarto Die gravatar imageQuarto Die ( 2016-11-25 22:00:34 +0200 )edit

@Quarto Die it would help others to know a correct answer was provided if you would please mark the answer as solved by a tick of the ✔ (upper left in answer) when your question has been resolved.

Ratslinger gravatar imageRatslinger ( 2016-11-26 00:49:13 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-11-25 20:38:25 +0200

Seen: 788 times

Last updated: Nov 25 '16