Skip navigation links

MySQL Forums :: Newbie :: Why syntax error for this CREATE TABLE and INSERT script?


Advanced Search

Why syntax error for this CREATE TABLE and INSERT script?
Posted by: Peter Steiner ()
Date: May 12, 2013 04:03AM

When I enter the following scripts I get the mentioned errors. Why?

DROP TABLE tab_tablewithblobs;

CREATE TABLE tab_tablewithblobs
(
id bigint PRIMARY KEY NOT NULL,
TAB_SOMEFIELD int,
TAB_TINYIMAGE tinyblob,
TAB_IMAGE blob,
TAB_MEDIMAGE mediumblob,
TAB_LONGIMAGE longblob
)
;
CREATE UNIQUE INDEX PRIMARY ON tab_tablewithblobs(id)
;

....>Error: 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 'PRIMARY ON tab_tablewithblobs(id)' at line 1
SQLState: 42000
ErrorCode: 1064
Error occured in:
CREATE UNIQUE INDEX PRIMARY ON tab_tablewithblobs(id)



and

INSERT INTO tab_tablewithblobs (2,2222, NULL, LOAD_FILE('D:/tmp/dummyblob.gif'));


----> Error: 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 '2,2222, NULL, LOAD_FILE('D:/tmp/dummyblob.gif'))' at line 1
SQLState: 42000
ErrorCode: 1064

Options: ReplyQuote


Subject Written By Posted
Why syntax error for this CREATE TABLE and INSERT script? Peter Steiner 05/12/2013 04:03AM
Re: Why syntax error for this CREATE TABLE and INSERT script? John Smith 05/12/2013 08:11AM
Re: Why syntax error for this CREATE TABLE and INSERT script? Peter Steiner 05/23/2013 05:36AM
Re: Why syntax error for this CREATE TABLE and INSERT script? John Smith 05/23/2013 03:35PM


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.