DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info) case-statement

Info Catalog (mysql.info) if-statement (mysql.info) flow-control-constructs (mysql.info) loop-statement
 
 17.2.10.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 routines implements a complex
 conditional construct. If a SEARCH_CONDITION evaluates to true, the
 corresponding SQL statement list is executed. If no search condition
 matches, the statement list in the `ELSE' clause is executed. Each
 STATEMENT_LIST consists of one or more statements.
 
 stored routines 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) if-statement (mysql.info) flow-control-constructs (mysql.info) loop-statement
automatically generated byinfo2html