public.film_in_stock
Documentation | Pagila |
Schema | public |
Name | film_in_stock |
Module | Functions |
The film_in_stock 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 | OUT | Returns | integer | |
2 | IN | p_film_id | integer | 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. | ||||
3 | IN | p_store_id | integer | 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. | ||||
4 | OUT | p_film_count | integer | 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
CREATE OR REPLACE FUNCTION public.film_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer) RETURNS SETOF integer LANGUAGE sql AS $function$ SELECT inventory_id FROM inventory WHERE film_id = $1 AND store_id = $2 AND inventory_in_stock(inventory_id); $function$ |
Exported: 2018-10-12 17:07, Last imported: 2018-08-06 09:25