SPOOL create_nnpcv_v.lst

CREATE OR REPLACE VIEW nom_net_point_cat_vals_v AS
SELECT nnpcv_id
     , value
     , gas_day
     , coca_id
     , nomi_id
     , conp_id
FROM   nom_net_point_cat_vals
WHERE  nomi_id IN
     ( SELECT nomi_id
       FROM   nominations
       WHERE  cont_id IN
             ( SELECT cont_id
               FROM   contracts
               WHERE  cust_id IN
                     ( SELECT cust_id
                       FROM   customers
                       WHERE  cuty_id IN
                             ( SELECT cuty_id
                               FROM   customer_types
                               WHERE  code IN
                                     ( SELECT SUBSTR(granted_role,5,3)
                                       FROM   user_role_privs
                                       WHERE  granted_role IN ('EFT_OMT_RO','EFT_PUW_RO')
                                     )
                             )
                     )
             )
     )
/

SPOOL OFF
