Class Upper
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the UPPER string function that converts all characters in a string to uppercase.
public class Upper : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
- Inheritance
-
Upper
- Implements
Remarks
The UPPER function converts all lowercase characters in a string to their uppercase equivalents. Non-alphabetic characters remain unchanged. Useful for case-insensitive comparisons, data normalization, and formatting output. Behavior with Unicode characters may vary by database system.
Examples
Convert all country codes to uppercase for normalization:
var schema = manager.LoadSchema("crm");
var customers = schema["customers"];
var query = new Query()
.Select([ customers["id"], new Expression("country_upper", new Upper(customers["country_code"])) ])
.From(customers);
var results = manager.Retrieve(query);
Use the typed Column constructor when working with a pre-resolved column variable:
var schema = manager.LoadSchema("crm");
var customers = schema["customers"];
Column countryColumn = customers["country_code"];
var query = new Query()
.Select([ customers["id"], new Expression("country_upper", new Upper(countryColumn)) ])
.From(customers);
var results = manager.Retrieve(query);
Convert a hard-coded string literal to uppercase:
var query = new Query()
.Select([ new Expression("upper_val", new Upper("hello world")) ]);
var results = manager.Retrieve(query);
Constructors
- Upper(IEnumerable<IElement>)
Initializes a new instance of UPPER with multiple elements (typically for concatenation).
- Upper(string)
Initializes a new instance of UPPER for a string literal value.
- Upper(IElement)
Initializes a new instance of UPPER with a single element.
- Upper(Column)
Initializes a new instance of UPPER for a column.