In short, DECLARE statements must be at the beginning of a block. This can be the beginning of the very first block (for a global variable) or at the beginning of any embedded block (for a local variable). A DECLARE statement cannot follow other executable code in the same block.