
                                    select Error_Message as "Error_Msg"
                                    from dbo.p_PersonPolis_upd(
                                        PersonPolis_id := '110101003897767',
                                        Server_id := (
                                            select
                                                case when (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '110101003897767') is null
                                                    then (select Server_id from dbo.v_PersonEvn  where PersonEvn_id = '110101003897767')
                                                    else (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '110101003897767')
                                                end
                                        ),
                                        Person_id := '230145',
                                        OmsSprTerr_id := '11989',
                                        PolisType_id := '4',
                                        OrgSmo_id := '44',
                                        Polis_Ser := '',
                                        PolisFormType_id :='110101000000022',
                                        Polis_Num := '1155640887000291',
                                        Polis_begDate := '2016-06-09',
                                        Polis_endDate := NULL,
                                        pmUser_id := '406391211828'
                                    );
                                
