Пример #1
0
        private BoundExpression BindSingleRowSubselect(SingleRowSubselectSyntax node)
        {
            // TODO: Ensure query has no ORDER BY unless TOP is also specified

            var boundQuery = BindSubquery(node.Query);

            if (boundQuery.OutputColumns.Length == 0)
            {
                // This can happen in cases like this:
                //
                //    SELECT  (SELECT * FROM
                //    FROM EmployeeTerritories et
                //
                // We shouldn't report an error but we can't return bound
                // single row subselect either.
                return(new BoundErrorExpression());
            }

            if (boundQuery.OutputColumns.Length > 1)
            {
                Diagnostics.ReportTooManyExpressionsInSelectListOfSubquery(node.Span);
            }

            var value = boundQuery.OutputColumns.First().ValueSlot;

            return(new BoundSingleRowSubselect(value, boundQuery.Relation));
        }
Пример #2
0
 public virtual void VisitSingleRowSubselect(SingleRowSubselectSyntax node)
 {
     DefaultVisit(node);
 }
Пример #3
0
 public virtual TResult VisitSingleRowSubselect(SingleRowSubselectSyntax node)
 {
     return(DefaultVisit(node));
 }