Be Careful When Emulating Parameterised Views with SYS_CONTEXT in Oracle

Everyone who writes complex SQL (or dare I say, move business logic into the database?) wishes for parameterised views from time to time. This hypothetical syntax would be terrific: CREATE VIEW v_categories_per_actor( p_actor_id NUMBER ) AS SELECT DISTINCT c.name FROM category c JOIN film_category fc USING (category_id) JOIN film_actor fa USING (film_id) WHERE fa.actor_id = … Continue reading Be Careful When Emulating Parameterised Views with SYS_CONTEXT in Oracle