SELECTおよびWHERE句でドット表記を使用する例の設定 - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ JSONデータ型

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

このセクションのJSONオブジェクト、テーブル、およびデータは以降のセクションの例で使用され、SELECTリストとWHERE句でのドット表記の使用方法を示します。

例で使用される次のJSONPath構文要素の詳細については、JSONPathリクエスト構文を参照してください。
  • 再帰下降演算子
  • ワイルドカード演算子
  • 名前付きリスト演算子
  • インデックスリスト演算子
  • スライス演算子
例では、次のJSONオブジェクトを参照します。
{
   "customer" : "CustomerName",
   "orderID" : 3,
   "price" : "$100000.00",
   "items" :
      [ 
         { "ID" : 1, "name" : "disk", "amt" : 10 }, 
         { "ID" : 2, "name" : "RAM", "amt" : 20 }, 
         { "ID" : 3, "name" : "monitor", "amt" : 30 }, 
         { "ID" : 4, "name" : "keyboard", "amt" : 40 },
         { "ID" : 5, "name" : "camera", "amt" : 50 }, 
         { "ID" : 6, "name" : "button", "amt" : 60 }, 
         { "ID" : 7, "name" : "mouse", "amt" : 70 }, 
         { "ID" : 8, "name" : "pen", "amt" : 80 }  
      ]
}
例では、次のテーブルとデータを参照します。
CREATE TABLE jsonEnhancedDotNotationTbl(
   id INT,
   jsonCol01 JSON(1000) CHARACTER SET LATIN, 
   jsonCol02 JSON(1000) CHARACTER SET UNICODE,
   jsonCol03 JSON(1000) STORAGE FORMAT BSON,
   jsonCol04 JSON(1000) STORAGE FORMAT UBJSON);
INSERT INTO jsonEnhancedDotNotationTbl(1,
'{
   "customer" : "CustomerName",
   "orderID" : 3,
   "price" : "$100000.00",
   "items" :
      [ 
         { "ID" : 1, "name" : "disk", "amt" : 10 }, 
         { "ID" : 2, "name" : "RAM", "amt" : 20 }, 
         { "ID" : 3, "name" : "monitor", "amt" : 30 }, 
         { "ID" : 4, "name" : "keyboard", "amt" : 40 },
         { "ID" : 5, "name" : "camera", "amt" : 50 }, 
         { "ID" : 6, "name" : "button", "amt" : 60 }, 
         { "ID" : 7, "name" : "mouse", "amt" : 70 }, 
         { "ID" : 8, "name" : "pen", "amt" : 80 }  
      ]
}',
'{
   "customer" : "CustomerName",
   "orderID" : 3,
   "price" : "$100000.00",
   "items" :
      [ 
         { "ID" : 1, "name" : "disk", "amt" : 10 }, 
         { "ID" : 2, "name" : "RAM", "amt" : 20 }, 
         { "ID" : 3, "name" : "monitor", "amt" : 30 }, 
         { "ID" : 4, "name" : "keyboard", "amt" : 40 },
         { "ID" : 5, "name" : "camera", "amt" : 50 }, 
         { "ID" : 6, "name" : "button", "amt" : 60 }, 
         { "ID" : 7, "name" : "mouse", "amt" : 70 }, 
         { "ID" : 8, "name" : "pen", "amt" : 80 }  
      ]
}',
'{
   "customer" : "CustomerName",
   "orderID" : 3,
   "price" : "$100000.00",
   "items" :
      [ 
         { "ID" : 1, "name" : "disk", "amt" : 10 }, 
         { "ID" : 2, "name" : "RAM", "amt" : 20 }, 
         { "ID" : 3, "name" : "monitor", "amt" : 30 }, 
         { "ID" : 4, "name" : "keyboard", "amt" : 40 },
         { "ID" : 5, "name" : "camera", "amt" : 50 }, 
         { "ID" : 6, "name" : "button", "amt" : 60 }, 
         { "ID" : 7, "name" : "mouse", "amt" : 70 }, 
         { "ID" : 8, "name" : "pen", "amt" : 80 }  
      ]
}',
'{
   "customer" : "CustomerName",
   "orderID" : 3,
   "price" : "$100000.00",
   "items" :
      [ 
         { "ID" : 1, "name" : "disk", "amt" : 10 }, 
         { "ID" : 2, "name" : "RAM", "amt" : 20 }, 
         { "ID" : 3, "name" : "monitor", "amt" : 30 }, 
         { "ID" : 4, "name" : "keyboard", "amt" : 40 },
         { "ID" : 5, "name" : "camera", "amt" : 50 }, 
         { "ID" : 6, "name" : "button", "amt" : 60 }, 
         { "ID" : 7, "name" : "mouse", "amt" : 70 }, 
         { "ID" : 8, "name" : "pen", "amt" : 80 }  
      ]
}');