DELIMITER//mysql>CreateProceduretabledetails() ->BEGIN ->DESCRIBEStudent_detail; ->END//QueryOK,0rowsaffected(0.00sec)"/> DELIMITER//mysql>CreateProceduretabledetails() ->BEGIN ->DESCRIBEStudent_detail; ->END//QueryOK,0rowsaffected(0.00sec)">
The following example will create a procedure called "tabledetails" that provides all the details of a specific table stored in the database.
mysql> DELIMITER // mysql> Create Procedure tabledetails() -> BEGIN -> DESCRIBE Student_detail; -> END // Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> CALL tabledetails; +-------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------+------+-----+---------+-------+ | Studentid | int(11) | NO | PRI | NULL | | | StudentName | varchar(20) | YES | | NULL | | | address | varchar(20) | YES | | NULL | | +-------------+-------------+------+-----+---------+-------+ 3 rows in set (0.01 sec) Query OK, 0 rows affected (0.04 sec)
The above is the detailed content of Create a stored procedure to get details of a specific MySQL table stored in a database?. For more information, please follow other related articles on the PHP Chinese website!