SPOOL create_syop_v.lst

CREATE OR REPLACE VIEW system_options_v AS
SELECT syop_id_the_parent_of
     , syop_id
     , option_type
     , name
     , description
     , module_name
     , mtxt_text_number
     , display_seq
FROM   system_options syop
WHERE EXISTS ( SELECT NULL
               FROM   profile_options prop
                     ,system_profiles sypr
               WHERE  prop.sypr_id = sypr.sypr_id
               AND    prop.syop_id = syop.syop_id
               AND    sypr.name NOT IN ('ADVANTICA','SYSTEM')
             )
/

SPOOL OFF
