SQL 命令中缺少逗号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8241112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Missing comma in SQL command
提问by dato datuashvili
I have the following query for inserting values into myemp table:
我有以下用于将值插入 myemp 表的查询:
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato,'datuashvili','01-03-05');
after running it writes
运行后写
Error starting at line 7 in command:
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato,'datuashvili','01-03-05');
Error at Command Line:8 Column:21
Error report:
SQL Error: ORA-00917: missing comma
00917. 00000 - "missing comma"
*Cause:
*Action:
but I can't understand where I missed a comma.
但我不明白我在哪里漏了一个逗号。
回答by Zohaib
try this
尝试这个
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato','datuashvili','01-03-05');
' was missing after dato
' 在 dato 之后失踪
回答by Iljaas
You've missed a '
after dato
, that is why you've got the error.
你错过了'
after dato
,这就是为什么你有错误。
回答by robert
I think you missing a single quote for dato . ie, it must be
我认为您缺少 dato 的单引号。即,它必须是
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato','datuashvili','01-03-05');
回答by gprathour
it should be like this
应该是这样的
insert into myemp(employee_id,first_name,last_name,hire_date) values(1001,'dato','datuashvili','01-03-05');
回答by gandil
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato,'datuashvili','01-03-05');
should be
应该
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato','datuashvili','01-03-05');
you missed '
after dato
.
你错过了'
之后dato
。
回答by ypercube??
Besides the missing quote '
, you should look up how to use date types.
除了缺少的 quote '
,您应该查看如何使用日期类型。
What date is the '01-03-05'
?
什么日期'01-03-05'
?
Is it 1st-Mar-2005
?
是1st-Mar-2005
吗?
Is it Jan-3rd-2005
?
是Jan-3rd-2005
吗?
Is it 2001-Mar-5th
?
是2001-Mar-5th
吗?
Is it 1901-Mar-5th
?
是1901-Mar-5th
吗?
Why should the database guess? it's better to use a standard format like: '2005-03-01'
为什么要数据库猜测?最好使用标准格式,例如:'2005-03-01'
回答by Murtaza
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,**'dato,**'datuashvili','01-03-05');
It can be the appostrophe write
它可以是撇号写
insert into myemp(employee_id,first_name,last_name,hire_date)
values(1001,'dato','datuashvili','01-03-05');