
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Create a stored procedure to get the detail of a particular MySQL table stored in a database?
Following example will create a procedure named ‘tabledetails’ which gives all the details of a particular table stored in 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)
- Related Articles
- MySQL Stored Procedure to create a table?
- Use IN() to get only a particular record in a MySQL stored procedure?
- Get database name from a query implemented in a MySQL Stored Procedure?
- MySQL stored procedure to execute SHOW CREATE TABLE?
- Create a table inside a MySQL stored procedure and insert a record on calling the procedure
- How to create a Stored procedure in a database using JDBC API?
- How can I create a stored procedure to insert values in a MySQL table?
- How can I create a stored procedure to update values in a MySQL table?
- Create a stored procedure with delimiter in MySQL
- Create a MySQL stored procedure, which takes the name of the database as its parameter, to list the tables with detailed information in a particular database.
- Insert data in a table in MySQL stored procedure?
- How can I create a stored procedure to delete values from a MySQL table?
- Display table records from a stored procedure in MySQL
- How to create a Stored procedure in Oracle database using JDBC API?
- How can we see the list of stored procedures and stored functions in a particular MySQL database?

Advertisements