Home > Database > Mysql Tutorial > body text

Create a stored procedure to get details of a specific MySQL table stored in a database?

王林
Release: 2023-08-25 15:37:02
forward
1459 people have browsed it

创建一个存储过程来获取数据库中存储的特定 MySQL 表的详细信息?

The following example will create a procedure called "tabledetails" that provides all the details of a specific table stored in the database.

Example

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!