[Solved] Alter field names of table

Creating tables and queries
Post Reply
aquadonia
Posts: 1
Joined: Mon Jul 22, 2024 10:03 pm

[Solved] Alter field names of table

Post by aquadonia »

Hi there!

I've looked up how to change the names of fields but nothing is working. Is there a special trick or something? I feel reeeeeaaaallllyyy stupid right now. :lol:

Please help! (Thanks in advance!)
Last edited by MrProgrammer on Tue Aug 06, 2024 6:19 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
~*aquadonia*~

Open Office 4.1.15
Windows 10
FJCC
Moderator
Posts: 9458
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to do I change field names?

Post by FJCC »

To change the name of a column in a table, click on the Tables icon in the left pane, right click on the desired table and select Edit, type a new name in the Field Name column, and save the table. You should also save the whole Base document afterward.
You can also do this from the Tools -> SQL menu. If I have a table named "Scores" and I want to change the name of the Type column to Sport, the SQLis

Code: Select all

ALTER TABLE "Scores" ALTER COLUMN "Type" RENAME TO "Sport"
This assumes you are using the default HSQLDB database engine.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
keme
Volunteer
Posts: 3738
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: How to do I change field names of a table?

Post by keme »

aquadonia wrote: Mon Jul 22, 2024 10:16 pm I've looked up how to change the names of fields but nothing is working. Is there a special trick or something?
FJCC did provide the "special tricks" for actually changing field names. If that solved your issue, disregard my comment here.

If you still have trouble, you should give more detail:
  • Your searches:
    • Where did you look for solutions on how to change names?
    • What advice did you find?
  • Your attempts:
    • Did you try to follow the advice?
    • Were you able to do anything at all, or did all modify options seem to be locked?
  • Your results:
    What is the nature of "nothing is working"?
    • What is it you are trying to get to work?
    • Do you get error messages, wrong results, or no results at all?
If you created a "standalone database" (single file containing embedded data, as opposed to a connection to a source file or an external database service) you could also upload the file as an attachment here, to make it easier for us to address the issue.
Remember that this is a public place, so you should not upload any file with confidential content. Also, database files may easily grow in size beyond what is allowed as attachments here. If such is the case, you will be notified when you try.
Post Reply