加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle错误,列不允许在这里

发布时间:2020-12-12 13:48:58 所属栏目:百科 来源:网络整理
导读:我没有使用Oracle一段时间,所以我有点生锈. 这是我的表: create table calendar(username VARCHAR2(12),content VARCHAR2(100),dateContent DATE,type CHAR(3) CHECK (type IN ('PUB','PRV'))); 但是当我尝试插入一个这样的值时: insert into calendar(use
我没有使用Oracle一段时间,所以我有点生锈.

这是我的表:

create table calendar(
username VARCHAR2(12),content VARCHAR2(100),dateContent DATE,type CHAR(3) CHECK (type IN ('PUB','PRV')));

但是当我尝试插入一个这样的值时:

insert into calendar
(username,content,dateContent,type) 
values
(chris,assignment due,to_date('01-OCT-2010 13:00','DD-MON-YYYY HH24:MI'),PUB)
/

我正进入(状态:

ORA-00984: column not allowed here

指向最后的类型列.我有一种感觉,我没有得到正确的DATE字段,因为我从来没有真正使用它.

我做错了什么?

您需要在varchar2值之间加上引号

就像是

insert into calendar(username,type) 
  values('chris','assignment due','PUB');

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读