aspose file tools*
The moose likes JDBC and the fly likes doubt regarding jdbc syntax error while creating a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "doubt regarding jdbc syntax error while creating a table" Watch "doubt regarding jdbc syntax error while creating a table" New topic
Author

doubt regarding jdbc syntax error while creating a table

suresh mandalapu
Ranch Hand

Joined: Sep 14, 2008
Posts: 32
hi.. i am using mysql 5.1.3 version.. when i try to create a table it is giving the following error..please help..
create table EVENTS (EVENT_ID bigint generated by default as identity (start with 1), EVENT_DATE timestamp, title varchar(255), primary key (EVENT_ID))
the error is
you have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'generated by default as identity (start with 1), EVENT_DATE timestamp, title var' at line 1
.......................
schema export complete..
............................

thanks
suresh
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

The error is pretty helpful here, your syntax is wrong. Find an example of good syntax for events in mysql and use that.


My Blog: Down Home Country Coding with Scott Selikoff
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
There is no such data type as "generated by default etc". There is a shorthand type in MySQL which you should find in the manual.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt regarding jdbc syntax error while creating a table