Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

How to ensure checking all the conditions?

2889957Sep 12 2018 — edited Sep 13 2018

some of the following if conditional don't work. why? please help me.

GO_BLOCK('STUDENTS_INFO');

    IF

    :ctrl.search_session = 'Session' and

    :ctrl.search_class = 'Class' and

    :ctrl.search_section = 'Section' and

    :ctrl.search_group = 'Group' and

    :ctrl.search_gender = 'Gender' and

    :ctrl.search_religion = 'Religion' then

     message('Select a Category.');

  message('Select a Category.');

  CLEAR_BLOCK;

RAISE FORM_TRIGGER_FAILURE;

    END IF;

    IF        

   

    upper(:ctrl.search_session) = upper('All') and

    (upper(:ctrl.search_class) = upper('All') OR upper(:ctrl.search_class) = upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion')) THEN

    

     --GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    END IF;

   

        IF

    (upper(:ctrl.search_session) = upper('All') OR upper(:ctrl.search_session) = upper('SESSION') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     'UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

        ELSIF

            (upper(:ctrl.search_session) = upper('All') OR upper(:ctrl.search_session) = upper('SESSION') and

    (upper(:ctrl.search_class) = upper('All') OR upper(:ctrl.search_class) = upper('class')) and

    (upper(:ctrl.search_section) <> upper('All') OR upper(:ctrl.search_section) <> upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     'UPPER(SECTIONNAME) = UPPER(:CTRL.SEARCH_SECTION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

       ELSIF

            (upper(:ctrl.search_session) = upper('All') OR upper(:ctrl.search_session) = upper('SESSION') and

    (upper(:ctrl.search_class) = upper('All') OR upper(:ctrl.search_class) = upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) <> upper('All') OR upper(:ctrl.search_gender) <> upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     'UPPER(GENDER) = UPPER(:CTRL.SEARCH_GENDER)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

           

            ELSIF

            (upper(:ctrl.search_session) = upper('All') OR upper(:ctrl.search_session) = upper('SESSION') and

    (upper(:ctrl.search_class) = upper('All') OR upper(:ctrl.search_class) = upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) =  upper('gender')) and

    (upper(:ctrl.search_religion) <> upper('All') OR upper(:ctrl.search_religion) <> upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     'UPPER(RELIGION) = UPPER(:CTRL.SEARCH_RELIGION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

      

           ELSIF

            (upper(:ctrl.search_session) = upper('All') OR upper(:ctrl.search_session) = upper('SESSION') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) =  upper('gender')) and

    (upper(:ctrl.search_religion) <> upper('All') OR upper(:ctrl.search_religion) <> upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     'UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) AND UPPER(RELIGION) = UPPER(:CTRL.SEARCH_RELIGION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

      

           ELSIF

            (upper(:ctrl.search_session) <> upper('All') OR upper(:ctrl.search_session) <> upper('SESSION') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) =  upper('gender')) and

    (upper(:ctrl.search_religion) <> upper('All') OR upper(:ctrl.search_religion) <> upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     'UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION) AND UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) AND UPPER(RELIGION) = UPPER(:CTRL.SEARCH_RELIGION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

      

    

      

       ELSIF

            (upper(:ctrl.search_session) = upper('All') OR upper(:ctrl.search_session) = upper('SESSION') and

    (upper(:ctrl.search_class) = upper('All') OR upper(:ctrl.search_class) = upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) <> upper('All') OR upper(:ctrl.search_group) <> upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) =  upper('gender')) and

    (upper(:ctrl.search_religion) <> upper('All') OR upper(:ctrl.search_religion) <> upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,

     ' UPPER(GROUPNAME) = UPPER(:CTRL.SEARCH_GROUP) AND UPPER(RELIGION) = UPPER(:CTRL.SEARCH_RELIGION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    RESTART HERE

      

      

        ELSE

           

           

         IF

    (upper(:ctrl.search_session) <> upper('All') and

    (upper(:ctrl.search_class) = upper('All') OR upper(:ctrl.search_class) = upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

     set_block_property('STUDENTS_INFO', default_where,'UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    ELSE

             IF

    (upper(:ctrl.search_session) <> upper('All') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) = upper('All') OR upper(:ctrl.search_section) = upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,'UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION) AND     UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) ');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    ELSE

         IF

    (upper(:ctrl.search_session) <> upper('All') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) <> upper('All') OR upper(:ctrl.search_section) <> upper('section')) and

    (upper(:ctrl.search_group) = upper('All') OR upper(:ctrl.search_group) = upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,     'UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION) AND     UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) AND     UPPER(SECTIONNAME) = UPPER(:CTRL.SEARCH_SECTION)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    ELSE

     IF

    (upper(:ctrl.search_session) <> upper('All') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) <> upper('All') OR upper(:ctrl.search_section)<> upper('section')) and

    (upper(:ctrl.search_group) <> upper('All') OR upper(:ctrl.search_group) <> upper('group')) and

    (upper(:ctrl.search_gender) = upper('All') OR upper(:ctrl.search_gender) = upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,'

     UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION) AND     UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) AND     UPPER(SECTIONNAME) = UPPER(:CTRL.SEARCH_SECTION) AND      UPPER(GROUPNAME) = UPPER(:CTRL.SEARCH_GROUP)');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    ELSE

     IF

    (upper(:ctrl.search_session) <> upper('All') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) <> upper('All') OR upper(:ctrl.search_section)<> upper('section')) and

    (upper(:ctrl.search_group) <> upper('All') OR upper(:ctrl.search_group) <> upper('group')) and

    (upper(:ctrl.search_gender) <> upper('All') OR upper(:ctrl.search_gender) <> upper('gender')) and

    (upper(:ctrl.search_religion) = upper('All') OR upper(:ctrl.search_religion) = upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,'

     UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION) AND     UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) AND     UPPER(SECTIONNAME) = UPPER(:CTRL.SEARCH_SECTION) AND      UPPER(GROUPNAME) = UPPER(:CTRL.SEARCH_GROUP) AND UPPER(GENDER) = UPPER(:CTRL.SEARCH_GENDER) ');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    ELSE

          IF

    (upper(:ctrl.search_session) <> upper('All') and

    (upper(:ctrl.search_class) <> upper('All') OR upper(:ctrl.search_class) <> upper('class')) and

    (upper(:ctrl.search_section) <> upper('All') OR upper(:ctrl.search_section)<> upper('section')) and

    (upper(:ctrl.search_group) <> upper('All') OR upper(:ctrl.search_group) <> upper('group')) and

    (upper(:ctrl.search_gender) <> upper('All') OR upper(:ctrl.search_gender) <> upper('gender')) and

    (upper(:ctrl.search_religion) <> upper('All') OR upper(:ctrl.search_religion) <> upper('religion'))) THEN

   

     set_block_property('STUDENTS_INFO', default_where,'

     UPPER(SESSIONYR) = UPPER(:CTRL.SEARCH_SESSION) AND     UPPER(CLASSNAME) = UPPER(:CTRL.SEARCH_CLASS) AND     UPPER(SECTIONNAME) = UPPER(:CTRL.SEARCH_SECTION) AND      UPPER(GROUPNAME) = UPPER(:CTRL.SEARCH_GROUP) AND UPPER(GENDER) = UPPER(:CTRL.SEARCH_GENDER) AND UPPER(RELIGION) = UPPER(:CTRL.SEARCH_RELIGION) ');

     -- GO_BLOCK('STUDENTS_INFO');

      EXECUTE_QUERY;

      set_block_property('STUDENTS_INFO', default_where,'');

       --    GO_BLOCK('CTRL');

    ELSE

       

    CLEAR_BLOCK;

    END IF;

    END IF;

    END IF;

    END IF;

   

    END IF;

   

    END IF;

   

    END IF;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2018
Added on Sep 12 2018
1 comment
104 views