Setting Up the XSLT_SHRED_BATCH and XSLT_SHRED Examples

Teradata Vantageā„¢ XML Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1140-162K

Set up the users and tables used in subsequent XSLT_SHRED_BATCH and XSLT_SHRED examples.

  • Create the users.
  • Create the source tables to store the XML documents. A source table must have at least two columns: an ID column and an XML document column.
  • Create target tables to store the XML values.
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);