A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mariadb.com/docs/server/reference/sql-statements/programmatic-compound-statements/return below:

RETURN | MariaDB Documentation

RETURN | MariaDB Documentation 14-day MaxScale Trial: Explore the latest version of our advanced database proxy! Start Trial CtrlK Download MariaDBContact Us Powered by GitBook On this page

Was this helpful?

Edit on GitHub Export as PDF
  1. Reference
  2. SQL Statements
  3. Programmatic & Compound Statements
RETURN Syntax
RETURN expr

The RETURN statement terminates execution of a stored function and returns the value expr to the function caller. There must be at least one RETURN statement in a stored function. If the function has multiple exit points, all exit points must have a RETURN.

This statement is not used in stored procedures, triggers, or events. LEAVE can be used instead.

The following example shows that RETURN can return the result of a scalar subquery:

CREATE FUNCTION users_count() RETURNS BOOL
   READS SQL DATA
BEGIN
   RETURN (SELECT COUNT(DISTINCT User) FROM mysql.user);
END;

This page is licensed: GPLv2, originally from fill_help_tables.sql

PreviousRESIGNAL NextSELECT INTO

Last updated 10 days ago

Was this helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4