Skip to content
Snippets Groups Projects
Commit 52fadb00 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

ADD: stored procedure to move disciplines into new study plans #507

parent e4c1e3a4
No related merge requests found
DROP FUNCTION IF EXISTS public.discipline_move(pstudyplanid integer, pdisciplineid integer, psemesterid integer);
CREATE OR REPLACE FUNCTION public.plan_binddiscipline(pstudyplanid integer, pdisciplineid integer, psemesterid integer)
RETURNS integer
LANGUAGE plpgsql
AS $function$
BEGIN
UPDATE disciplines_study_plans set studyplanid = pstudyplanid
WHERE disciplines_study_plans.disciplineid = pdisciplineid;
UPDATE disciplines set semesterid = psemesterid
WHERE disciplines.id = pdisciplineid;
RETURN 0;
EXCEPTION
when others then RETURN -1;
END
$function$;
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment