Conditional expression causing errors when not enclosed in opening and closing braces
I've the following in tDBInput (Amazon Redshift) -
"select ln_id, ln_typ from ln_table where 1=1" +
(
(context.load_type).equalsIgnoreCase("HISTORY") ? "" : (" and aqsn_dt <= rec_cren_dttm")
)
If I do not have the beginning and ending braces after the + sign as shown above, then I get an error in Talend saying - Type mismatch: cannot convert from String to boolean. What is the need of putting the braces around the whole conditional expression?