Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create table if not exists with 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.

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.

like image 564
Khoi Nguyen Avatar asked Feb 16 '14 17:02

Khoi Nguyen


1 Answers

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.

like image 81
fredt Avatar answered Oct 12 '22 20:10

fredt