public void Visit(SqlTrim node) { if (!node.Expression.IsNullReference()) { Visit(node.Expression); } }
public override void Visit(SqlTrim node) { if (node.TrimCharacters != null && node.TrimCharacters.Length > 1) { throw new NotSupportedException(Strings.ExOracleDoesNotSupportTrimmingMoreThatOneCharacterAtOnce); } base.Visit(node); }
public override void Visit(SqlTrim node) { if (node.TrimCharacters != null && !node.TrimCharacters.All(_char => _char == ' ')) { throw new NotSupportedException(Strings.ExSqlServerSupportsTrimmingOfSpaceCharactersOnly); } using (context.EnterScope(node)) { context.Output.AppendText(translator.Translate(context, node, TrimSection.Entry)); node.Expression.AcceptVisitor(this); context.Output.AppendText(translator.Translate(context, node, TrimSection.Exit)); } }
public override void Visit(SqlTrim node) { using (context.EnterScope(node)) { context.Output.AppendText(translator.Translate(context, node, TrimSection.Entry)); context.Output.AppendText(translator.Translate(node.TrimType)); node.Expression.AcceptVisitor(this); if (node.TrimCharacters != null) { context.Output.AppendText(","); context.Output.AppendText(translator.Translate(context, node.TrimCharacters)); } context.Output.AppendText(translator.Translate(context, node, TrimSection.Exit)); } }
/// <inheritdoc/> public override string Translate(SqlCompilerContext context, SqlTrim node, TrimSection section) { switch (section) { case TrimSection.Entry: switch (node.TrimType) { case SqlTrimType.Leading: return("LTRIM("); case SqlTrimType.Trailing: return("RTRIM("); case SqlTrimType.Both: return("TRIM("); default: throw new ArgumentOutOfRangeException(); } case TrimSection.Exit: switch (node.TrimType) { case SqlTrimType.Leading: case SqlTrimType.Trailing: return(")"); case SqlTrimType.Both: return(")"); default: throw new ArgumentOutOfRangeException(); } default: throw new ArgumentOutOfRangeException(); } }
public virtual void Visit(SqlTrim node) { VisitInternal(node.Expression); }