| View previous topic :: View next topic |
| Author |
Message |
MHB General User

Joined: 19 Mar 2009 Posts: 12
|
Posted: Wed Apr 01, 2009 3:38 am Post subject: Switching on Auto Value in a Table |
|
|
Hi again,
I ran into a new problem. After merging my tables by the Base to Calc to Base method the newly created one doesn't have the Auto Value on with the primary key. Is it possible to turn on Auto Value in an existing table?
Any help appreciated.
rk |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Wed Apr 01, 2009 4:01 am Post subject: |
|
|
It is possible, but may be very tricky due to the existing tables without enforced integrity (spreadsheets don't enforce anything).
Do it agian with a new auto-ID generated by the import wizard.
Then run an UPDATE query to replace the old spreadsheet-IDs with the new IDs (UPDATE "Table" ... SET ("T1"."ID"="T2"."Auto_ID") WHERE "T1"."ID"="T2"."oldSheetID" or something along this line)
If you are familiar with spreadsheets, it may be easier for you to generate consistent IDs in the spreadsheet by means of match-formulas and row numbers before exporting. (meanwhile I prefer UPDATEs into new fields to rebuild relations) _________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
|