Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
"SELECT
a.ACCOUNT_ID AS account_id,
FROM Administrator.TRANSACTION_LINES a,
WHERE d.ENDING > to_date('12/31/2009','mm/dd/yyyy')" <<-- needs placeholder (?) for passed parm
If today is a Sunday or the 2nd, 3rd or 4th business day of the month, the job should not run.
If today is Saturday, then set date parm = "12/31/2009 and truncate target table before insert)
If today is any other business day, set the date parm = current_date - 60 and delete last 60 days from target table before insert)
vBeginDate - business day function input parm (always current date)
vDayOfWeek - business day function output parm (0-6)
vTruncate - set to true for 0 false for 1-6
context.vDayOfWeek = row2.biz_days; /* comes from the biz day function you ref'd */
context.vFullPullDate = TalendDate.parseDate("MM/dd/yyyy","01/01/2010");
context.vTruncate = 0;
context.vBeginDate = TalendDate.getCurrentDate();
if (context.vDayOfWeek >=1 || context.vDayOfWeek <= 5) {
context.vTruncate = 0;
context.vStringBeginDate = TalendDate.formatDate("MM/dd/yyyy", context.vBeginDate);
};
/* else if (context.vDayOfWeek == 0) {
context.vTruncate = 1;
context.vBeginDate = TalendDate.parseDate("MM/dd/yyyy",context.vFullPullDate));
}; */
"SELECT
a.ACCOUNT_ID AS account_id,
FROM Administrator.TRANSACTION_LINES a,
WHERE d.ENDING > to_date('12/31/2009','mm/dd/yyyy')" <<-- needs placeholder (?) for passed parm
to
"SELECT
a.ACCOUNT_ID AS account_id,
FROM Administrator.TRANSACTION_LINES a,
WHERE d.ENDING > to_date( '"+context.vStringBeginDate+"', 'mm/dd/yyyy')"