0

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


1
  • what error did mysql give you? Commented Apr 30, 2011 at 5:35

1 Answer 1

1

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)
)
Sign up to request clarification or add additional context in comments.

1 Comment

VARCHAR2 is an Oracle datatype, there is no such creature in MySQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.