CREATE OR REPLACE FUNCTION get_student_rec (p_student_id IN NUMBER)
RETURN STUDENT%ROWTYPE
AUTHID CURRENT_USER
RESULT_CACHE RELIES_ON (student)
IS
v_student_rec STUDENT%ROWTYPE;
BEGIN
SELECT *
INTO v_student_rec
FROM student
WHERE student_id = p_student_id;
RETURN v_student_rec;
EXCEPTION
WHEN no_data_found
THEN
RETURN NULL;
END get_student_rec;
/
— Execute newly created function
DECLARE
v_student_rec STUDENT%ROWTYPE;
BEGIN
v_student_rec := get_student_rec (p_student_id => 230);
END;
I welcome you all with this PLSQL code sample.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)