October 2002
Intermediate to advanced
688 pages
14h 14m
English
| 1) | Write a stored function called new_student_id that takes in no parameters and returns a student.student_id%TYPE. The value returned will be used when inserting a new student into the CTA application. It will be derived by using the formula: student_id_seq.NEXTVAL. |
| A1: |
Answer: Your answer should look similar to the following:
CREATE OR REPLACE FUNCTION new_student_id
RETURN student.student_id%TYPE
AS
v_student_id student.student_id%TYPE;
BEGIN
SELECT student_id_seq.NEXTVAL
INTO v_student_id
FROM dual;
RETURN(v_student_id);
END; |
| 2) | Write a stored function called zip_does_not_exist that takes in a zipcode.zip%TYPE
|
Read now
Unlock full access