
                                    select Error_Message as "Error_Msg"
                                    from dbo.p_PersonPolis_upd(
                                        PersonPolis_id := '400101018796572',
                                        Server_id := (
                                            select
                                                case when (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '400101018796572') is null
                                                    then (select Server_id from dbo.v_PersonEvn  where PersonEvn_id = '400101018796572')
                                                    else (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '400101018796572')
                                                end
                                        ),
                                        Person_id := '78653',
                                        OmsSprTerr_id := '2210',
                                        PolisType_id := '4',
                                        OrgSmo_id := '1890549',
                                        Polis_Ser := '',
                                        PolisFormType_id :='400101000000002',
                                        Polis_Num := '4091889789000104',
                                        Polis_begDate := '2020-03-26',
                                        Polis_endDate := NULL,
                                        pmUser_id := '431525288958'
                                    );
                                
