• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt regarding jdbc syntax error while creating a table  RSS feed

 
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
 
author
Bartender
Posts: 4093
21
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.
 
Marshal
Posts: 56898
174
  • 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
Boost this thread!