Blog

python tutorials and learn python

Created with Sketch.

MySQL Error Handling in Stored Procedures

MySQL Error Handling in Stored Procedures Summary: in this tutorial, you will learn how to use MySQL handler to handle errors encountered in stored procedures. When an error occurs inside a stored procedure, it is important to handle it appropriately, such as continuing or exiting the current code block’s execution, and issuing a meaningful error…
Read more

MySQL LEAVE

MySQL LEAVE Summary: in this tutorial, you will learn how to the MySQL LEAVE statement to exit a stored program or terminate a loop. Introduction to MySQL LEAVE statement The LEAVE statement exits the flow control that has a given label. The following shows the basic syntax of the LEAVE statement: LEAVE label; Code language:…
Read more

MySQL REPEAT Loop

MySQL REPEAT Loop Summary: in this tutorial, you will learn how to use the MySQL REPEAT statement to execute one or more statements until a search condition is true. The REPEAT statement executes one or more statements until a search condition is true. Here is the basic syntax of the REPEAT loop statement: [begin_label:] REPEAT…
Read more

MySQL WHILE Loop

MySQL WHILE Loop Summary: in this tutorial, you will learn how to use the MySQL WHILE loop statement to execute one or more statements repeatedly as long as a condition is true. Introduction to MySQL WHILE loop statement The WHILE loop is a loop statement that executes a block of code repeatedly as long as…
Read more

MySQL LOOP

MySQL LOOP Summary: in this tutorial, you will learn how to use MySQL LOOP statement to run a block of code repeatedly based on a condition. Introduction to MySQL LOOP statement The LOOP statement allows you to execute one or more statements repeatedly. Here is the basic syntax of the LOOP statement: [begin_label:] LOOP statement_list…
Read more

MySQL CASE Statement

MySQL CASE Statement Summary: in this tutorial, you will learn how to use MySQL CASE statements to construct complex conditional statements inside stored procedures. Besides the IF statement, MySQL provides an alternative conditional statement called the CASE statement for constructing conditional statements in stored procedures. The CASE statements make the code more readable and efficient. The CASE statement has two…
Read more

MySQL IF Statement

MySQL IF Statement Summary: in this tutorial, you will learn how to use MySQL IF statement to execute a block of SQL code based on a specified condition. Note that MySQL has an IF() function that is different from the IF statement described in this tutorial. The IF statement has three forms: simple IF-THEN statement, IF-THEN-ELSE…
Read more

Listing Stored Procedures

Listing Stored Procedures Summary: in this tutorial, you will learn how to list stored procedures from databases in a MySQL Server. Listing stored procedures using SHOW PROCEDURE STATUS statement Here is the basic syntax of the SHOW PROCEDURE STATUS statement: SHOW PROCEDURE STATUS [LIKE ‘pattern’ | WHERE search_condition] Code language: SQL (Structured Query Language) (sql)…
Read more

Alter Stored Procedures

Alter Stored Procedures Summary: in this tutorial, you will learn how to alter an existing stored procedure in the database using MySQL Workbench. Sometimes, you may want to alter a stored procedure by adding or removing parameters or even changing its body. Fortunately, MySQL does not have any statement that allows you to directly modify…
Read more

MySQL Stored Procedure Parameters

MySQL Stored Procedure Parameters Summary: in this tutorial, you will learn how to create stored procedures with parameters, including IN, OUT, and INTOUT parameters. Introduction to MySQL stored procedure parameters Often, stored procedures have parameters. The parameters make the stored procedure more useful and reusable. A parameter in a stored procedure has one of three…
Read more