Search code examples
zend-frameworkmysql

Zend Equivalent to Update Case


I am looking to create a query similar to the below using the Zend Framework.

  UPDATE table
   SET column = CASE id
    WHEN 1 THEN 'value 3'
    WHEN 2 THEN 'value 9'
    WHEN 7 THEN 'value 1'
   END
  WHERE id IN (1,2,7)

What is the 'Zend Way' of doing Case Updates?

As a work around I am using Zend_DB_Expr but would prefer to not.


Solution

  • There is none.

    Zend_Db_Expr is the way to go if you want to use CASE statements.