Untitled

mail@pastecode.io avatar
unknown
pgsql
2 months ago
1.0 kB
4
Indexable
Never
CREATE OR REPLACE FUNCTION public.get_report_lcr_esaf_vs_woesaf(ahass_id character varying)
 RETURNS TABLE(unit_name character varying, nomor_mesin character varying, nomor_rangka character varying, dealerid character varying, last_update character varying, not_checked_yet boolean, not_willing_check boolean, reason character varying, lcr_check boolean, lcr_treatment_1 boolean, lcr_treatment_2 boolean, lcr_ganti boolean, done boolean)
 LANGUAGE plpgsql
AS $function$
begin
	RETURN QUERY
	select *
	from dblink('dbname=ddmsh2_cbr host=localhost user=ddmsh2app password=bandungh1h2h3 port=5432'::text, 
			format('SELECT * FROM get_report_lcr(%L)', ahass_id)) report
			(unit_name character varying, nomor_mesin character varying, nomor_rangka character varying, dealerid character varying, last_update character varying, not_checked_yet boolean, not_willing_check boolean, reason character varying, 
				lcr_check boolean, lcr_treatment_1 boolean, lcr_treatment_2 boolean, lcr_ganti boolean, done boolean);
end; $function$
;
Leave a Comment