PPI code

Database
Enthusiast

PPI code

Hi,

Can anyone please paste script of teradata PPI script here? Somehow I could not find it in my docs...

Thanks in advance....

Raja
4 REPLIES
Enthusiast

Re: PPI code

Are u looking for something like this

CREATE SET TABLE Employee
(Employee_Number INTEGER NOT NULL
,Location_Number INTEGER
,Dept_Number INTEGER
… )
PRIMARY INDEX (Employee_Number)
PARTITION BY Location_Number ;
Enthusiast

Re: PPI code

The complete ..one say... create set table tt(.....)
PARTITION BY RANGE_(.....Here the codes.....till the end.....);
Enthusiast

Re: PPI code

Below are some more examples from TD Doc

CREATE TABLE Sales
( store_id INTEGER NOT NULL,
item_id INTEGER NOT NULL,
sales_date DATE FORMAT 'YYYY-MM-DD',
total_revenue DECIMAL(9,2),
total_sold INTEGER,
note VARCHAR(256))
UNIQUE PRIMARY INDEX (store_id ,item_id ,sales_date)
PARTITION BY RANGE_N (
sales_date
BETWEEN DATE '2003-01-01' AND DATE '2003-12-31'
EACH INTERVAL '1' DAY );

CREATE TABLE Sales_History_ByWeek
( store_id INTEGER NOT NULL,
item_id INTEGER NOT NULL,
sales_date DATE FORMAT 'YYYY-MM-DD',
total_revenue DECIMAL(9,2),
total_sold INTEGER,
note VARCHAR(256))
UNIQUE PRIMARY INDEX (store_id, item_id, sales_date)
PARTITION BY RANGE_N (
sales_date
BETWEEN DATE '2000-01-01' AND DATE '2000-12-31'
EACH INTERVAL '7' DAY,
DATE '2001-01-01' AND DATE '2001-12-31'
EACH INTERVAL '7' DAY,
DATE '2002-01-01' AND DATE '2002-12-31'
EACH INTERVAL '7' DAY);

CASE_N
--------

CREATE TABLE Sales_Revenue
( store_id INTEGER NOT NULL,
item_id INTEGER NOT NULL,
sales_date DATE FORMAT 'YYYY-MM-DD',
total_revenue DECIMAL(9,2),
total_sold INTEGER,
note VARCHAR(256))
PRIMARY INDEX (store_id, item_id, sales_date)
PARTITION BY CASE_N
( total_revenue < 2000 , total_revenue < 4000 ,
total_revenue < 6000 , total_revenue < 8000 ,
total_revenue < 10000 , total_revenue < 20000 ,
total_revenue < 50000 , total_revenue < 100000 ,
NO CASE,
UNKNOWN);

Enthusiast

Re: PPI code

Thanks a lot......
Raja K