ORA-00936:缺少表达式00936。00000-“缺少表达式” *原因:

时间:2019-02-05 00:38:13

标签: sql oracle

ORA-00936: missing expression
00936. 00000 -  "missing expression"
*Cause:    
*Action:

create table programer(IDNO NUMBER, PROJECTID VARCHAR(5),LASTNAME VARCHAR(30),FIRSTNAME VARCHAR(30),HIRINGDATE DATE('YYYY-MM-DD') ,LANGUAGES VARCHAR(15),TASKNO INT,Privileges VARCHAR(25));

desc programer;
INSERT INTO PROGRAMER VALUES(201,'NPR','GUPTA','SAURAV',to_date('01-05-95', 'mm-dd-yy'),'VB',52,'SECRET');
INSERT INTO PROGRAMER VALUES(390,'KCW','GHOSH','PINKY',to_date('01-05-93', 'mm-dd-yy'),'JAVA',11,'TOPSECRET');
INSERT INTO PROGRAMER VALUES(789,'RNC','AGARWAL','PRAVEEN',to_date('08-03-98', 'mm-dd-yy'),'VB',11,'SECRET');
INSERT INTO PROGRAMER VALUES(134,'TIPPS','CHAUDHURY','SUPRIYO',to_date('07-15-95', 'mm-dd-yy'),'C++',52,'SECRET');
INSERT INTO PROGRAMER VALUES(896,'KCW','GJHA','RANJIT',to_date('06-15-97', 'mm-dd-yy'),'JAVA',10,'TOPSECRET');
INSERT INTO PROGRAMER VALUES(345,'TIPPS','JOHN','PETER',to_date('11-15-99', 'mm-dd-yy'),'JAVA',52,'');
INSERT INTO PROGRAMER VALUES(563,'NITTS','ANDERSON','ANDY',to_date('08-15-94', 'mm-dd-yy'),'C++',89,'CONFIDENTIAL');

SELECT IDNO, PROJECTID,LASTNAME,FIRSTNAME,HIRINGDATE,LANGUAGES,TASKNO ,Privileges FROM PROGRAMER;

3 个答案:

答案 0 :(得分:0)

您好,您的CREATE TABLE语句需要进行以下纠正:

create table programer(IDNO NUMBER, PROJECTID VARCHAR(5),LASTNAME VARCHAR(30),FIRSTNAME VARCHAR(30),HIRINGDATE DATE ,LANGUAGES VARCHAR(15),TASKNO INT,Privileges VARCHAR(25));

答案 1 :(得分:0)

DATE数据类型不带任何参数。您需要将HIRINGDATE DATE('YYYY-MM-DD')的代币更改为

HIRINGDATE  DATE,

DATE值没有以任何格式存储,因此尝试指定一个值没有意义。

答案 2 :(得分:0)

创建表程序1(IDNO NUMBER,PROJECTID VARCHAR(5),LASTNAME VARCHAR(30),FIRSTNAME VARCHAR(30),HIRINGDATE DATE,LANGUAGES VARCHAR(15),TASKNO INT,Privileges1 VARCHAR(25)); desc programer1;