Archives of the TeradataForum
Message Posted: Fri, 17 Aug 2007 @ 23:26:49 GMT
Subj: | | Re: Parition Elimination with Using Clause |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, August 17, 2007 16:33 -->
Might be improved in R12 but through V2R6.2.x you can't get partition elimination when the partitioning expression values are supplied via host
variables. If there's only a single date range, you may be able to work around it with UNIX "here documents" and shell substitution in place of
USING. Since your environment appears to be Windows, you may have to find some other way. This should work, for example:
.import data file='c:\. . . ' ;
.set titledashes off;
.export report file='C:\...\tempqry.sql';
using (from_dt date, to_dt date)
select
'select * '||
'from r621test.clm '||
'where pd_dt between date'''||
cast(:from_dt as CHAR(10) FORMAT 'yyyy-mm-dd')||
''' and date'''||
Cast(:to_dt as CHAR(10) FORMAT 'yyyy-mm-dd')||
''';' (TITLE '')
;
.export reset;
.set titledashes on;
.run file='C:\...\tempqry.sql';
|