Ask Your Question

Base | Firebird primary key/autovalue/BigInt field collides with SQL

asked 2020-01-22 08:28:28 +0100

lonk gravatar image

updated 2020-01-22 08:31:57 +0100

From the error message of Calc BASIC:

image description

It looks like SQL tried to insert new record with ID=1 but Firebird didn't allow for ID=1 exists.

Did I misunderstand or how can I handle ?



edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-01-22 19:08:11 +0100

Ratslinger gravatar image


The problem is with the auto-increment starting point. As it is not known how you got the initial data into the table, it is probable it was imported in some way. This then did not set the value correctly. See this post -> After updating I get error message when saving in Base.

You can correct the problem by running the following statement from Tools->SQL...:

alter table "AccountCodeLevel1" alter "ID" restart with 5;
edit flag offensive delete link more


Dear @Ratslinger,

Yes, I created the table by copying from Calc and pasting in Base/Firebird.

Khob Khun Krab.

lonk gravatar imagelonk ( 2020-01-23 04:29:59 +0100 )edit

Dear @Ratslinger,

Does this kind of problem happen with HSQLDB database or others ?

lonk gravatar imagelonk ( 2020-01-23 05:46:57 +0100 )edit

Just Firebird embedded. See tdf#119962

Ratslinger gravatar imageRatslinger ( 2020-01-23 06:00:50 +0100 )edit

Dear @Ratslinger,

Thank you so much again.

lonk gravatar imagelonk ( 2020-01-23 14:17:16 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-01-22 08:28:28 +0100

Seen: 30 times

Last updated: Jan 22