Posted - 05/25/2014 : 16:15:43
I have an SQL procedure which enables a user to easily insert records into my database. The code is given below:
CREATE PROCEDURE add_enrollment (IN s_id CHAR(4), IN c_code CHAR(2), e_date DATE)
INSERT INTO enrollment
VALUES (s_id, c_code, e_date);
The procedure enables the user to add a new record to the enrollment table; student_id, course_code and enrollment_date. What I need it to do is have an output parameter return a string of text identifying the reason(s) for the failure. I am relatively new to SQL so I am a bit at a loss. Could anyone help?