Annotation: office.get_logged_in_culture

CREATE OR REPLACE FUNCTION office.get_logged_in_culture(_user_id integer)
RETURNS text

Information: office.get_logged_in_culture

Schema office
Function Name get_logged_in_culture
Arguments _user_id integer
Owner postgres
Result Type text
Description

Implementation: office.get_logged_in_culture

CREATE OR REPLACE FUNCTION office.get_logged_in_culture(_user_id integer)
 RETURNS text
 LANGUAGE plpgsql
AS $function$
BEGIN
    RETURN
    (
        SELECT culture
        FROM audit.logins
        WHERE user_id=$1
        AND login_date_time = 
        (
            SELECT MAX(login_date_time)
            FROM audit.logins
            WHERE user_id=$1
        )
    );
END
$function$