Usage Notes | OCOUNTS | Teradata Vantage - Usage Notes - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

OCOUNT takes an array expression as an argument and returns the number of elements that contain a value that is non-NULL or NULL. Elements that are in an uninitialized state are not counted. If the array is empty (all elements of the array are in an uninitialized state), then OCOUNT returns a value of 0.

If array_expr is NULL, an error is returned.

The OCOUNT method is compatible with the Oracle COUNT method for one-dimensional ARRAY types. However, the empty set of parentheses required by Teradata syntax is a deviation from Oracle syntax.