protected override string GetComparisonLike(expression ex, bool caseInsensitive) { if (caseInsensitive) { /* workaround for oracle versions < 10g: version is not checked/optimized at the moment */ string lvalue = FN_StrUppercase(GetOperand(ex.qualifier_l, ex.operand_l)); string rvalue = FN_StrUppercase(GetOperand(ex.qualifier_r, ex.operand_r)); return(String.Format("{0}{1}{2}", lvalue, " LIKE ", rvalue )); } else { /* perform optimized */ return(GetComparison(ex, " LIKE ")); } }
protected override string GetComparisonLikeWildcardR(expression ex, bool caseInsensitive) { /* concatenates the LIKE wildcard to the second operand before comparison */ string lvalue = GetOperand(ex.qualifier_l, ex.operand_l); string rvalue = ConcatWildcardR(GetOperand(ex.qualifier_r, ex.operand_r)); if (caseInsensitive) { /* workaround for oracle versions < 10g: ORA version is not checked/optimized at the moment */ lvalue = FN_StrUppercase(lvalue); rvalue = FN_StrUppercase(rvalue); } /* cue with normal comparison syntax */ return(String.Format("{0}{1}{2}", lvalue, " LIKE ", rvalue )); }
public selectfield(selectfunctiondef func, expression expression, string rowsource_consumeralias, Ioperand literalconst, string fieldname, string asname, selectstatement subqry, sortorder order) { /* [rzamponi 20100112] FxCop CA1805:DoNotInitializeUnnecessarily */ //if (func == selectfunctiondef.none) Function = null; else Function = new selectfunction(func); if (func != selectfunctiondef.none) { Function = new selectfunction(func); } Expression = expression; RowsourceConsumerAlias = rowsource_consumeralias; literal = literalconst; Fieldname = fieldname; AsName = asname; subquery = subqry; if (order == sortorder.so_asc) { Ascending = true; } else if (order == sortorder.so_desc) { Descending = true; } }
protected override string GetComparisonFulltext(expression ex) { return(String.Format("MATCH({0}) AGAINST({1} IN NATURAL LANGUAGE MODE)", GetOperand(ex.qualifier_l, ex.operand_l), GetOperand(ex.qualifier_r, ex.operand_r))); }
protected override string GetHasNoText(expression ex) { /* in oracle, nvarchar2 is null when it is empty. * therefore, this is reduced to a simple "not null" comparison */ return(String.Format("({0} IS NULL)", GetOperand(ex.qualifier_l, ex.operand_l))); }
protected override string GetComparisonHasnotflagAny(expression ex) { return(String.Format("(BITAND({0},{1})=0)", GetOperand(ex.qualifier_l, ex.operand_l), GetOperand(ex.qualifier_r, ex.operand_r))); }
protected override string GetAddDays(expression ex) { return(String.Format("DATEADD(DAY, {1}, {0})", GetOperand(ex.qualifier_l, ex.operand_l), GetOperand(ex.qualifier_r, ex.operand_r))); }
public selectfield(expression expression, sortorder order) : this(selectfunctiondef.none, expression, null, null, null, null, null, order) { }
public selectfield(expression expression, string asname) : this(selectfunctiondef.none, expression, null, null, null, asname, null, sortorder.so_none) { }