DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info.gz) CASE Statement

Info Catalog (mysql.info.gz) IF Statement (mysql.info.gz) Flow Control Constructs (mysql.info.gz) LOOP Statement
 
 19.1.9.2 `CASE' Statement
 .........................
 
      CASE CASE_VALUE
          WHEN WHEN_VALUE THEN STATEMENT_LIST
          [WHEN WHEN_VALUE THEN STATEMENT_LIST ...]
          [ELSE STATEMENT_LIST]
      END CASE
 
 Or:
 
      CASE
          WHEN SEARCH_CONDITION THEN STATEMENT_LIST
          [WHEN SEARCH_CONDITION THEN STATEMENT_LIST ...]
          [ELSE STATEMENT_LIST]
      END CASE
 
 The `CASE' statement for stored procedures implements a complex
 conditional construct. If a SEARCH_CONDITION evaluates to true, the
 corresponding SQL statement is executed. If no search condition
 matches, the statement in the `ELSE' clause is executed.
 
 stored procedure differs slightly from that of the SQL `CASE'
 _expression_ described in  Control flow functions.  The `CASE'
 statement cannot have an `ELSE NULL' clause, and it is terminated with
 `END CASE' instead of `END'.
 
Info Catalog (mysql.info.gz) IF Statement (mysql.info.gz) Flow Control Constructs (mysql.info.gz) LOOP Statement
automatically generated byinfo2html