Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 36.3Mb
PDF (A4) - 36.3Mb
Man Pages (TGZ) - 235.4Kb
Man Pages (Zip) - 347.1Kb
Info (Gzip) - 3.3Mb
Info (Zip) - 3.3Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  DECLARE Statement

13.6.3 DECLARE Statement

The DECLARE statement is used to define various items local to a program:

DECLARE is permitted only inside a BEGIN ... END compound statement and must be at its start, before any other statements.

Declarations must follow a certain order. Cursor declarations must appear before handler declarations. Variable and condition declarations must appear before cursor or handler declarations.