Hello!
NaN is not a literal, it's just an identifier.
In this case you can pass it as a character string literal:
INSERT INTO "TABLE"(ID, DOUBLE_COLUMN) VALUES (10, 'NaN');
In more complex cases where data type cannot be determined automatically a cast is needed:
CAST('NaN' AS DOUBLE PRECISION)
There are two other special values:
CAST('Infinity' AS DOUBLE PRECISION) and
CAST('-Infinity' AS DOUBLE PRECISION).
REAL and DECFLOAT data types also have these three special values in H2, but all other numeric data types (TINYINT, SMALLINT, INTEGER, BIGINT, and NUMERIC) don't support them.