Long string data type in H2 databases

别说谁变了你拦得住时间么 提交于 2019-12-10 12:39:16

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/8453787/long-string-data-type-in-h2-databases

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!