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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 05:41 PM
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
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
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2015 03:23 PM
I'm not sure, this is an Activiti forum 😉
No more exceptions or something? Must have a cause … no?
No more exceptions or something? Must have a cause … no?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2015 05:03 PM
Hi Dave,
what's the default value for latitude and longitude ?
<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.
what's the default value for latitude and longitude ?

<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.
