public override void Execute(QueryNormalizerContext context) { Logger.Info($"Overriding the query: {context.Query}"); //add your code here to modify the Izenda query as needed example below //context.Query = $"SET NOCOUNT ON; {context.Query} SET NOCOUNT OFF;"; }
/// <summary> /// Execute the activity /// </summary> /// <param name="context">The context</param> public override void Execute(QueryNormalizerContext context) { const string izendaConcat = "IZENDA_CONCAT"; const string db2Concat = "CONCAT"; context.Query = context.Query.Replace(izendaConcat, db2Concat); }
/// <summary> /// Execute the activity /// </summary> /// <param name="context">The context</param> public override void Execute(QueryNormalizerContext context) { var DB2 = context.Query; DB2 = DB2.Replace("[[", string.Empty).Replace("]]", string.Empty); context.Query = DB2; }
protected override string NormalizeQuery(string query) { var normalizerContext = new QueryNormalizerContext { Query = query }; QueryNormalizer.Execute(normalizerContext); return(normalizerContext.Query); }
/// <summary> /// Execute the activity /// </summary> /// <param name="context">The context</param> public override void Execute(QueryNormalizerContext context) { var DB2 = context.Query; int index = -1; const string dateTruncate = "DATETRUNCATE"; index = DB2.IndexOf(dateTruncate, StringComparison.OrdinalIgnoreCase); while (index >= 0) { var openIndex = DB2.IndexOf("(", index); var closeIndex = DB2.IndexOf(")", index); var fieldName = DB2.Substring(openIndex + 1, closeIndex - 1 - openIndex); var replacedContent = fieldName; var originalContent = DB2.Substring(index, closeIndex - index + 1); DB2 = DB2.Replace(originalContent, replacedContent); index = DB2.IndexOf(dateTruncate, StringComparison.OrdinalIgnoreCase); } context.Query = DB2; }
/// <summary> /// Execute the activity /// </summary> /// <param name="context">The context</param> public override void Execute(QueryNormalizerContext context) { context.Query = InsertEscapePipeUtils.InsertEscapePipe(context.Query); context.Query = InsertEscapePipeUtils.InsertEscapePipeWithLowerFunction(context.Query); }