Ejemplo n.º 1
0
        public static ArrayList GetSPParamDefaultValue(string spDefinition)
        {
            var             results = new ArrayList();
            MatchCollection o       = null;
            string          expr    =
                "\\s*@(?<nm>\\w+)\\s*" +
                "(?<type>[^\\s\\(]+\\s*\\(\\s*((\\w+\\s*\\))|(\\d+\\s*\\))|(\\d+\\s*,\\s*\\d+\\s*\\))))\\s*=\\s*" +
                "(?<defvalueStr>((?<!(?-i)N*')(?<defvalue>\\w+)\\s*)|((?-i)N*'" +
                "(?<defvalue>(((?<![^']')''(?!'[^']))|([^']))*)" +
                "'))\\s*(,|\\))";

            regexUtil.regexFun(spDefinition, expr, null, (regexUtil.regexAct) 2, null, 0, 0, ref o, -1);
            int idx = 0;

            foreach (Match m in o)
            {
                var spparam = new SPParameters();
                spparam.ParamID           = new SqlInt32(idx);
                spparam.ParamName         = new SqlString(m.Groups["nm"].Value);
                spparam.ParamType         = new SqlString(m.Groups["type"].Value);
                spparam.ParamDefaultStr   = new SqlString(m.Groups["defvalueStr"].Value);
                spparam.ParamDefaultValue = new SqlString(m.Groups["defvalue"].Value);
                idx++;
                results.Add(spparam);
            }
            return(results);
        }
Ejemplo n.º 2
0
 public static ArrayList GetSPParamDefaultValue(string spDefinition) {
     var results = new ArrayList();
     MatchCollection o = null;
     string expr =
         "\\s*@(?<nm>\\w+)\\s*" +
         "(?<type>[^\\s\\(]+\\s*\\(\\s*((\\w+\\s*\\))|(\\d+\\s*\\))|(\\d+\\s*,\\s*\\d+\\s*\\))))\\s*=\\s*" +
         "(?<defvalueStr>((?<!(?-i)N*')(?<defvalue>\\w+)\\s*)|((?-i)N*'" +
         "(?<defvalue>(((?<![^']')''(?!'[^']))|([^']))*)" +
         "'))\\s*(,|\\))";
     regexUtil.regexFun(spDefinition, expr, null, (regexUtil.regexAct)2, null, 0, 0, ref o, -1);
     int idx = 0;
     foreach (Match m in o) {
         var spparam = new SPParameters();
         spparam.ParamID = new SqlInt32(idx);
         spparam.ParamName = new SqlString(m.Groups["nm"].Value);
         spparam.ParamType = new SqlString(m.Groups["type"].Value);
         spparam.ParamDefaultStr = new SqlString(m.Groups["defvalueStr"].Value);
         spparam.ParamDefaultValue = new SqlString(m.Groups["defvalue"].Value);
         idx++;
         results.Add(spparam);
     }
     return results;
 }