public.browse_by_actor
Documentation | Dell DVD Store |
Schema | public |
Name | browse_by_actor |
Brows products(DVD films) by actor.
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 | actor_in | text | The name of the actor. |
The name of the actor. |
Script
CREATE OR REPLACE FUNCTION public.browse_by_actor(batch_size_in integer, actor_in text) RETURNS SETOF products LANGUAGE plpgsql AS $function$ DECLARE vector_in TEXT; BEGIN vector_in := replace(trim(both from actor_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