David Bowman wrote:
I am trying to create a table in Base. After saving the table I can not
change a field name or type. How can I make changes?
Hello David,

Simply open the table definition for editing. In the Table section of the Base window select the table item and select 'Edit>Edit' this opens the table properties editor. In this window just change the name and save the file. Now - are there any times when you can not do this?

Yes. If the field is part of an index, used in a View, or is "referred to" in a foreign key relationship. Then you can not change the name, until you have dropped ( deleted ) those other objects. ( kind of makes sense as otherwise those other objects would be referring to a field that no longer exists )

Changing data types is a little different.

If the field is holding data then your ability to change type depends on both the current type and the type you want to change to.
Generally speaking a like type, that is larger, is allowed.
So a SmallInt can become an Ingeger or BigInt. A Varchar(50) can become a Varchar(100). Making a type into a smaller type is usually not allowed, BigInt can not become SmallInt in other words.
Changing from a CHAR to VARCHAR is not allowed.
Changing from a Real, Float or Decimal to an Integer type is not allowed. ( I don't remember for the other direction, but I think it is not )

The user documentation for the HSQLdb database engine, that used in a default Base file, has a section on this subject and can be found at http://hsqldb.org

ALSO - if you make a change and the application warns you that it must drop the column and make a new one - understand that this will delete any data in that column ( field ), the data will not be moved to the new column and if you say OK to that warning there will be no way to recover the deleted data. To save the data you must do so before you make the change. For instance, by ADDING the new column, then using INSERT statements to transfer the data from the old column to the new and finally dropping the old. ( you can also do this using the Copy Table Wizard ).

I HTH - but it may raise more questions then offer answers I'm afraid. Let me know if that is the case.

Drew


--
OpenOffice.org User Community Forum: http://user.services.openoffice.org
United States PostgreSQL Association: http://www.postgresql.us/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to