Syntax problem using 'AUTO-INCREMENT
Posted by: Sam
Date: March 23, 2005 09:35AM

I've been bangin my head against a brick wall over this can any one see my error. The error that is throw is wrong syntax near (priKey) ? I've been using the tutorial but no joy......

statement.executeUpdate("CREATE TABLE `"
+ beachName
+ "` ( priKey INT NOT NULL AUTO_INCREMENT, "
+ "`BEACH_NAME` VARCHAR(30), `SCORE` INTEGER, `DATE` VARCHAR(15), "
+ "`TIME` INTEGER, `DATEOFFILE` VARCHAR(15), `PRIMARY_KEY` (priKey) )");

statement.executeUpdate("INSERT INTO `" + beachName
+ "` values ('" + beachName + "','" + score + "', '"
+ date + "' , '" + time + "','" + dateOfFile + "' )"
,Statement.RETURN_GENERATED_KEYS);

Options: ReplyQuote


Subject
Written By
Posted
Syntax problem using 'AUTO-INCREMENT
Sam
March 23, 2005 09:35AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.