After upgrading from Toad Data Point 3.2 (or older), to a newer version, some automation jobs are failing.
The If_Condition activity shows an error that "expression is not valid cannot be converted to boolean".
"Month()", "day()", and "now" are VB script and do not seem to be recognized as it did before.
Sample 1:
(month(now) = 1 and day(now) > 10) or (month(now) = 2 and day(now) <= 10)
Click the "Test" button and it does not evaluate and display as boolean. It just repeats, and displays at the same condition as a string.
Sample 2:
day(now) > 10
Click the "Test" button and this does not display as expected. "Now" should be the current date, and "day()" should return the day from that date. If the current date is greater then 10, than it should return "True".
When building expressions in an automation activities (i.e. If_Condition activity, or Set Variables, etc.), use the Expression Builder, and the list of variables, operators, and functions provided.
For further details about the specific variables, operators, and functions listed in the builder, please refer to the specific help topics. The functions provided mimic Oracle PL/SQL functions. But the syntax may not be exactly the same.
Sample 1 converted:
(Extract('MONTH', Current_date()) = 3 and Extract('DAY', Current_date()) >10) or (Extract('MONTH', Current_date()) = 4 and Extract('DAY', Current_date()) <=10)
Click the "Test" button. This should evaluate to a boolean based off the current sysdate.
Sample 2 converted:
Extract('DAY', Current_date()) > 10
Click the "Test" button. This should evaluate to a boolean based off the current sysdate.
| Extract() | Extracts and returns the value of a specified DateTime field (1st parameter) from a DateTime value expression (2nd parameter). 1st parameter can be any of the following strings: If the date is December 21, 2012 and the time is 5:43 pm Extract('year', Current_date()) returns 2012 Extract('hour', Localtimestamp()) returns 17 |