I am trying to create an H2 database to manage some text clippings. One of the fields will contain a large string that may be hundreds and, in a few instances, thousands of words long.
Ideally I would not want to limit the size of this field at the moment when the table is created; it'd be best for this to be dynamically sized, but if that is not possible would want to allocate generously so that the text is not cut. Any suggestions on how to implment this? Is VARCHAR(10,000) possible? crazy? Thanks.
解决方案
You can use a CLOB Data Type. Take a look at their data type page:
CLOB is like VARCHAR, but intended for very large values. Unlike when
using VARCHAR, large CLOB objects are not kept fully in-memory;
instead, they are streamed. CLOB should be used for documents and
texts with arbitrary size such as XML or HTML documents, text files,
or memo fields of unlimited size.