sdk/dotnet/src/Microsoft.Datasync.Client.SQLiteStore/Utils/SqlQueryFormatter.cs
/// <summary>
/// Generate a SUBSTR SQL expression.
/// </summary>
/// <param name="node">The node being processed.</param>
/// <returns>The processed node.</returns>
Generate a SUBSTR SQL expression.
Generate a SUBSTR SQL expression .
private QueryNode FormatSubstringFunction(FunctionCallNode node)
        {
            sql.Append("SUBSTR(");
            node.Arguments[0].Accept(this);
            if (node.Arguments.Count > 1)
            {
                sql.Append(", ");
                node.Arguments[1].Accept(this);
                sql.Append(" + 1");  
                if (node.Arguments.Count > 2)
                {
                    sql.Append(", ");
                    node.Arguments[2].Accept(this);
                }
            }
            sql.Append(')');
            return node;
        }
private QueryNode FormatSubstringFunction ( FunctionCallNode node ) { sql . Append ( " " ) ; node . Arguments [ 0 ] . Accept ( this ) ; if ( node . Arguments . Count > 1 ) { sql . Append ( " " ) ; node . Arguments [ 1 ] . Accept ( this ) ; sql . Append ( " " ) ; if ( node . Arguments . Count > 2 ) { sql . Append ( " " ) ; node . Arguments [ 2 ] . Accept ( this ) ; } } sql . Append ( ' ' ) ; return node ; }
Generate a SUBSTR SQL expression.
Generate a SUBSTR SQL expression .
// need to add 1 since SQL is 1 based, but OData is zero based
The processed node.
The processed node .
node
FunctionCallNode
The node being processed.
The node being processed .