Passing filter params to a sub query I'd like to create a view from the query below, but the query contains a sub query which I need to apply a filter to (the place is marked with a comment). I'm wondering if it's possible somehow to adjust the query to have the subquery filtered by those params.

The query

select
 form_name,
 nvl(form_pravo,0) as form_pravo,
 nvl(fl_pravo,0) as menu_pravo,
 menu_nazov as menu_name    
from(
SELECT 
    form_name,
    pravo as form_pravo
  FROM (
    SELECT 
        f.ID as form_id,
        f.NAME as form_name,
        f.XF_MODULY_ID as modul_id,
        u.ID as uziv_id,
        f.XF_MODULY_ID       
          FROM xf_forms f, xf_uziv u) uf
       LEFT JOIN
        xp_forms_uzivs fu ON form_id  = fu.XF_FORM_ID AND uziv_id = fu.XF_UZIV_ID
            where modul_id = 14 and uziv_id = 1 -- &lt;--HERE
            )
        full join (
            select 
                SUBOR,
                FL_PRAVO,
                menu_nazov,
                uziv_id,
                modul_id
            from xv_uziv_menu              
        ) um on form_name = um.subor
        where uziv_ID = 1 and modul_id = 14
In MySQL You can try a function

create function modul_id() returns INTEGER DETERMINISTIC NO SQL return @modul_id;
create view v (your select... where modul_id = modul_id()...);
select * from (select @modul_id:=14 modul_id) m, v;


not tested on your query...