General SQL Parser and SQL Pretty Printer Formatter options

Index

Available format options for keyword align in select/delete/insert/update:

gfmtopt.Select_keywords_alignOption Type: TAlignOption Default: aloLeft

Example format options:

gfmtopt.Select_keywords_alignOptionaloLeft

Formatted SQL:

DELETE FROM job_history jh 
WHERE  employee_id = (SELECT employee_id 
                      FROM   employee e 
                      WHERE  jh.employee_id = e.employee_id 
                             AND start_date = (SELECT Min(start_date) 
                                               FROM   job_history jh 
                                               WHERE  jh.employee_id = e.employee_id) 
                             AND 5 > (SELECT Count( * ) 
                                      FROM   job_history jh 
                                      WHERE  jh.employee_id = e.employee_id 
                                      GROUP  BY employee_id 
                                      HAVING Count( * ) >= 4)); 

INSERT INTO employees
            (employee_id,
             first_name,
             last_name,
             email,
             phone_number,
             hire_date,
             job_id,
             salary,
             commission_pct,
             manager_id,
             department_id) 
VALUES     (113,
            'Louis',
            'Popp',
            'Ldd',
            '515.124.222',
            sysdate,
            'Ac_account',
            8900,
            NULL,
            205,
            100); 

UPDATE employees 
SET    department_id = 70 
WHERE  employee_id = 113; 


Example format options:

gfmtopt.Select_keywords_alignOptionaloRight

Formatted SQL:

DELETE FROM job_history jh 
 WHERE employee_id = (SELECT employee_id 
                        FROM employee e 
                       WHERE jh.employee_id = e.employee_id 
                             AND start_date = (SELECT Min(start_date) 
                                                 FROM job_history jh 
                                                WHERE jh.employee_id = e.employee_id) 
                             AND 5 > (SELECT Count( * ) 
                                        FROM job_history jh 
                                       WHERE jh.employee_id = e.employee_id 
                                       GROUP BY employee_id 
                                      HAVING Count( * ) >= 4)); 

INSERT INTO employees
            (employee_id,
             first_name,
             last_name,
             email,
             phone_number,
             hire_date,
             job_id,
             salary,
             commission_pct,
             manager_id,
             department_id) 
     VALUES(113,
            'Louis',
            'Popp',
            'Ldd',
            '515.124.222',
            sysdate,
            'Ac_account',
            8900,
            NULL,
            205,
            100); 

UPDATE employees 
   SET department_id = 70 
 WHERE employee_id = 113;