adit
adit

Reputation: 33654

SQL syntax creating table

What is the issue with the following SQL to create the table? It's executed in MySQL

CREATE TABLE friend_recommend(
  UID VARCHAR2(10) NOT NULL,
  FID VARCHAR2(10) NOT NULL,
  MID VARCHAR2(10) NOT NULL,
  DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (UID, FID, MID)
)

The error is:

#1064 - 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 'VARCHAR2(10) NOT NULL, FID VARCHAR2(10) NOT NULL, MID VARCHAR2(10) NOT NUL' at line 2


Upvotes: 0

Views: 3244

Answers (1)

bumperbox
bumperbox

Reputation: 10214

whats a VARCHAR2 ?
try changing it to VARCHAR

CREATE TABLE friend_recommend(
  UID VARCHAR(10) NOT NULL,
  FID VARCHAR(10) NOT NULL,
  MID VARCHAR(10) NOT NULL,
  DATE TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (UID, FID, MID)
)

Upvotes: 1

Related Questions