Migration from 1.4.199 TO 2.1.210 Character Problem

76 views
Skip to first unread message

Roland M.

unread,
Mar 30, 2022, 4:44:00 AM3/30/22
to H2 Database
Hello,
When I try to migrate from 1.4.199 to 2.1.210 via SCRIPT / RUNSCRIPT, I get an error message:
Value to long for coulmn "NAME CHARACTER". "Customer Name with 33 characters ", (33).

The create statement in the script file is:
CREATE CACHED TABLE "PUBLIC"."CUSTOMERS"(
    "CUSTOMERID" INT NOT NULL SELECTIVITY 100,
    "NAME" CHAR SELECTIVITY 93,
    "STREET" CHAR SELECTIVITY 88,
    "NUMBER" CHAR SELECTIVITY 46,
    "COUNTRY" CHAR SELECTIVITY 2,
    "PLZ" CHAR SELECTIVITY 77,
    "CITY" CHAR SELECTIVITY 67,
    "OLD" DATETIME DEFAULT NULL SELECTIVITY 4
);      

So, what I'm doing wrong?

Noel Grandin

unread,
Mar 30, 2022, 5:07:46 AM3/30/22
to H2 Database
CHAR has a default length of 1 and is a fixed length datatype.
I think you want to be using VARCHAR there.

Roland M.

unread,
Mar 30, 2022, 5:41:06 AM3/30/22
to H2 Database
Ah, thank you,
it's a really old database, so it worked until now. I will modifiy the sql dump and test it.
Reply all
Reply to author
Forward
0 new messages