Stack Exchange
write an AND Condition in If statement in oracle
I am checking the text item in oracle form using if statement and an AND condition. Here is my code under the when button pressed. I need the correct syntax suggestion.
   BEGIN      
   IF     
   :LAND_MANAGEMENT.COMPANY      AND
   :LAND_MANAGEMENT.LAND_TYPE            AND    
   :LAND_MANAGEMENT.DEED_NO              AND
   :LAND_MANAGEMENT.LAND_TITLE           AND
   :LAND_MANAGEMENT.LAND_SELLER_NAME     AND 
   :LAND_MANAGEMENT.LAND_AREA            AND     
   :LAND_MANAGEMENT.DEED_VALUE           AND  
   :LAND_MANAGEMENT.ACTUAL_COAST         AND 
   :LAND_MANAGEMENT.REGISTRATION_COAST   IS NOT NULL THEN

   commit_form;
   GO_BLOCK('RECORDVIEW');
   EXECUTE_QUERY();        
   GO_BLOCK('LAND_MANAGEMENT');
   create_record; 
   Clear_block(no_validate);
   FIRST_RECORD; 
   GO_ITEM('LAND_MANAGEMENT.COMPANY');
   END IF;   
   END;


Well, to begin with, a null check of x, y and z is not written x AND y AND z IS NOT NULL, it's x IS NOT NULL AND y IS NOT NULL AND z IS NOT NULL.

The and operator is applied between conditionals, not between columns. You'd need to check every column for null dependently, and then apply ands between these checks:
IF     
   :LAND_MANAGEMENT.COMPANY              IS NOT NULL AND
   :LAND_MANAGEMENT.LAND_TYPE            IS NOT NULL AND    
   :LAND_MANAGEMENT.DEED_NO              IS NOT NULL AND
   :LAND_MANAGEMENT.LAND_TITLE           IS NOT NULL AND
   :LAND_MANAGEMENT.LAND_SELLER_NAME     IS NOT NULL AND 
   :LAND_MANAGEMENT.LAND_AREA            IS NOT NULL AND     
   :LAND_MANAGEMENT.DEED_VALUE           IS NOT NULL AND  
   :LAND_MANAGEMENT.ACTUAL_COAST         IS NOT NULL AND 
   :LAND_MANAGEMENT.REGISTRATION_COAST   IS NOT NULL THEN

