cancel
Showing results for 
Search instead for 
Did you mean: 

H2: Cannot figure out why this create table statement is failing

laredotornado
Champ in-the-making
Champ in-the-making
Hi,

I'm using the com.h2database:h2:1.4.190 H2 dependency while creating unit tests using Gradle 2.7.  I'm using Liquibase as the tool for genreating my database scripts and it is currently generating this SQL (for a create table …)

CREATE TABLE PUBLIC.my_prefix_sync_address (id VARCHAR(32) DEFAULT '' NOT NULL, address VARCHAR(500) DEFAULT '', city VARCHAR(100) DEFAULT '', state VARCHAR(10) DEFAULT '', zip VARCHAR(10) DEFAULT '', lattitude INT UNSIGNED DEFAULT , longitude INT UNSIGNED DEFAULT , email VARCHAR(200) DEFAULT '', phone VARCHAR(32) DEFAULT '', phone_type VARCHAR(10) DEFAULT '', CONSTRAINT PK_my_prefix_SYNC_ADDRESS PRIMARY KEY (id))

The driver is reporting the error

org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement

There is no other information.  What is wrong with the above SQL ?

Thanks, - Dave
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
I'm not sure, this is an Activiti forum 😉

No more exceptions or something? Must have a cause … no?

vasile_dirla
Star Contributor
Star Contributor
Hi Dave,
what's the default value for latitude and longitude ? Smiley Wink

<code>
lattitude INT UNSIGNED DEFAULT ,
longitude INT UNSIGNED DEFAULT ,
</code>

just run an h2 server (embedded server)
<code>
java -jar h2.jar
</code>

open in your browser this url: http://localhost:8082 and then test your query in the web application which will be opened.