Dinbandhu wrote:
> 
> 1. How to change the name of an existing column?
Example for given table "Table1" having field "ID" to be renamed to "ID_New"
ALTER TABLE "Table1" ALTER COLUMN "ID" RENAME TO "ID_New"
> 
> I tried to double click on the column title window, but it doesn't give
> me a cursor to change the name.
> 
> 2. How to add a column? 
> 
This should work in the design view.

> I cannot find anywhere command for "insert a column".
> 
All SQL commands for the underlying hsqldb are documented here:
http://hsqldb.org/web/hsqlDocsFrame.html

Example:
ALTER TABLE "Table1" ADD COLUMN "New_Date" DATE  BEFORE "Date"

derived from the general scheme:
> ALTER TABLE <tablename> ADD [COLUMN] <columnname> Datatype
>     [(columnSize[,precision])] [{DEFAULT <defaultValue> |
>     GENERATED BY DEFAULT AS IDENTITY (START WITH <n>[, INCREMENT BY <m>])}] |
>     [[NOT] NULL] [IDENTITY] [PRIMARY KEY]
>     [BEFORE <existingcolumn>];
> 

> 3. How to move a column from one location to another? 
> 
Simply don't. The order of columns is not relevant. If you want to use a
different order of columns use a query like:
SELECT "Field_3", "Field_2", "Field_1" From "Table1"
Simple SELECT queries like this one can be created in design view
(container "Queries", "Create query in design view") or by editing a
SELECT string in SQL view.
> 
> 4. How to save the file?
> 
> I've added a couple of rows to the table. Now I want to save my work and
> close the table. But the "save" option in the "File" drop-down menu is
> grayed out. And if I do ctrl-s, it just types an "s" wherever the cursor
> is. So I am afraid to close the table, for fear I'll lose what I added.
> 

When you add/remove/edit your data, you are simply using the database.
All changes are written as soon as leave the current record. Esc will
drop all edits on the current record (just like Access).
The odb database document needs to be saved only if you changed the
structure of the database.
In a perfect world you would design all names of tables, columns, types,
restrictions, relations, indices and stuff *before* you actually create
the database or at least *before* you put data into it. Changing the
structure of a populated database is a more or less severe intervention,
which may fail or give unexpected results, even in MSAccess.

Snippet from the instructions I gave you on the other list:
> - You have noted the names of tables, fields, their data types and if
> they allow null values. It is important that you use identical data
> types for all related fields across tables. Access has some report tool,
> but a pencil and paper record should do as well.
> 

It is a flaw in your database design, if normal operation requires
insertion of new columns. In this case you should learn about the
general concepts of relational databases (keyword: normalisation,
normalization[US engl.]) or keep plain lists (without relations) in
spreadsheets (bad concept, prone to errors, but easy).

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

Reply via email to