title: Multiple case statement in merge statement of oracle
body: <p>I am posting a part of my working merge statement as shown below where I am setting 10 for <code>MWAN,MGWAN,MWLAN,MLAN,DDOS ,mss</code> else 20</p>
  
  <pre><code>MERGE INTO table2 a
  USING table1 b ON (a.second_name = b.first_name)
  
  WHEN MATCHED THEN
    UPDATE
    SET a.friendly_name = TRIM(b.friendly_name),
      a.account_number  = TRIM(b.account_no),
      a.ne_type         = TRIM(b.ci_type),
      a.service_type_id = CASE
                          WHEN upper(trim(b.company_name)) LIKE '%MWAN%'
                               OR upper(trim(b.company_name)) LIKE '%MGWAN%'
                               OR upper(trim(b.company_name)) LIKE '%MWLAN%'
                               OR upper(trim(b.company_name)) LIKE '%MLAN%'
                               OR upper(trim(b.company_name)) LIKE '%DDOS%'
                               OR trim(b.first_name) LIKE 'mss%'
                            THEN 10 ELSE 20 END,
  </code></pre>
  
  <p>my new requirement is if <code>DDOS</code> appears set it to 30,so the following change is sufficient </p>
  
  <pre><code> MERGE INTO table2 a
      USING table1 b ON (a.second_name = b.first_name)
  
      WHEN MATCHED THEN
        UPDATE
        SET a.friendly_name = TRIM(b.friendly_name),
          a.account_number  = TRIM(b.account_no),
          a.ne_type         = TRIM(b.ci_type),
          a.service_type_id = CASE
                              WHEN upper(trim(b.company_name)) LIKE '%MWAN%'
                                   OR upper(trim(b.company_name)) LIKE '%MGWAN%'
                                   OR upper(trim(b.company_name)) LIKE '%MWLAN%'
                                   OR upper(trim(b.company_name)) LIKE '%MLAN%'
  
  
  
                                   OR trim(b.first_name) LIKE 'mss%'
                                     THEN 10 
                              WHEN upper(trim(b.company_name)) LIKE '%DDOS%' 
                                     THEN 30
                              ELSE
                                          20
                              END.
  </code></pre>
  
  <p>I dont have oracle sql developer now, i will test later ,but what ever my guess work is correct?or any syntax error <code>CASE</code> block</p>