Annotation: office.get_offices

CREATE OR REPLACE FUNCTION office.get_offices()
RETURNS SETOF office.office_type

Information: office.get_offices

Schema office
Function Name get_offices
Arguments
Owner postgres
Result Type SETOF office.office_type
Description

Implementation: office.get_offices

CREATE OR REPLACE FUNCTION office.get_offices()
 RETURNS SETOF office.office_type
 LANGUAGE plpgsql
 STABLE
AS $function$
BEGIN
    RETURN QUERY
    SELECT office_id, office_code,office_name,street || ' ' || city AS Address FROM office.offices
    ORDER BY parent_office_id NULLS LAST;
END
$function$