Working with IN, OUT, and INOUT
MySQL stored procedures have three directions that a parameter can be defined in. This is mandatory, which means that a parameter must be set to one of the following:
IN
: The value is only being passed to the stored procedure. It is used within the procedure. This is the same as providing input to the stored procedure.OUT
: The value is only passed out of the stored procedure; any external variables that have been assigned to this position will take on the value that's passed out. This is similar to returning values from a stored procedure.INOUT
, A variable and its value (ExtVal
) are passed to the stored procedure (IntVal
) and can be modified within it. When the stored procedure is completed, the external value (ExtVal
) will equal the modified value (IntVal
).
In the next exercise, you will learn how to use the IN
and INOUT
parameters in a MySQL stored procedure.
Exercise 6.05 – IN and INOUT
The Publicity Department...