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

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

crossposting: I cannot set a Primary key after Importing Tables into LibreBase

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

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.

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.