public.browse_by_title
Documentation | Dell DVD Store |
Schema | public |
Name | browse_by_title |
Brows products(DVD films) by title.
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | OUT | Returns | products | Returns film's list. |
Returns film's list. | ||||
2 | IN | batch_size_in | integer | Films's limit |
Films's limit | ||||
3 | IN | title_in | text | The title of the film. |
The title of the film. |
Script
CREATE OR REPLACE FUNCTION public.browse_by_title(batch_size_in integer, title_in text) RETURNS SETOF products LANGUAGE plpgsql AS $function$ DECLARE vector_in TEXT; BEGIN vector_in := replace(trim(both from title_in), ' ','&'); RETURN QUERY SELECT * FROM PRODUCTS WHERE to_tsvector('simple',ACTOR) @@ to_tsquery(vector_in) LIMIT batch_size_in; RETURN; END; $function$ |
Exported: 2018-11-09 16:14, Last imported: 2018-08-06 09:39