
            with cte as (
                SELECT CASE WHEN NULL IS NOT NULL THEN
                    (select Server_id from PersonPolis  where PersonPolis_id = NULL limit 1)
                    ELSE 0 END as srv_id
            )
            select
                PersonPolis_id as "PersonPolis_id",
                Polis_id as "Polis_id",
                Error_Code as "Error_Code",
                Error_Message as "Error_Msg"
            from p_PersonPolis_ins(
                Polis_id := null,
                PersonPolis_id := NULL,
                Server_id := (select srv_id from cte),
                Person_id := '426898',
                OMSSprTerr_id := '11989',
                OrgSMO_id := '43',
                PolisType_id := '4',
                PolisFormType_id := NULL,
                Polis_Ser := NULL,
                Polis_Num := '1149320884000318',
                Polis_begDate := '2013-02-13',
                PersonPolis_insDT := '2013-02-13',
                Polis_endDate := NULL,
                pmUser_id := '406391292970');
        
