David Smith wrote:
Software: Libreoffice base
Version: 184.108.40.206 (Debian Wheezy)
Subject: Cannot add primary key after saving without primary key.
I've got a problem. I'm trying to test some different table designs.
Whenever I create a table without a primary key, I find that I cannot
go back and add a primary key later. When I first save the table,
Libreoffice asks me if I want to create a primary key now. I choose
"no" because I'm experimenting with some different table designs and
didn't want to commit to anything just yet.
1. Create table without primary key.
2. Save table.
3. Libreoffice asks if I want to create a primary key now.
4. I choose no.
5. I later then open the table and set the primary key.
6. I save the table.
7. I open the table again and the primary key that I chose was not saved!
I've never had this kind of problem with a database before. Is this a
bug or a missing feature?
I am using the MySQL server for my database and have seen similar
problems. I recently created a new table, selected the key, but forgot
to set the "Autoincrement" attribute on the key before my first save of
the table structure. I tried several things, such as moving the key to
a temporary field, but nothing allowed me to make the original key field
autoincrement. Every time I saved the table, the autoincrement
selection on the key would revert to "No". Since this was a new table
and no data was in it yet, I ended up deleting the table and recreating
it with the autoincrement set on the key before I first saved it. I had
similar things happen to me with table structure key definitions
before. Once, I had to use the MySQL Monitor program and some SQL
statements to change key definitions on existing database tables. Not
fun and error prone, but it worked. The odd thing is that there is no
error message from the server when these things happen, which makes me
suspicious of Base or the JDBC driver - even more so since you are using
a different server. The bottom line is that as far as Base table keys
go, you must set them up properly before you do that first save of the
new table structure. In my experience, non-key fields may be changed or
added after the first save. The key field is special.
Hope this helps.
For unsubscribe instructions e-mail to: firstname.lastname@example.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Impressum (Legal Info)
: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (MPLv2
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our trademark policy