Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE PROCEDURE get_group_exams_and_tests(
- IN group_name VARCHAR(16),
- IN semester_num INTEGER,
- INOUT refcursor REFCURSOR = 'results'
- )
- LANGUAGE plpgsql
- AS $$
- BEGIN
- OPEN refcursor FOR
- SELECT
- s.Name AS subject_name,
- s.Control AS control_type
- FROM
- Subject s
- JOIN
- Groupa g ON s.Specialization = g.Specialization
- WHERE
- g.Name = group_name
- AND s.Semester = semester_num
- ORDER BY
- s.Control, s.Name asc;
- END;
- $$;
- CALL get_group_exams_and_tests('23-01B', 1);
- FETCH ALL FROM results;
Advertisement
Add Comment
Please, Sign In to add comment