0
INSERT INTO STUDENT_RECORD_DATABASE
  (ROLLNO,FIRST_NAME,MIDDLE_NAME,LAST_NAME,CONTACT,CONTACT1,CONTACT2,ADDRESS,GRADE,DIVID,BLOOD_GROUP,HID,DATE_OF_BIRTH,TRANSPORT,SNAME,MEAL,BUSNO,RUTNO,DID,AID,CARD_TYPE,CARD_NO)
VALUES
 (135,'SHRENIK','ATUL','VAJPEYEE', 8852140367, 7698555412, 235599, 'LEN Q BEHIND DWARKA HOTEL', '9TH','40', 'AB-VE' ,13,'To_Date ('15-Aug-1997','dd-Mon-YYYY') ', 'NO' ,'DWARKA' ,'NO' ,'MH 04 3215' ,1,515,311, 'ESCORT' ,1062)

'To_Date ('15-Aug-1997','dd-Mon-YYYY') ', * 第 15 行的错误:ORA-00917:缺少逗号

但是所有逗号都存在,我需要指定这种日期格式。

4

2 回答 2

3

您不必在TO_DATE()函数中加上单引号。像这样:

INSERT INTO STUDENT_RECORD_DATABASE (ROLLNO,FIRST_NAME,MIDDLE_NAME,LAST_NAME,CONTACT,CONTACT1,CONTACT2,ADDRESS,GRADE,DIVID,BLOOD_GROUP,HID,DATE_OF_BIRTH,TRANSPORT,SNAME,MEAL,BUSNO,RUTNO,DID,AID,CARD_TYPE,CARD_NO)

VALUES
 (135,'SHRENIK','ATUL','VAJPEYEE', 8852140367, 7698555412, 235599, 'LEN Q BEHIND DWARKA HOTEL', '9TH','40', 'AB-VE' ,13,To_Date('15-Aug-1997','dd-Mon-YYYY'), 'NO' ,'DWARKA' ,'NO' ,'MH 04 3215' ,1,515,311, 'ESCORT' ,1062)
于 2013-01-23T05:09:09.197 回答
2

TO_DATE() 是一个函数而不是字符串文字,因此您需要删除它周围的单引号。

于 2013-01-23T05:23:05.037 回答