Why is my stored procedure returning more than one row?

Why is my stored procedure returning more than one row?

Hello im having a hard time with this stored procedure. im getting the error: Result consisted of more than one row. Any solutions and recommendations are much appreciated! and caused by this returning more than one row.

Is it possible to handle more than one type of error?

It is possible for one except clause to handle more than one kind of error: we can provide a tuple of exception types instead of a single type:

How to retrieve multiple rows from stored procedure in MySQL?

Or else it returns an error as I mentioned below. The error is not in your procedure. The error is in your query – it returns more then one row, but you cannot set multiple result into scalar value ’emp1′. You should limit your query so that it returns one row.

What do you call the process of finding errors in a program?

Errors or mistakes in a program are often referred to as bugs. They are almost always the fault of the programmer. The process of finding and eliminating errors is called debugging.

Can a select return more than one row?

The procedure runs a SELECT to return a resultset, then issues an UPDATE statement to modify zero or more rows in a table. The next part of the procedure is confusing; it’s not clear what we are trying to achieve. The SELECT can return zero, one or more rows.

Why does MySQL throw error when select returns more than one row?

The error is due to the INTO clause in the second SELECT statement. That wouldn’t be an error if the SELECT returned no more than one row. But if that SELECT returns more than one row, MySQL will throw 1172 error.

What causes a database to return more than one row?

Any solutions and recommendations are much appreciated! and caused by this returning more than one row. How you solve it depends on your requirements. Does the existence of multiple rows imply the database is in need of some cleaning, for example?