DataSizeの例 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - 地理空間データ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年6月
Language
日本語
Last Update
2021-03-30
dita:mapPath
ja-JP/vci1556127188517.ditamap
dita:ditavalPath
ja-JP/vci1556127188517.ditaval
dita:id
B035-1181
Product Category
Software
Teradata Vantage

次の例はJSONデータ型を使用します。

SELECT TD_SYSFNLIB.DataSize (NEW JSON ('{"name" : "Mitzy", "age" : 3}'));

datasize( NEW JSON('{"name" : "Mitzy", "age" : 3}', LATIN))
-----------------------------------------------------------
                                                         29
CREATE TABLE JSON_table (id INTEGER, jsn JSON INLINE LENGTH 1000);

INSERT INTO JSON_table VALUES (100, '{"name" : "Mitzy", "age" : 3}');
INSERT INTO JSON_table VALUES (200, '{"name" : "Rover", "age" : 5}');
INSERT INTO JSON_table VALUES (300, '{"name" : "Princess", "age" : 4.5}');

SELECT * FROM JSON_table ORDER BY id;

         id jsn
----------- ------------------------------------------
        100 {"name" : "Mitzy", "age" : 3}
        200 {"name" : "Rover", "age" : 5}
        300 {"name" : "Princess", "age" : 4.5}


SELECT id, TD_SYSFNLIB.DataSize (jsn) FROM JSON_table ORDER BY id;

         id         datasize(jsn)
-----------  --------------------
        100                    29
        200                    29
        300                    34