CREATE OR REPLACE FUNCTION dkb_pdak.getNamaProp(no_propin NUMBER)
RETURN VARCHAR2 deterministic IS
nama_propin  setup_prop.nama_prop%TYPE;
BEGIN
SELECT nama_prop INTO  nama_propin FROM setup_prop WHERE
no_prop=no_propin;
RETURN(nama_propin);
END;
/
CREATE OR REPLACE FUNCTION dkb_pdak.getNamaKab(no_kabin NUMBER,no_propin NUMBER)
RETURN VARCHAR2 IS
nama_kabin setup_kab.nama_kab%TYPE;
BEGIN
 SELECT nama_kab INTO nama_kabin FROM setup_kab WHERE no_kab=no_kabin AND no_prop=no_propin;
RETURN(trim(nama_kabin));
END;
/
CREATE OR REPLACE FUNCTION dkb_pdak.getNamaKec(no_kecin NUMBER,no_kabin NUMBER,no_propin NUMBER)
RETURN VARCHAR2 IS
nama_kecin  setup_kec.nama_kec%TYPE;
BEGIN
SELECT nama_kec INTO  nama_kecin FROM setup_kec WHERE
no_kec=no_kecin
AND
no_kab=no_kabin
AND
no_prop=no_propin;
RETURN(nama_kecin);
END;
/
CREATE OR REPLACE function dkb_pdak.getNamaKel(no_kelin NUMBER,no_kecin NUMBER,no_kabin NUMBER,no_propin NUMBER)
RETURN VARCHAR2 IS
nama_kelin  setup_kel.nama_kel%TYPE DEFAULT '-';
BEGIN
SELECT decode(nama_kel,null,'-',nama_kel) INTO  nama_kelin FROM setup_kel WHERE
no_kel=no_kelin
AND
no_kec=no_kecin
AND
no_kab=no_kabin
AND
no_prop=no_propin;
RETURN(nama_kelin);
END;
/
exit;
