Archives of the TeradataForum
Message Posted: Wed, 03 Jan 2007 @ 20:53:28 GMT
I am trying to figure out a way to create a table via either a shell script, macro, etc that I can pass in the start and end dates instead of hard coding them. An example of the SQL I am trying to run is as follows. I tried to use a macro but the create macro script wouldn't let me substitute :start_date and :end_date where I have the dates below. This table is created nightly and I need to determine the date ranges from another table.
Has anyone done something like this?
Thanks in advance for any help.
CREATE MULTISET TABLE dss_work.x_tbl ,NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT ( date_invoice DATE FORMAT 'YY/MM/DD', columna SMALLINT, columnb CHAR(35) CHARACTER SET LATIN NOT CASESPECIFIC) PRIMARY INDEX region_date_idx ( date_invoice ,region_id ) PARTITION BY RANGE_N(date_invoice BETWEEN DATE '2006-01-01' AND DATE '2008-03-01' EACH INTERVAL '7' DAY );
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|