Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE FUNCTION public.provjeri_ekspertizu()
- RETURNS trigger
- LANGUAGE plpgsql
- AS $function$
- declare
- ekspertizaId int;
- brojiEkspertize int;
- begin
- select ekspertiza_id into ekspertizaId
- from zaposlenik where id = new.zaposlenik_id;
- select count(*) into brojiEkspertize
- from zahtjeva where zahtjeva.projekt_id = new.projekt_id and zahtjeva.ekspertiza
- if brojiEkspertize !=0 then
- raise notice 'Uredu!';
- return new;
- else
- raise exception 'Nema potrebne ekspertize';
- return null;
- end if;
- end; language plpgsql;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement