A function that takes a parameter, performs an operation using an SQL function, and returns the result : Function : Procedure Function SQL / MySQL


SQL / MySQL » Procedure Function » Function »

 

A function that takes a parameter, performs an operation using an SQL function, and returns the result


 
mysql>
mysql>
mysql> CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)
    ->     RETURN CONCAT('Hello, ',s,'!');
Query OK, rows affected (0.00 sec)

mysql>
mysql>
mysql> SELECT hello('world');
+----------------+
| hello('world') |
+----------------+
| Hello, world!  |
+----------------+
row in set (0.00 sec)

mysql>
mysql>
mysql> drop function hello;
Query OK, rows affected (0.00 sec)

mysql>
mysql>

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

SQL / MySQL

 Navioo Procedure Function
» Function