query_script_return

return: quit script execution

SYNOPSIS

statement;
statement;
if (expression)
  return;
statement;

DESCRIPTION

return is a QueryScript statement which, when invoked, aborts execution of script.

return takes no parameters and does not provide with a value. It merely stops execution of running script at point of invocation.

EXAMPLES

Return on condition:

set @x := 3;
while (@x > 0)
{
  select @x;
  set @x := @x - 1;
  if (@x = 1)
    return;
}
select 'will never get here';

+------+
| @x   |
+------+
|    3 |
+------+

+------+
| @x   |
+------+
|    2 |
+------+

SEE ALSO

Flow control, break

AUTHOR

Shlomi Noach
 
common_schema documentation