Advertisement
Fendhio

Untitled

Nov 12th, 2021
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- FUNCTION: public.fn_view_hr_pelamar_data_pribadi_pertanyaan(character varying, character varying)
  2.  
  3. -- DROP FUNCTION public.fn_view_hr_pelamar_data_pribadi_pertanyaan(character varying, character varying);
  4.  
  5. CREATE OR REPLACE FUNCTION public.fn_view_hr_pelamar_data_pribadi_pertanyaan(
  6.     character varying,
  7.     character varying)
  8.     RETURNS SETOF record
  9.     LANGUAGE 'plpgsql'
  10.     COST 100
  11.     VOLATILE PARALLEL UNSAFE
  12.     ROWS 1000
  13.  
  14. AS $BODY$
  15. declare
  16.  v_nik alias for $1;
  17.  v_kd_pertanyaan alias for $2;
  18.  rcd record;
  19. begin
  20. for rcd in
  21.  
  22. select nik,kode_pertanyaan,nama_pertanyaan,jawaban,jawaban_detail
  23. from hr_pelamar_pertanyaan_hasil
  24. where nik=v_nik and active=true and kode_pertanyaan=v_kd_pertanyaan
  25.  
  26. loop
  27.  return next rcd;
  28. end loop;
  29. /*
  30.  
  31. select * from fn_view_hr_pelamar_data_pribadi_pertanyaan ('1671061001970009','') as (
  32. nik varchar,kode_pertanyaan varchar,nama_pertanyaan text,jawaban varchar,jawaban_detail text)
  33.  
  34. */
  35. end
  36. $BODY$;
  37.  
  38. ALTER FUNCTION public.fn_view_hr_pelamar_data_pribadi_pertanyaan(character varying, character varying)
  39.     OWNER TO postgres;
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement