public override string Delim(string val, DelimType dt) { switch (dt) { case DelimType.Parameter: return('@' + val); case DelimType.String: return("'" + val.Replace("'", "''") + "'"); default: return('`' + val.Replace("`", "``") + '`'); } }
public bool Check(DelimType typ) { foreach (Pullenti.Ner.MetaToken d in Delims) { if ((d is DelimToken) && (((d as DelimToken).Typ & typ)) != DelimType.Undefined) { return(true); } else if ((d is Pullenti.Ner.Core.ConjunctionToken) && typ == DelimType.And) { return(true); } } return(false); }
public override string Delim(string input, DelimType type) { switch (type) { case DelimType.Database: case DelimType.Schema: case DelimType.Table: case DelimType.Column: return '[' + input + ']'; case DelimType.Parameter: return '@' + input; case DelimType.String: return '"' + input.Replace("\"", "\\\"") + '"'; default: throw new Exception("Unrecognized [DelimType].[" + type.ToString() + "]."); } }
public abstract string Delim(string val, DelimType dt);