Skip to content

SQL logical condition operator AND OR option

Tako Lee edited this page Mar 2, 2024 · 7 revisions

AND/OR option is used to set format option of AND/OR operator in condition.

1. Type in Delphi

TLinefeedsAndOrOption = (lfbeforeAndOr,lfAfterAndOr,lfNolinebreak);

2. Type in Java

NOT DEFINED YET

3. Uniform Type definition

  • Type name: TFmtANDOR
  • Available values:
    • value: 0, text: at_the_end_of_line
    • value: 1, text: at_the_begin_of_line
    • value: 2, text: at_the_begin_of_line_outside
    • value: 3, text: at_the_begin_of_line_left_align_with_main_keyword
    • value: 4, text: at_the_begin_of_line_right_align_with_main_keyword

Samples

  • AND/OR at the end of line

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  e.department_id = d.department_id AND
           e.last_name = 'Matos';  
  • AND/OR at the begin of line

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  e.department_id = d.department_id
           AND e.last_name = 'Matos';  
  • AND/OR at the begin of line, outside expression.

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  e.department_id = d.department_id
       AND e.last_name = 'Matos';  

    Option: fmt017_where_condition_in_newline = true, type: TFmtBoolean.

    Option: fmt018_where_condition_indent = 4, type: int.

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  
        e.department_id = d.department_id
    AND e.last_name = 'Matos';  
  • AND/OR at the begin of line, left align with main keyword WHERE.

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  e.department_id = d.department_id
    AND    e.last_name = 'Matos';  

    Option: fmt017_where_condition_in_newline = true, type: TFmtBoolean.

    Option: fmt018_where_condition_indent = 4, type: int.

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  
        e.department_id = d.department_id
    AND e.last_name = 'Matos';  
  • AND/OR at the begin of line, right align with main keyword WHERE.

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  e.department_id = d.department_id
      AND  e.last_name = 'Matos';  

    Option: fmt017_where_condition_in_newline = true, type: TFmtBoolean.

    Option: fmt018_where_condition_indent = 4, type: int.

    SELECT e.employee_id, 
           d.location_id  
    FROM   employees e,departments d  
    WHERE  
          e.department_id = d.department_id
      AND e.last_name = 'Matos';  
Clone this wiki locally