Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt regarding jdbc syntax error while creating a table

 
suresh mandalapu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Saloon Keeper
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is pretty helpful here, your syntax is wrong. Find an example of good syntax for events in mysql and use that.
 
Campbell Ritchie
Sheriff
Posts: 51419
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic