例: 1-D ARRAY値の連結 - Teradata Database - Teradata Vantage NewSQL Engine - ARRAY連結演算子、例: 1-D ARRAY値の連結

Teradata Vantage™ データ タイプおよびリテラル

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/xnq1529717274657.ditamap
dita:ditavalPath
ja-JP/xnq1529717274657.ditaval
dita:id
B035-1143
Product Category
Software
Teradata Vantage

この例では、同じデータ型の1-D ARRAY値を2つ受け取り、それを連結します。

CREATE TYPE address AS CHAR(10) ARRAY[5];
CREATE TABLE employee_info (eno INTEGER, addressval address);
/* Assume one row in table employee_info contains the following value 
for "addressval": 
Addressval[1] = '123 Main St.'
Addressval[2] = 'San Diego'
Addressval[3] = 'CA'
*/
/* The following select statement concatenates the current value in "addressval" with ZIP code and country information, which are stored as additional elements of the 1-D array. */
SELECT addressval || NEW address('92101', 'USA');
FROM employee_info;
/* Result value is the following:
Addressval[1] = '123 Main St.'
Addressval[2] = 'San Diego'
Addressval[3] = 'CA'
Addressval[4] = '92101'
Addressval[5] = 'USA'
*/