You can use control statements and control declarations to write a stored procedure.
Control statements give computational completeness to SQL by providing assignment, conditional execution, loop, and branch capabilities to that language.
Control declarations contain the condition handlers and local variables in a stored procedure.
Related Information
For more information about the list of control statements and control declarations used to write a stored procedure, see SQL Control Statements.