If I call a function several time then will it execute every time or just execute once and the value will be used then after several time? Example:
select my_fu
It's very simple to run the MySQL function.
Login to MySQL command prompt using command:
$> mysql -u root -p
Then use the database using:
mysql> use database_name
Then run the MySQL function using:
mysql> delimiter //
mysql> CREATE PROCEDURE simpleproc (OUT param1 INT)
-> BEGIN
-> SELECT COUNT(*) INTO param1 FROM t;
-> END//
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
mysql> CALL simpleproc(@a);
Query OK, 0 rows affected (0.00 sec)
Instead of procedure we can add any multiple line function in above example.