film_in_stock
Documentation | Sakila |
Name | film_in_stock |
Module | Procedures |
The film_in_stock stored procedure is used to determine whether any copies of a given film are in stock at a given store.
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | IN | p_film_id | int(10, 0) | The ID of the film to be checked, from the film_id column of the film table. |
The ID of the film to be checked, from the film_id column of the film table. | ||||
2 | IN | p_store_id | int(10, 0) | The ID of the store to check for, from the store_id column of the store table. |
The ID of the store to check for, from the store_id column of the store table. | ||||
3 | OUT | p_film_count | int(10, 0) | An OUT parameter that returns a count of the copies of the film in stock. |
An OUT parameter that returns a count of the copies of the film in stock. |
Script
BEGIN SELECT inventory_id FROM inventory WHERE film_id = p_film_id AND store_id = p_store_id AND inventory_in_stock(inventory_id); SELECT FOUND_ROWS() INTO p_film_count; END |
Exported: 2018-10-12 17:43, Last imported: 2018-08-06 10:44