the code:

CREATE TABLE `mysql`.`emp` (
`EmpNo` INT NOT NULL,
`EmpName` VARCHAR NOT NULL,
`Job` VARCHAR NOT NULL,
`Mgr` INT ,
`Hiredate` DATE NOT NULL,
`Sal` INT NOT NULL,
`Comm` INT ,
`DeptNo` INT NOT NULL
)
ENGINE = MyISAM;

the error:

Error executing SQL commands to create table.
MySQL Error Nr. 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 'NOT NULL,
`Job` VARCHAR NOT NULL,
`Mgr` INT ,
`Hiredate` DATE NOT NULL,
' at line 3

Recommended Answers

All 5 Replies

please anyone help me...

IIRC, VARCHAR needs a length defined for the field. So the correct syntax would be:
`EmpName` VARCHAR (10) NOT NULL,

thnks...

So - You good with that or need more help?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.