oracle express 11g异常怪异 [英] oracle express 11g exception weird
本文介绍了oracle express 11g异常怪异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
CREATE TABLE "EMPLOYEE"
("SSN" NUMBER(*,0) NOT NULL ENABLE,
"MANAGER_SSN" NUMBER(*,0) NOT NULL ENABLE,
"STREET" CHAR(40) NOT NULL ENABLE,
"CITY" CHAR(25) NOT NULL ENABLE,
"DEP_NO" NUMBER(*,0) NOT NULL ENABLE,
"NAME" CHAR(15) NOT NULL ENABLE,
"SALARY" NUMBER(8,2) NOT NULL ENABLE,
"HIRE_DATE" DATE,
CONSTRAINT "PK_EMPLOYEE" PRIMARY KEY ("SSN") ENABLE
)
当我尝试插入该表时:
insert into employee values (1,1,"cola","beirut",1,"mohamad",1500,"7-feb-1999")
它说: ORA-00984:此处不允许的列 这到底是什么 !!!!!为什么会发生此错误 这不是小写或大写字母的问题"
it says : ORA-00984: column not allowed here what the hell is this !!!!! why this error is happening " it is not a matter of small or capital letter "
推荐答案
似乎有两个独立的问题;
There seem to be two separate problems;
- 在Oracle中,您需要用
'
引用文字字符串,双引号用于引用对象名称以区分大小写. - 默认情况下,您的数据库似乎未使用
7-Feb-1999
日期格式,因此您必须告诉它所使用的格式.
- You need to quote literal strings with
'
in Oracle, double quotes are used for quoting object names for case sensitivity. - Your database does not seem to use the
7-Feb-1999
date format by default, so you'll have to tell it which format you're using.
总而言之,查询应该是
INSERT INTO employee
VALUES (1, 1, 'cola', 'beirut', 1, 'mohamad', 1500,
TO_DATE('7-feb-1999', 'DD-MON-YYYY'));
这篇关于oracle express 11g异常怪异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文