Skip to content
Advertisement

How do I fix this error: ORA-00933: SQL command not properly ended

Got this error while trying to enter values for 2 different tables on Oracle APEX and need help figuring out where I went wrong. I’m not sure if it’s because I made a typo somewhere or it’s because I’m just doing it all wrong.

INSERT INTO copy_student_course_details (grade, student_id, course_id)
VALUES ('A', 720, 190);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
        VALUES ('A', 750, 192);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('B', 760, 190);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('A', 770, 194);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('B', 720, 193);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('C', 730, 191);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('F', 740, 195);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('C', 760, 192);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('D', 770, 192);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
    VALUES ('F', 770, 193);

INSERT INTO copy_faculty_course_details (contact_hours, faculty_id, course_id)
    VALUES (3, 800, 192);

INSERT INTO copy_faculty_course_details (contact_hours, faculty_id, course_id)
    VALUES (4, 800, 193);

INSERT INTO copy_faculty_course_details (contact_hours, faculty_id, course_id)
    VALUES (5, 800, 190);

INSERT INTO copy_faculty_course_details (contact_hours, faculty_id, course_id)
    VALUES (3, 800, 191);

INSERT INTO copy_faculty_course_details (contact_hours, faculty_id, course_id)
    VALUES (4, 810, 194);

INSERT INTO copy_faculty_course_details (contact_hours, faculty_id, course_id)
    VALUES (5, 810, 195);

Advertisement

Answer

In APEX you have a SQL commands editor, and a script runner.

A script can contain multiple commands, and they are run one after the other. In the SQL commands window, we run a single command, so after your first insert we are expecting to be done, and hence, when we find more content…we think you first command was not properly ended.

So either save this as a script and run it as a script, or you can run the entire insert as a PLSQL anonymous block, ie

begin
  INSERT INTO copy_student_course_details (grade, student_id, course_id)
VALUES ('A', 720, 190);

INSERT INTO copy_student_course_details (grade, student_id, course_id)
        VALUES ('A', 750, 192);
 ...
...
end;
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement