02-07-2013 03:50 AM
I'm working in an SQL Join transformation in DI Studio, and need to make sure that all rows for one specific bank get the flag-variable set to "N".
Why can't I just map the BANK_ID and BANK_FLAG from the source table, into BANK_FLAG in the target table, then use the following expression?
if BANK_ID = "123456" then do;
BANK_FLAG = "N";
I also tried this:
when BANK_ID = "123456" then "N"
I'd appreciate any aid on this rookie problem. Thanks for your time.
02-07-2013 05:50 AM
Well, these expression have errors, which you probably encountered!
IF-THEN-ELSE-logic belongs to the data step, not "permitted" in SQL.
A case statement should not end with a ;, that will end the whole CREATE VIEW/TABLE statement.
Is that correct that you already have a BANK_FLAG in the source table, and you just want to change it's value for a specific bank?
02-07-2013 06:00 AM
Thanks. Yes, that's correct. I know how to do it in user written code, but apparently not in an SQL Join expression.