예제 #1
0
 public With Internal(ISQLStatement pStatement)
 {
     _Statement = pStatement;
     if (!string.IsNullOrEmpty(_Name))
     {
         _AsNamesSelects.Add(new Tuple <string, ISQLStatement>(_Name, _Statement));
     }
     return(this);
 }
예제 #2
0
        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));
        }
예제 #3
0
        public ISQLStatement Parse(string sql)
        {
            if (sql == _sql && _statement != null)
            {
                return(_statement);
            }

            _sql       = sql;
            _statement = InternalParse(sql);
            return(_statement);
        }
예제 #4
0
        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));
        }
예제 #5
0
 public With Select(ISQLStatement pSelect)
 {
     _Select = pSelect;
     return(this);
 }
예제 #6
0
 public With As(string pName, ISQLStatement pStatement)
 {
     _AsNamesSelects.Add(new Tuple <string, ISQLStatement>(pName, pStatement));
     return(this);
 }