
                                    select Error_Message as "Error_Msg"
                                    from dbo.p_PersonPolis_upd(
                                        PersonPolis_id := '110101005139075',
                                        Server_id := (
                                            select
                                                case when (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '110101005139075') is null
                                                    then (select Server_id from dbo.v_PersonEvn  where PersonEvn_id = '110101005139075')
                                                    else (select Server_id from dbo.v_PersonEvn where Server_id = '0' and PersonEvn_id = '110101005139075')
                                                end
                                        ),
                                        Person_id := '161419',
                                        OmsSprTerr_id := '11989',
                                        PolisType_id := '4',
                                        OrgSmo_id := '44',
                                        Polis_Ser := '',
                                        PolisFormType_id :='110101000000023',
                                        Polis_Num := '1167650869000025',
                                        Polis_begDate := '2013-03-18',
                                        Polis_endDate := NULL,
                                        pmUser_id := '393684176597'
                                    );
                                
