
                                    select Error_Message as "Error_Msg"
                                    from dbo.p_PersonPolis_upd(
                                        PersonPolis_id := '120101009627093',
                                        Server_id := (
                                            select
                                                case when (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '120101009627093') is null
                                                    then (select Server_id from dbo.v_PersonEvn  where PersonEvn_id = '120101009627093')
                                                    else (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '120101009627093')
                                                end
                                        ),
                                        Person_id := '113226',
                                        OmsSprTerr_id := '12670',
                                        PolisType_id := '4',
                                        OrgSmo_id := '691646',
                                        Polis_Ser := '',
                                        PolisFormType_id :='64',
                                        Polis_Num := '1278050889000178',
                                        Polis_begDate := '2017-07-01',
                                        Polis_endDate := NULL,
                                        pmUser_id := '389704413231'
                                    );
                                
