MySQL SQLLesson 44Free preview
MySQL Stored Procedures
This lesson is part of MySQL · All levels
Summary
A stored procedure is a collection of SQL statements stored on a server and can be called many times by a specific name. With procedures, business logic such as reports or update processes can be centralized on the server so that it is consistent for all applications. The procedure supports IN, OUT, and INOUT parameters as well as local variables to temporarily store results.
Key points
- The stored procedure is created with the CREATE PROCEDURE and called with the CALL
- Parameters IN for input, OUT for output, INOUT for both
- Reduces data transfer because logic runs on the server side
- It can contain repetition, branching, variable, and error handling handlers
- Can be removed by DROP procedure and viewed by SHOW CREATE procedure
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.