16.20 - XSLT_SHRED_BATCHとXSLT_SHREDの例の設定 - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ XMLデータ型

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
2019年3月
Content Type
プログラミング リファレンス
Publication ID
B035-1140-162K-JPN
Language
日本語 (日本)

ユーザーと後続のXSLT_SHRED_BATCH例とXSLT_SHRED例で使用するテーブルを設定します。

  • ユーザーを作成します。
  • XML文書を格納するソース テーブルを作成します。ソース テーブルには、少なくともID列とXML文書列の2つの列が必要です。
  • XML値を格納するターゲット テーブルを作成します。
CREATE USER xsltuser AS  PASSWORD = xsltuser PERM = 2000000*(HashAMP()+1);
GRANT ALL ON xsltuser TO xsltuser;
GRANT ALL ON TD_SYSXML TO xsltuser;
GRANT EXECUTE PROCEDURE ON TD_SYSXML TO xsltuser;
.logoff

.logon ie1510/xsltuser,xsltuser
CREATE SET TABLE Offer(       
       offerid char(10),
       mediaBlockid varchar(64),
       datetimecol varchar(30)
       );
CREATE TABLE Offer1(C_COL1 char(10), C_COL2 varchar(64));
CREATE TABLE Input_Docs(id INT, xmldoc XML);
CREATE SET TABLE TransientTbl(C_Id int, C_Name varchar(64), C_Sal Int);
CREATE SET TABLE TransientTbl_docs(id int, xmlcol xml);
CREATE TABLE DefaultValue
(
       datec DATE,
       timec TIME(6) ,
       timewzc TIME(6) WITH TIME ZONE,
       timestampc TIMESTAMP(6),
       timestampwzc TIMESTAMP(6) WITH TIME ZONE
);
CREATE TABLE DefaultValue2
(
  byteintc ByteInt,
  smallintc Smallint,
  intc Integer,
  floatc Float
);
CREATE SET TABLE DefaultValue3 ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO
     (
      C_Id INTEGER,
      C_Byteintc BYTEINT,
      C_Smallintc SMALLINT,
      C_Intc INTEGER)
PRIMARY INDEX ( C_Id );
 CREATE TABLE DefaultValue4
(
	C_Datec DATE,
 C_Timec TIME(6),
 C_Timewzc TIME(6) WITH TIME ZONE,
 C_TimeStampc TIMESTAMP(6),
C_TimeStampwzc TIMESTAMP(6) WITH TIME ZONE
);
CREATE TABLE Customer
(
	c_custkey BIGINT NOT NULL,
	c_name VARCHAR(25) CHARACTER SET LATIN,
	c_address VARCHAR(40) CHARACTER SET LATIN,
	c_nationkey BIGINT,
	c_phone CHAR(15) CHARACTER SET LATIN,
	c_acctbal DECIMAL(20,2),
	c_mktsegment CHAR(10) CHARACTER SET LATIN,
	c_comment VARCHAR(117) CHARACTER SET LATIN
) UNIQUE PRIMARY INDEX PK_CUSTKEY (c_custkey);
CREATE TABLE Orders
(
	o_orderkey BIGINT NOT NULL,
	o_custkey BIGINT,
	o_orderstatus CHAR(1) CHARACTER SET LATIN,
	o_totalprice DECIMAL(20,2),
	o_orderdate DATE FORMAT 'YY/MM/DD',
	o_orderpriority CHAR(15) CHARACTER SET LATIN,
	o_clerk CHAR(15) CHARACTER SET LATIN,
	o_shippriority BIGINT,
	o_comment VARCHAR(79) CHARACTER SET LATIN
) UNIQUE PRIMARY INDEX PK_ORDERKEY ( o_orderkey );
CREATE TABLE Dealer
(
	d_id BIGINT NOT NULL,
	d_name CHAR(15) CHARACTER SET LATIN,
	d_address CHAR(15) CHARACTER SET LATIN,
	d_comment VARCHAR(79) CHARACTER SET LATIN
) UNIQUE PRIMARY INDEX PK_ORDERKEY (d_id);