
                                    select Error_Message as "Error_Msg"
                                    from dbo.p_PersonPolis_upd(
                                        PersonPolis_id := '120101015415258',
                                        Server_id := (
                                            select
                                                case when (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '120101015415258') is null
                                                    then (select Server_id from dbo.v_PersonEvn  where PersonEvn_id = '120101015415258')
                                                    else (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '120101015415258')
                                                end
                                        ),
                                        Person_id := '94156',
                                        OmsSprTerr_id := '12670',
                                        PolisType_id := '4',
                                        OrgSmo_id := '691646',
                                        Polis_Ser := '',
                                        PolisFormType_id :='64',
                                        Polis_Num := '1247240835000129',
                                        Polis_begDate := '2021-02-26',
                                        Polis_endDate := NULL,
                                        pmUser_id := '394458003243'
                                    );
                                
