You can check the syntax of MERGE, it might be what you want.
Or just separate statements:
update table2 set ... from table1 where table1.column='true';
insert into table3 select ... from table1 where table1.column='true';
insert into table2 select ... from table1 where NOT (table1.column='true');
insert into table3 select ... from table1 where NOT (table1.column='true');
Inserts and Updates can not be used in Case statements in plain SQL - and I quess in no DB system.
So please share your table layouts and sample data which you want to processes.
Der Beginn aller Wissenschaften ist das Erstaunen, dass die Dinge sind, wie sie sind.-Aristoteles
Do you want to use a stored procedure?
So far you didn't explained what you really need to do.
As VBurmist said it might be worth to check Merge syntax or check the other option. These are set operations and if need you can define them as single transactions.
Der Beginn aller Wissenschaften ist das Erstaunen, dass die Dinge sind, wie sie sind.-Aristoteles
You cannot use insert and update in case statement!!
You have to use stored procedure/macros to achieve this!!
Asad Ali Khan



I want to Update and Insert when a condition in the case was true. However, it seems that Teradata doesn't accept it. My question is, is there a way for that to happen?
Like
CASE WHEN SEL Table1.Column return TRUE
THEN UPDATE Table2 AND INSERT Table3
ELSE
INSERT Table2 AND INSERT Table3
END
I need your help asap! Thanks!