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

Joined: 06 Apr 2010 Posts: 11
|
Posted: Tue Apr 06, 2010 8:26 pm Post subject: [SOLVED] Problem editing table |
|
|
I created a database table by dragging the Calc table (which contained the data) into the Tables pane (for the Open Office Database).
The problem I have right now is that I am unable to edit the data in the table. The Edit->Edit Data menu item is grayed out. If I create a table using the Create Tables Wizard, the Edit->Edit Data menu item is not grayed out.
Any advice on what I need to do in order to ungray out the Edit Data menu item? Any advice would be much appreciated.
Last edited by shorty123 on Wed Apr 07, 2010 12:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
BigAndy OOo Enthusiast

Joined: 03 Jan 2010 Posts: 150
|
Posted: Tue Apr 06, 2010 9:08 pm Post subject: Re: Problem editing table |
|
|
| shorty123 wrote: | I created a database table by dragging the Calc table (which ...
Any advice on what I need to do in order to ungray out the Edit Data menu item? Any advice would be much appreciated. |
Try to create unique or some other index on target table |
|
| Back to top |
|
 |
shorty123 General User

Joined: 06 Apr 2010 Posts: 11
|
Posted: Tue Apr 06, 2010 9:10 pm Post subject: Re: Problem editing table |
|
|
| BigAndy wrote: | | shorty123 wrote: | I created a database table by dragging the Calc table (which ...
Any advice on what I need to do in order to ungray out the Edit Data menu item? Any advice would be much appreciated. |
Try to create unique or some other index on target table |
In the target table, the first column (ID) should be used as the primary key field. How do I configure the table so that it knows that the ID field should be the primary key field? |
|
| Back to top |
|
 |
BigAndy OOo Enthusiast

Joined: 03 Jan 2010 Posts: 150
|
Posted: Tue Apr 06, 2010 9:33 pm Post subject: Re: Problem editing table |
|
|
| shorty123 wrote: | | BigAndy wrote: | | shorty123 wrote: | I created a database table by dragging the Calc table (which ...
Any advice on what I need to do in order to ungray out the Edit Data menu item? Any advice would be much appreciated. |
Try to create unique or some other index on target table |
In the target table, the first column (ID) should be used as the primary key field. How do I configure the table so that it knows that the ID field should be the primary key field? |
Use DDL create [unique] index or alter table .. alter column [primary key] statements
http://hsqldb.org/doc/2.0/guide/ch04.html#N1127E
http://hsqldb.org/doc/2.0/guide/ch04.html#N10C5E |
|
| Back to top |
|
 |
shorty123 General User

Joined: 06 Apr 2010 Posts: 11
|
Posted: Wed Apr 07, 2010 10:10 am Post subject: Re: Problem editing table |
|
|
| BigAndy wrote: | | shorty123 wrote: | | BigAndy wrote: | | shorty123 wrote: | I created a database table by dragging the Calc table (which ...
Any advice on what I need to do in order to ungray out the Edit Data menu item? Any advice would be much appreciated. |
Try to create unique or some other index on target table |
In the target table, the first column (ID) should be used as the primary key field. How do I configure the table so that it knows that the ID field should be the primary key field? |
Use DDL create [unique] index or alter table .. alter column [primary key] statements
http://hsqldb.org/doc/2.0/guide/ch04.html#N1127E
http://hsqldb.org/doc/2.0/guide/ch04.html#N10C5E |
In the Table Design screen, I setup the ID field to be a primary key and then set AutoValue to Yes. When I tried to save the table design, I got the following error:
"Column "ID" could not be changed. Should the column instead be deleted and the new format appended?"
When I selected "No", I got this error:
"Constraint not foundtable has no primary key in statement [ALTER TABLE "Member Complete 2" DROP PRIMARY KEY]
What am I doing wrong? Thanks for your help.
Note: The table which I am reproducing from the access database has an ID field (with values) which I want to keep on using as the primary field in Open Office Base. |
|
| Back to top |
|
 |
BigAndy OOo Enthusiast

Joined: 03 Jan 2010 Posts: 150
|
Posted: Wed Apr 07, 2010 11:31 am Post subject: Re: Problem editing table |
|
|
[quote="shorty123"][quote="BigAndy"][quote="shorty123"] | BigAndy wrote: | | What am I doing wrong? Thanks for your help. |
Instead creating primary or other key you tried make an autoincrement field but not index/primary key. Autoincrement and keyfield and theremore indexes are generally separate notions.
| Quote: |
Note: The table which I am reproducing from the access database has an ID field (with values) which I want to keep on using as the primary field in Open Office Base. |
If you want create identity you should use alter table.alter column statement. Complete manual is here http://hsqldb.org/doc/guide/ch02.html#N104AE
If ypu want create Primary key or index, you should use manuals from my previous post.
Do not try create primary key onto column[s] which contains even one repeatable value, you should get described error.
PS
| Quote: | | In the Table Design screen, |
Do not use any design . Use directly DDL | DML |
|
| Back to top |
|
 |
shorty123 General User

Joined: 06 Apr 2010 Posts: 11
|
Posted: Wed Apr 07, 2010 12:07 pm Post subject: Re: Problem editing table |
|
|
[quote="BigAndy"][quote="shorty123"][quote="BigAndy"] | shorty123 wrote: | | BigAndy wrote: | | What am I doing wrong? Thanks for your help. |
Instead creating primary or other key you tried make an autoincrement field but not index/primary key. Autoincrement and keyfield and theremore indexes are generally separate notions.
| Quote: |
Note: The table which I am reproducing from the access database has an ID field (with values) which I want to keep on using as the primary field in Open Office Base. |
If you want create identity you should use alter table.alter column statement. Complete manual is here http://hsqldb.org/doc/guide/ch02.html#N104AE
If ypu want create Primary key or index, you should use manuals from my previous post.
Do not try create primary key onto column[s] which contains even one repeatable value, you should get described error.
PS
| Quote: | | In the Table Design screen, |
Do not use any design . Use directly DDL | DML |
Thanks for your help. |
|
| Back to top |
|
 |
|