CREATE getSubdist(IN arg VARCHAR(6), OUT varchar(255));

BEGIN       
 DECLARE ret VARCHAR(255) ;       
 SELECT subdistname INTO ret FROM csubdistrict WHERE concat(provcode,distcode,subdistcode) = arg;
       IF  ret is NULL THEN RETURN '-';
        END IF;        
 RETURN (ret);   
END


