All Forums Analytics
lalitha 1 post Joined 11/08
26 Nov 2008
cast teradata

can anyone help me understand a part of the script i have it is a bteq script and it is executed in unix as a back ground process SELECT a.orig_acct_num,b.curr_mort_trd_cnt delq_mot_trd_cnt, ----------------------------------------------------- DELINQUENT TRADE b.optrd_bal tot_opn_tr_balFROM hib534_trig_stg_accounts a, pcdw.cr_rpt_efx bWHERE a.orig_acct_num = b.acct_idAND b.cr_rpt_yymm_val = case when cast((cast(cast('$2' as date)-$1 as date) (format 'MM')) as char(2)) = '01' then cast((cast(cast('$2' as date)-$1 as date) (format 'YYYYMM')) as char(6)) - 89 else cast((cast(cast('$2' as date)-$1 as date) (format 'YYYYMM')) as char(6)) - 1 end;how does this cast function ? i run this script in unix as a background process passing the parameter date everyday. any more details i can give for u r clear understanding plz ask?bye

Adeel Chaudhry 773 posts Joined 04/08
26 Nov 2008

Hello,Is there any chance, that "$1" and "$2" are replaced with some values by UNIX (e.g. using shell script) before it is executed?Regards,Adeel

-- If you are stuck at something .... consider it an opportunity to think anew.

You must sign in to leave a comment.