Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do I get the 'Let' assignment to include the quotes surrounding the code values. There are about 20 values, I use them
in 4 select statements, and do not want to hardcode the 'IN' condition multiple places since the values may change over time.
LET
vActivity_Code_List='''Appeal_LA','Appeal_BT','Appeal_NU','Appeal_HS''';
SQL
SELECT
al.ACTIVITY_CODE,
al.ACT_LOG_COMMENT,
al.CONTACT_ID_SEQ,
al.LAST_MODIFIED_DATE
FROM PROD."ACTIVITY_LOG" al
WHERE 1 = 1
AND al.ACTIVITY_CODE in ('$(vActivity_Code_List )')
;
SET vActivity_Code_List='Appeal_LA','Appeal_BT','Appeal_NU','Appeal_HS';
SET vActivity_Code_List='Appeal_LA','Appeal_BT','Appeal_NU','Appeal_HS';
I also had to remove the quotes from here: ('$(vActivity_Code_List )') and that worked, thank you!