public override gsSelectColumn Parse() { gsSelectColumn selCol; switch (_ScalarExpression.ColumnType) { case ColumnType.Regular: if (_ScalarExpression.MultiPartIdentifier.Identifiers.Count == 1) { string columnName = _ScalarExpression.MultiPartIdentifier.Identifiers.First().Value; selCol = new gsFieldColumn() { ColumnName = columnName, ColumnAlias = ColumnAlias }; } else if (_ScalarExpression.MultiPartIdentifier.Identifiers.Count > 1) { string tableName = _ScalarExpression.MultiPartIdentifier.Identifiers[0].Value; string columnName = _ScalarExpression.MultiPartIdentifier.Identifiers[1].Value; selCol = new gsFieldColumn() { ColumnName = columnName, ColumnAlias = ColumnAlias, Table = new gsFromTerm { TableName = tableName } }; } else { throw new NotImplementedException("MultiPartIdentifier.Identifiers > 2 not supported"); } break; case ColumnType.Wildcard: selCol = new gsFieldColumn() { ColumnName = "*", ColumnAlias = ColumnAlias, }; break; default: throw new NotImplementedException($"ColumnReferenceExpression {_ScalarExpression.ColumnType.ToString()} not supported"); } return(selCol); }
public override gsSelectColumn Parse() { gsSelectColumn selCol; if (_Expression.Qualifier != null) { if (_Expression.Qualifier is MultiPartIdentifier) { if ((_Expression.Qualifier as MultiPartIdentifier).Identifiers.Count == 1) { string tableName = (_Expression.Qualifier as MultiPartIdentifier).Identifiers.First().Value; selCol = new gsFieldColumn() { ColumnName = "*", Table = new gsFromTerm { TableName = tableName } }; } else { throw new NotImplementedException("Expression.Qualifier.Identifiers.Count > 1 not supported"); } } else { throw new NotImplementedException($"Expression.Qualifier of type {_Expression.Qualifier.GetType().Name} not supported"); } } else { selCol = selCol = new gsFieldColumn() { ColumnName = "*", }; } return(selCol); }