コード例 #1
0
ファイル: OracleQueryBlock.cs プロジェクト: skyclub66/SQLPad
        private OracleDataObjectReference BuildSelfObjectReference()
        {
            _selfObjectReference =
                new OracleDataObjectReference(ReferenceType.InlineView)
            {
                AliasNode = AliasNode,
                Owner     = this
            };

            _selfObjectReference.QueryBlocks.Add(this);

            return(_selfObjectReference);
        }
コード例 #2
0
		public OraclePivotTableReference(OracleStatementSemanticModel semanticModel, OracleDataObjectReference sourceReference, StatementGrammarNode pivotClause)
			: base(ReferenceType.PivotTable)
		{
			foreach (var sourceColumn in sourceReference.QueryBlocks.SelectMany(qb => qb.Columns).Where(c => !c.IsAsterisk))
			{
				sourceColumn.RegisterOuterReference();
			}

			PivotClause = pivotClause;
			SourceReference = sourceReference;

			RootNode = sourceReference.RootNode;
			var innerTableReferenceRootNode = sourceReference.RootNode.GetPathFilterDescendants(NodeFilters.BreakAtNestedQueryBlock, NonTerminals.InnerTableReference, NonTerminals.InnerSpecialTableReference).Last();
			sourceReference.RootNode = innerTableReferenceRootNode;

			Container = Owner = sourceReference.Owner;
			Owner.ObjectReferences.Remove(sourceReference);
			Owner.ObjectReferences.Add(this);

			SourceReferenceContainer = new OracleReferenceContainer(semanticModel);
			SourceReferenceContainer.ObjectReferences.Add(sourceReference);

			var aggregateExpressions = new List<StatementGrammarNode>();

			var pivotExpressions = PivotClause[NonTerminals.PivotAliasedAggregationFunctionList];
			if (pivotExpressions != null)
			{
				foreach (var pivotAggregationFunction in pivotExpressions.GetDescendants(NonTerminals.PivotAliasedAggregationFunction))
				{
					var aliasNode = pivotAggregationFunction[NonTerminals.ColumnAsAlias, Terminals.ColumnAlias];
					_columnNameExtensions.Add(aliasNode == null ? String.Empty : $"_{aliasNode.Token.Value.ToQuotedIdentifier().Trim('"')}");
					aggregateExpressions.Add(pivotAggregationFunction);
				}
			}

			AggregateFunctions = aggregateExpressions.AsReadOnly();
		}
コード例 #3
0
 public void VisitDataObjectReference(OracleDataObjectReference dataObjectReference)
 {
     throw new NotSupportedException();
 }