Importing from Calc: Cannot set datatype for PK field that already has Values

asked 2019-05-14 10:06:46 +0200

Sums gravatar image

updated 2019-05-14 10:08:13 +0200

Im using HSQLDB in Libre 6.2 on Windows 10.

I have a table in Calc that has two Fields CityID and CityName. CityID is the PK and already contains number values.

When I copy and paste the table into Base I set CityID as the PK Field and assign Integer as its Datatype. However I get an error message saying that Integer is the wrong Datatype for the CityId field.

What am I doing wrong.

Thank you

edit retag flag offensive close merge delete


ebot gravatar imageebot ( 2019-05-14 11:21:47 +0200 )edit

I did not crosspost. It is a different problem. I initially had a problem on how to assign a PK. I was told I needed to right click the filed which I did. This problem relates to assigning a datatype to a field that will be used as a PK but already contains values

Sums gravatar imageSums ( 2019-05-14 11:31:44 +0200 )edit

What is the largest value of CityID? Also what is the datatype assigned before your change?

Just had educated guess - had column headings from Calc. On first screen of dialog, was Use first line as column name checked? If not, then text mixed in with numeric data.

Ratslinger gravatar imageRatslinger ( 2019-05-14 12:44:58 +0200 )edit

Largest value of CityId is 440. The datatype that was auto assigned was varchar. I changed that to Integer. I did not check the Use First Line as Column Name. It seems to be working now. Ill try some more tables and if theres any problem ill post back her. Thanks very much for helping.

Sums gravatar imageSums ( 2019-05-14 14:09:39 +0200 )edit