How to create table if not exists with HSQLDB

我们两清 提交于 2020-01-13 08:09:49

问题


I'm using HSQLDB for persisting a small data, in my query I want to create tables at first time and if they are not exist anymore.

However with HSQLDB I cannot execute the query "CREATE TABLE XYS IF NOT EXISTS" like other dbms like mysql or mssql.

Please give me solution for this case.


回答1:


HSQLDB supports the syntax like the example below:

 CREATE TABLE IF NOT EXISTS xyx (a int, b varchar(10))

The syntax is supported by recent HSQLDB 2.3.X versions.



来源:https://stackoverflow.com/questions/21814489/how-to-create-table-if-not-exists-with-hsqldb

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