8

So here's some code:

statement.executeUpdate("CREATE TABLE SomeTable(id INTEGER IDENTITY, " +
    "text CLOB)");

which throws an exception "Wrong data type: CLOB in statement [...]". Is there a way to store CLOBs in Hsqldb databases? The documentation says it is. Or maybe my knowledge of SQL is so rusty that I forgot how to define them.

Marcin
  • 7,874
  • 7
  • 45
  • 49

2 Answers2

11

Try LONGVARCHAR instead of CLOB

objects
  • 8,637
  • 4
  • 30
  • 38
4

In version 2.0 and above, CLOB is a supported type. For your example, you should add PRIMARY KEY explicitly.

statement.executeUpdate("CREATE TABLE SomeTable(id INTEGER IDENTITY PRIMARY KEY, " +
    "text CLOB)");
fredt
  • 24,044
  • 3
  • 40
  • 61