Thank you, Marc for outlining these issues.

Marc Santhoff wrote:
 > 3. Influencing how primary keys are set is not really intuitively
> presented. The import wizard needs to:
> 
> - show which field would be selected automatically as PK
> 
> - offer an explicit boolean input field (checkbox or similar) for
> selecting a column as primary key in the table to create
> 

At this point another property comes into play: DEFAULT IDENTITY
(commonly used auto-increment fields).
If you apply IDENTITY to an already populated field, the entire field
gets replaced with a new one. Your old IDs get lost and the new ones do
not match with foreign keys in other tables anymore.
See http://www.oooforum.org/forum/viewtopic.phtml?t=61763 where I tried
my best to help another desperate soul.
This is not an office issue, since hsqldb does not allow to set IDENTITY
with ...ALTER COLUMN... You need to specify IDENTITY at time of creation
(...ADD COLUMN...):

http://hsqldb.org/web/hsqlDocsFrame.html
> 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>];
> 


So it may be even more frustrating to have an advanced import wizzard,
which allows adoption of a PK and finally you can not use it.

Andreas

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

Reply via email to