MySQL stored procedures are frequently used. The following describes the connection between MySQL stored procedures and databases in detail. If you are interested in MySQL stored procedures, take a look.
1. to convert a TABLE from one type to another, use the alter table statement, which indicates the New Type:
Alter table t ENGINE = MYISAM;
Alter table t TYPE = BDB;
Ii. MySQL stored procedure:
MySQL storage programs are particularly useful in the following situations:
1. When you write multi-customer applications in different languages, or multi-customer applications run on different platforms and need to perform the same database operations.
2. Security is critical. For example, a bank uses a storage program for all common operations. This provides a robust and secure environment for programs to ensure that every operation is properly logged. In such a setting, the application and the user cannot directly access the database table, but only the specified storage program can be executed. Stored programs and functions are subprograms created using the create procedure and create function statements. A sub-program is either a program or a function. Use the CALL statement to CALL a program. The program can only return values using output variables. Just like other function calls, a function can be called out of a statement by referencing the function name.) A function can return a scalar value. The storage subroutine can also call other storage subroutines.
In MySQL 5.1, a storage subroutine or function is associated with a specific database. Here are a few meanings:
1. When a subprogram is called, an implicit USE db_name is executed and the execution stops when the subprogram ends ). It is not allowed to store USE statements in subprograms.
2. You can use the database name to limit the subprogram name. This can be used to reference a subroutine that is not in the current database. For example, to reference a stored program p or function f associated with the test database, you can CALL test. p () or test. f ().
3. When the database is removed, all stored subroutines associated with it are also removed.
Example of creating a MySQL Stored Procedure
MySql stored procedure with Parameters
How to process MySQL record duplication
How to query time periods in MySql
How to back up and restore a MySQL database