Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using tearadata date as index in a volatile table

Status
Not open for further replies.

ppbbcp

Programmer
May 10, 2008
5
US
I am running a program in teradata sql in SAS using proc sql.
I am creating a month end date that I need to use as a primary index later in the program

here is an example
proc sql exec noerrorstop;
connect to teradata (tdpid=xxxx database='dbname'
SERVER=xxxx username=xxxxxxx password='yyyy' mode=teradata
FASTLOAD=YES);

execute
(
create volatile table xyz as
( select f1
,f2
,(ADD_MONTHS(teradata_dte - EXTRACT (DAY FROM teradata_dte) + 1, (0+1)) - 1) as mo_end_dte
....
fn.
) WITH DATA
ON COMMIT PRESERVE ROWS
)by teradata;

in the above example if the mo_end_dte is the first column listed, the query runs for a long time...as long as an hour
before i cancelled it. in the listed form, it runs in seconds. Likewise if I use it as the first column building a volatile table further in the query (making it a PI) it grinds on forever. Any ideas?

I need to use it as a PI in successive volatile tables.
Thanks for any help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top