Exemple #1
0
 public void PrepareTable(Session session, QNameManager.QName name, QNameManager.QName[] columns)
 {
     if (!this._isResolved)
     {
         if (this._table == null)
         {
             this._table = new TableDerived(this.database, name, 2, this.queryExpression, this);
         }
         bool flag1 = (columns != null) && (this.queryExpression > null);
         if (flag1)
         {
             this.queryExpression.GetMainSelect().SetColumnAliases(columns);
         }
         this._table.ColumnList  = this.queryExpression.GetColumns();
         this._table.ColumnCount = this.queryExpression.GetColumnCount();
         if (flag1 && (columns.Length <= this._table.ColumnCount))
         {
             for (int i = 0; i < columns.Length; i++)
             {
                 ColumnSchema schema = this._table.ColumnList.Get(i);
                 schema.ColumnName = columns[i];
                 this._table.ColumnList.Set(i, columns[i].Name, schema);
             }
         }
         TableUtil.SetTableIndexesForSubquery(this._table, this._uniqueRows || this._fullOrder, this._uniqueRows);
         this._isResolved = true;
     }
 }
Exemple #2
0
 public void SetReturnTable(TableDerived table)
 {
     this.ReturnTable   = table;
     this._returnsTable = true;
     SqlType[] columnTypes = table.GetColumnTypes();
     this.ReturnType = new RowType(columnTypes);
 }
Exemple #3
0
 public void PrepareTable(Session session)
 {
     if (!this._isResolved)
     {
         if (this.view == null)
         {
             if (this._table == null)
             {
                 QNameManager.QName subqueryTableName = this.database.NameManager.GetSubqueryTableName();
                 this._table = new TableDerived(this.database, subqueryTableName, 2, this.queryExpression, this);
             }
             if (this.IsDataExpression)
             {
                 TableUtil.AddAutoColumns(this._table, this.DataExpression.NodeDataTypes);
                 TableUtil.SetTableIndexesForSubquery(this._table, this._uniqueRows || this._fullOrder, this._uniqueRows);
             }
             else
             {
                 this._table.ColumnList  = this.queryExpression.GetColumns();
                 this._table.ColumnCount = this.queryExpression.GetColumnCount();
                 TableUtil.SetTableIndexesForSubquery(this._table, this._uniqueRows || this._fullOrder, this._uniqueRows);
             }
         }
         else
         {
             TableDerived derived1 = new TableDerived(this.database, this.view.GetName(), 8, this.queryExpression, this)
             {
                 ColumnList = this.view.ColumnList
             };
             this._table             = derived1;
             this._table.ColumnCount = this._table.ColumnList.Size();
             this._table.CreatePrimaryKey();
         }
         this._isResolved = true;
     }
 }
Exemple #4
0
 public void CreateTable()
 {
     QNameManager.QName subqueryTableName = this.database.NameManager.GetSubqueryTableName();
     this._table = new TableDerived(this.database, subqueryTableName, 2, this.queryExpression, this);
 }