cast teradata
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


cast teradata Expand / Collapse
Author
Message
Posted 11/26/2008 12:15:05 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/26/2008 4:21:28 PM
Posts: 1, Visits: 4
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_bal
FROM hib534_trig_stg_accounts a, pcdw.cr_rpt_efx b
WHERE a.orig_acct_num = b.acct_id
AND 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


thanks
lalitha
Post #13698
Posted 11/26/2008 11:23:36 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 10/18/2009 5:48:26 AM
Posts: 273, Visits: 1,214
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
Post #13699
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 8:32pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.188. 9 queries. Compression Disabled.