public With Internal(ISQLStatement pStatement) { _Statement = pStatement; if (!string.IsNullOrEmpty(_Name)) { _AsNamesSelects.Add(new Tuple <string, ISQLStatement>(_Name, _Statement)); } return(this); }
private ExcelDataReader ExecuteDataReader(CommandBehavior behavior) { this.VerifyConnectionAndOpen(); GCSqlParser parser = new GCSqlParser(); ISQLStatement sqlStatement = parser.Parse(this._cmdText); ExcelResultSet resultSet = new ExcelResultSet(sqlStatement, this); return(new ExcelDataReader(resultSet)); }
public ISQLStatement Parse(string sql) { if (sql == _sql && _statement != null) { return(_statement); } _sql = sql; _statement = InternalParse(sql); return(_statement); }
public ExcelResultSet(ISQLStatement sqlStatement, ExcelCommand command) { if (sqlStatement.Type != StatementType.Select) { throw new NotSupportedException(sqlStatement.ToString()); } SelectStatement selectStatement = (SelectStatement)sqlStatement; if (!command.Connection.HasTable(selectStatement.Table.Name)) { throw new ExcelException("Cannot find table " + selectStatement.Table.Name); } this.Reset(); this._selectStatement = selectStatement; this._command = command; this._evaluator = new ExcelEvalVisitor(new ExcelEvalContext(this)); }
public With Select(ISQLStatement pSelect) { _Select = pSelect; return(this); }
public With As(string pName, ISQLStatement pStatement) { _AsNamesSelects.Add(new Tuple <string, ISQLStatement>(pName, pStatement)); return(this); }