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