Consider the following PL/SQL script: SET SERVEROUTPUT ON BEGIN INSERT INTO COURSE (course_no, description, created_by, created-date, modified_by, modified_date) VALUES (course_no_seq.nextval, ‘database development’, USER, SYSDATE); COMMIT DBMS_OUTPUT.PUT_LINE (‘One course has been added’); END; Assumptions: All the COURSE table fields have check constraints defined on them indicating that none can be null. Explain why the script does not execute successfully. Add a user-defined exception to the script, so that the error generated by the INSERT statement is handled. Assign the code 2290 to this exception
Consider the following PL/SQL script: SET SERVEROUTPUT ON BEGIN INSERT INTO COURSE (course_no, description, created_by, created-date, modified_by, modified_date) VALUES (course_no_seq.nextval, ‘database development’, USER, SYSDATE); COMMIT DBMS_OUTPUT.PUT_LINE (‘One course has been added’); END; Assumptions: All the COURSE table fields have check constraints defined on them indicating that none can be null. Explain why the script does not execute successfully. Add a user-defined exception to the script, so that the error generated by the INSERT statement is handled. Assign the code 2290 to this exception
Chapter3: Creating Tables
Section: Chapter Questions
Problem 4CAT
Related questions
Question
Consider the following PL/SQL script:
SET SERVEROUTPUT ON
BEGIN
INSERT INTO COURSE
(course_no, description, created_by, created-date, modified_by, modified_date)
VALUES
(course_no_seq.nextval, ‘
COMMIT
DBMS_OUTPUT.PUT_LINE (‘One course has been added’);
END;
Assumptions: All the COURSE table fields have check constraints defined on them indicating that none can be null.
- Explain why the script does not execute successfully.
- Add a user-defined exception to the script, so that the error generated by the INSERT statement is handled. Assign the code 2290 to this exception.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr