ByteSlice Conv_String(ByteSlice value, int ResultSize, DbFunctionTools tools) { mstring x = tools.GetString(value); x = x.ToUpperM(); DbValue v = tools.AllocValue(x, ResultSize); return(v.Eval()); }
public static DbValue UPPER(DbFunctionTools tools, DbFunctionArguments args) { string FunctionName = "UPPER"; args.EnsureCount(FunctionName, 1); DbType arg0type; ByteSlice arg0 = args[0].Eval(out arg0type); if (Types.IsNullValue(arg0)) { return(tools.AllocNullValue()); // Give a null, take a null. } if (arg0type.ID != DbTypeID.CHARS) { args.Expected(FunctionName, 0, "input CHAR(n), got " + arg0type.Name.ToUpper()); } mstring x = tools.GetString(arg0); mstring upper = x.ToUpperM(); return(tools.AllocValue(upper)); }