开发者

DB2 - create table throws syntax error "(" unexpected

开发者 https://www.devze.com 2023-03-13 00:58 出处:网络
When I try to create table in db2, it throws the following error $ db2 CREATE TABLE employee(emp_id INT NOT NULL, emp_name VARCHAR(1开发者_如何学C00))

When I try to create table in db2, it throws the following error

$ db2 CREATE TABLE employee(emp_id INT NOT NULL, emp_name VARCHAR(1开发者_如何学C00))
sh: Syntax error: "(" unexpected

Please help. Thanks in advance


The problem is not DB2 but the shell. Use:

$ db2 "CREATE TABLE employee(emp_id INT NOT NULL, emp_name VARCHAR(100))"


Either you should use $db2 to enter interactive mode and next enter your statement without db2 or enter your statement as below:

$ db2 "CREATE TABLE employee(emp_id INT NOT NULL, emp_name VARCHAR(100))"

Generally, you need to use double quotes " as below:

$ db2 "insert ...."
$ db2 "delete ...."
...
0

精彩评论

暂无评论...
验证码 换一张
取 消