Annotation: core.has_child_accounts

CREATE OR REPLACE FUNCTION core.has_child_accounts(bigint)
RETURNS boolean

Information: core.has_child_accounts

Schema core
Function Name has_child_accounts
Arguments bigint
Owner postgres
Result Type boolean
Description

Implementation: core.has_child_accounts

CREATE OR REPLACE FUNCTION core.has_child_accounts(bigint)
 RETURNS boolean
 LANGUAGE plpgsql
AS $function$
BEGIN
    IF EXISTS(SELECT 0 FROM core.accounts WHERE parent_account_id=$1 LIMIT 1) THEN
        RETURN true;
    END IF;

    RETURN false;
END
$function$