Ask Your Question
0

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

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

lonk gravatar image

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

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 ?

C:\fakepath\0004.ods

C:\fakepath\firebird4ask.odb

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

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

Ratslinger gravatar image

Hello,

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

Comments

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 +0200 )edit

Dear @Ratslinger,

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

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

Just Firebird embedded. See tdf#119962

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

Dear @Ratslinger,

Thank you so much again.

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

Question Tools

1 follower

Stats

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

Seen: 40 times

Last updated: Jan 22