如果HSQLDB不存在该如何创建表 [英] How to create table if not exists with HSQLDB
本文介绍了如果HSQLDB不存在该如何创建表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用HSQLDB持久存储少量数据,在我的查询中,我想在第一次创建表并且如果表不存在的话。
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.
但是,对于HSQLDB,我无法像其他dbms(如mysql或mssql)一样执行查询如果不存在则创建表XYS。
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.
推荐答案
HSQLDB支持类似以下示例的语法:
HSQLDB supports the syntax like the example below:
CREATE TABLE IF NOT EXISTS xyx (a int, b varchar(10))
最新的HSQLDB 2.3.X版本支持该语法。
The syntax is supported by recent HSQLDB 2.3.X versions.
这篇关于如果HSQLDB不存在该如何创建表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文