H. Trujillo
H. Trujillo

Reputation: 437

DB2 multiple statements in THEN

I would like my THEN statement to do something like

MERGE INTO ...
USING (...)
WHEN true
THEN [Update 1] AND [Update 2]

What is the proper syntax to achieve this?

I apologize, I should have been clearer.

Thanks for your time!

Upvotes: 0

Views: 1236

Answers (2)

Lukasz Szozda
Lukasz Szozda

Reputation: 175756

You could use:

CASE 
 WHEN condition
    statement1;
    statement2;
 ELSE    
    else_statement;
END CASE;

Please note the difference between case expression/statement.

Upvotes: 1

Gordon Linoff
Gordon Linoff

Reputation: 1269933

Two case expressions:

(Case When true Then [Statement 1] end),
(case when true then [Statment 2] end)

As with all expressions, a case expression only returns one value.

Upvotes: 0

Related Questions