Example: Using OEXTEND to Fill the End of a Constructed ARRAY with NULL Elements - 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ā„¢

The following example shows how you can use the OEXTEND method to fill the end of a constructed ARRAY with NULL elements so that these elements are no longer in an uninitialized state. This can be helpful when the ARRAY may be used as an argument to another system function or operator.

CREATE TYPE myarray AS VARRAY(5) OF INTEGER;
CREATE TABLE mytab (id INTEGER, ary myarray);
/* Populate the first 3 elements. The last 2 elements are uninitialized. */
INSERT INTO mytab VALUES (1, NEW myarray(1,2,3));
/* Fill the last 2 elements with NULLs. */
UPDATE mytab
SET ary = ary.OEXTEND(2)
WHERE id = 1;
SELECT ary FROM mytab;

The following is the result of the query.

(1,2,3,NULL,NULL)