ORA-00917:缺少逗号。 INSERT INTO语句

时间:2016-07-04 23:30:17

标签: sql oracle ora-00917

当我尝试使用INSERT INTO时,我在所有3个语句中都出现了一个错误的逗号错误,多次检查它,谢谢。

INSERT INTO staff 
(staff_id, staff_name, address, d_o_b, email, phone_number, salary, hire_date, job_role, nationality, over_time, bonus, caravan_park_id)
VALUES 
(1.NEXTVAL, 'Simon Gould', '17 Pearson Grove', '13/10/92', 'sjpdsg@happyholidays.net', 07817333245, '24000', '13/10/15', 'engineer', 'Portuguese', '10 hours', '£500', 1.nextval);
INSERT INTO staff 
(staff_id, staff_name, address, d_o_b, email, phone_number, salary, hire_date, job_role, nationality, over_time, bonus, caravan_park_id)
VALUES 
(2.NEXTVAL, 'Josh Dawkins', '28 Mulholland Drive', '12/09/82', 'jd1982@happyholidays.net', 07801123456, '15000', '02/05/11', 'engineer', 'English', '6 hours', '£300', 2.nextval);
INSERT INTO staff 
(staff_id, staff_name, address, d_o_b, email, phone_number, salary, hire_date, job_role, nationality, over_time, bonus, caravan_park_id)
VALUES
(3.NEXTVAL, 'Michelle Arazanguiz', '75 Newport Way', '21/03/90', 'ma_holidays@happyholidays.net', 07323456456, '16000', '05/11/08', 'tour guide', 'Spanish', '0 hours', '£0', 3.nextval);

1 个答案:

答案 0 :(得分:1)

根据the Oracle documentation,您的查询应该是:

INSERT INTO staff 
(staff_id, staff_name, address, d_o_b, email, phone_number, salary, hire_date, job_role, nationality, over_time, bonus, caravan_park_id)
VALUES 
(staff_id.NEXTVAL, 'Simon Gould', '17 Pearson Grove', '13/10/92', 'sjpdsg@happyholidays.net', 07817333245, '24000', '13/10/15', 'engineer', 'Portuguese', '10 hours', '£500', caravan_park_id.nextval);
INSERT INTO staff 
(staff_id, staff_name, address, d_o_b, email, phone_number, salary, hire_date, job_role, nationality, over_time, bonus, caravan_park_id)
VALUES 
(staff_id.NEXTVAL, 'Josh Dawkins', '28 Mulholland Drive', '12/09/82', 'jd1982@happyholidays.net', 07801123456, '15000', '02/05/11', 'engineer', 'English', '6 hours', '£300', caravan_park_id.nextval);
INSERT INTO staff 
(staff_id, staff_name, address, d_o_b, email, phone_number, salary, hire_date, job_role, nationality, over_time, bonus, caravan_park_id)
VALUES
(staff_id.NEXTVAL, 'Michelle Arazanguiz', '75 Newport Way', '21/03/90', 'ma_holidays@happyholidays.net', 07323456456, '16000', '05/11/08', 'tour guide', 'Spanish', '0 hours', '£0', caravan_park_id.nextval);

也就是说,使用staff_id.NEXTVALcaravan_park_id.nextval来表示您希望这两个序列中的下一个值。