Ask Your Question
0

AutoField not working

asked 2016-09-07 22:26:53 +0200

rgsmiths gravatar image

Created Table with AutoValue on in the first field expected to see <autofield> in first field... do not see this Edit mode of Table will not allow changes to the fields via Field Properties using 32 bit Version: 5.2.1.2 with Java 8 update 101 using Windows 10 is 64 bit Note Installation would not work with 64bit LO and 64bit Java had to load LOffice v32bit and Java 8 update 101 32bit

edit retag flag offensive close merge delete

Comments

I have this same problem running LO 5.1.4.2 on Ubuntu 16.04 x64. If I look at the table definition either in MySQL or MySQL W, the column in question is defined as integer with auto-implement (AI). When I try to add a new record, the AI shows a 0 (zero) rather than the correct integer value. If I try to add the information contained in a table with the AI column in the original table as a foreign key, I get this error: SQL Status: 23000 Error code: 1452. This has worked always before.

cscj01 gravatar imagecscj01 ( 2017-01-30 22:49:32 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-09-08 00:23:58 +0200

Ratslinger gravatar image

Have not heard of this except when using a "split" database. With a "split" DB you typically need to use SQL to modify tables after they are created. If you have set up your key field as an "integer" you can change the AutoValue to YES with SQL:

alter table YOUR_TABLE_NAME alter column YOUR_FIELD_NAME set GENERATED BY DEFAULT AS IDENTITY

You have to run this from the initial Base screen menu Tools->SQL... when you open the .odb

This should work regardless of "split" DB or not.

Although no personal experience with your Java problem (using Linux here), I have seen posts claiming 64-bit LO to work with BOTH 64 AND 32-bit JRE installed in WIN10 (saw one post for WIN8.1).

edit flag offensive delete link more

Comments

Please note: If your table or field name contains lowercase or special characters you must enclose them with quotes - ie; "MyTableName" or "My_Field"

Ratslinger gravatar imageRatslinger ( 2016-09-08 00:33:54 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-09-07 22:26:53 +0200

Seen: 285 times

Last updated: Sep 08 '16