Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
The ELEMENT Statement
See Also
Programmer's Guide > OpenAccess ORM Classic (Old API) > Telerik OpenAccess ORM OQL Reference > OQL - Object Query Language > The ELEMENT Statement

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

If a query returns only one item, you can convert the result from a collection to a single object using the ELEMENT operator. If the SELECT statement returns more than one object, the ELEMENT statement returns an error code and does not convert any objects. The ELEMENT statement is of greatest use for queries embedded in a programming language when you know that you will find exactly one object and when you know the type of the object.

OQL Copy Code
ELEMENT (  SELECT product    FROM ProductExtent AS product      WHERE product.productName = "Chai" )

The above query will return one product object.

See Also