Esempio n. 1
0
        private QuerySelectColumns BuildSelectColumns(SqlQueryExpression expression, QueryExpressionFrom queryFrom)
        {
            var selectColumns = new QuerySelectColumns(queryFrom);

            foreach (var column in expression.SelectColumns)
            {
                // Is this a glob?  (eg. Part.* )
                if (column.IsGlob)
                {
                    // Find the columns globbed and add to the 'selectedColumns' result.
                    if (column.IsAll)
                    {
                        selectColumns.SelectAllColumnsFromAllSources();
                    }
                    else
                    {
                        // Otherwise the glob must be of the form '[table name].*'
                        selectColumns.SelectAllColumnsFromSource(column.TableName);
                    }
                }
                else
                {
                    // Otherwise must be a standard column reference.
                    selectColumns.SelectSingleColumn(column);
                }
            }

            return(selectColumns);
        }
Esempio n. 2
0
        private QuerySelectColumns BuildSelectColumns(SqlQueryExpression expression, QueryExpressionFrom queryFrom)
        {
            var selectColumns = new QuerySelectColumns(queryFrom);

            foreach (var column in expression.SelectColumns) {
                // Is this a glob?  (eg. Part.* )
                if (column.IsGlob) {
                    // Find the columns globbed and add to the 'selectedColumns' result.
                    if (column.IsAll) {
                        selectColumns.SelectAllColumnsFromAllSources();
                    } else {
                        // Otherwise the glob must be of the form '[table name].*'
                        selectColumns.SelectAllColumnsFromSource(column.TableName);
                    }
                } else {
                    // Otherwise must be a standard column reference.
                    selectColumns.SelectSingleColumn(column);
                }
            }

            return selectColumns;
        }