Deveel.Data.Sql.Query.QuerySelectColumns.SelectAllColumnsFromSource C# (CSharp) Method

SelectAllColumnsFromSource() public method

public SelectAllColumnsFromSource ( ObjectName tableName ) : void
tableName ObjectName
return void
        public void SelectAllColumnsFromSource(ObjectName tableName)
        {
            // Attempt to find the table in the from set.
            string schema = null;
            if (tableName.Parent != null)
                schema = tableName.Parent.Name;

            IFromTableSource table = fromSet.FindTable(schema, tableName.Name);
            if (table == null)
                throw new InvalidOperationException(tableName + ".* is not a valid reference.");

            AddAllFromTable(table);
        }

Usage Example

Ejemplo 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);
        }
All Usage Examples Of Deveel.Data.Sql.Query.QuerySelectColumns::SelectAllColumnsFromSource