Creating a Single-Statement Procedure : Procedure « Procedure Function « SQL / MySQL






Creating a Single-Statement Procedure

    

mysql>
mysql>
mysql> create procedure myProc ()
    ->   SELECT id,first_name FROM employee;
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> call myProc ();

mysql>
mysql> drop procedure myProc;
Query OK, 0 rows affected (0.00 sec)

          
    
    
  








Related examples in the same category

1.Using an OUT parameter
2.Calling a Single-Statement Procedure
3.Creating a Multistatement Stored Procedure
4.The ALTER statement lets you change the characteristics of a stored procedure
5.To remove a stored procedures, use the DROP statement
6.Calculate the power in procedure
7.Cleanup table with procedure
8.Compare value in a procedure
9.Output comparison value from a procedure
10.Find out the age with procedure
11.Syntax for Changing store procedures
12.Syntax for Creating store procedures
13.Drop table by procedure