Thursday, 8 August 2013

JavaDB - CREATE TABLE IF NOT EXISTS - how to?

JavaDB - CREATE TABLE IF NOT EXISTS - how to?

I'm trying to create table using JavaDB (Derby), but if I try to add IF
NOT EXISTS:
CREATE TABLE IF NOT EXISTS etc (ID BIGINT PRIMARY KEY, title VARCHAR(150))
I get the error:
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "NOT" at line
1, column 17.
As I remember it works on MySQL. What is the syntax/simplest method to
check if table exists?

No comments:

Post a Comment