Skip to content
Tako Lee edited this page Mar 3, 2024 · 24 revisions

image

Delphi

  • gfmtopt.Insert_Parenthesis_in_separate_line, type of boolean, default is false
  • gFmtOpt.Insert_Columnlist_Style, type of TAlignStyle, default is stacked
  • gFmtOpt.Insert_Valuelist_Style, type of TAlignStyle, default is stacked
  • gFmtOpt.DefaultCommaOption, type of TLinefeedsCommaOption , default is after comma
  • gfmtopt.Insert_Indent_Select, type of boolean, default is false
  • gfmtopt.Insert_Columns_Per_line, type of integer, default is 0

Java

  • TODO

Uniform

  • Fit into one line if possible

    Option: fmt039_insert_fit_into_one_line = true, type: TFmtBoolean.

    This option works only length of the whole statement less than max line width.

    INSERT INTO dbo.Points (PointValue) VALUES (CONVERT(Point, '3,4'));

    Option: fmt039_insert_fit_into_one_line = false, type: TFmtBoolean.

    This option works even if the length of the whole statement less than max line width.

    INSERT INTO dbo.Points (PointValue) 
    VALUES (CONVERT(Point, '3,4'));
  • Column list/value list fit into one line if possible

    Option: fmt040_insert_column_list_style = fit_into_one_line, type: TFmtListStyle.

    Option: fmt041_insert_value_list_style = fit_into_one_line, type: TFmtListStyle.

    • VALUES keyword left align with INSERT keyword

      INSERT INTO MyLinkServer.AdventureWorks2008R2.HumanResources.Department (Name, GroupName)
      VALUES (N'Public Relations', N'Executive General and Administration');
    • VALUES keyword right align with INTO keyword

      INSERT INTO MyLinkServer.AdventureWorks2008R2.HumanResources.Department (Name, GroupName)
           VALUES (N'Public Relations', N'Executive General and Administration');
  • Stacked column list

    Option: fmt040_insert_column_list_style = stacked, type: TFmtListStyle.

    • Parenthesis and first column option

      Option: fmt044_insert_column_list_start_parenthesis_in_newline = false, type: TFmtBoolean.

      Option: fmt048_insert_column_list_first_column_in_newline = false, type: TFmtBoolean.

       INSERT INTO Sales.SalesHistory (SalesOrderID,                   
                                       SalesOrderDetailID,             
                                       CarrierTrackingNumber,                                
                                       ModifiedDate)                   
       SELECT * FROM Sales.SalesOrderDetail;

      Option: fmt044_insert_column_list_start_parenthesis_in_newline = true, type: TFmtBoolean.

      Option: fmt045_insert_column_list_start_parenthesis_indent = n, type: int.

      Option: fmt046_insert_column_list_end_parenthesis_in_newline = true, type: TFmtBoolean.

      Option: fmt047_insert_column_list_end_parenthesis_indent = n, type: int.

      Option: fmt048_insert_column_list_first_column_in_newline = true, type: TFmtBoolean.

      Option: fmt049_insert_column_list_first_column_indent = n, type: int.

       INSERT INTO Sales.SalesHistory 
         (
           SalesOrderID,                   
           SalesOrderDetailID,             
           CarrierTrackingNumber,                                
           ModifiedDate
         )                   
       SELECT * FROM Sales.SalesOrderDetail;
    • Comma at the end of line

      Option: fmt042_insert_column_list_comma_option = after_item, type: TFmtCommaOption.

       INSERT INTO Sales.SalesHistory WITH (TABLOCK)
           (SalesOrderID,                   
            SalesOrderDetailID,             
            CarrierTrackingNumber,                                
            ModifiedDate)                   
       SELECT * FROM Sales.SalesOrderDetail;
    • Comma at the begin of line

       INSERT INTO Sales.SalesHistory WITH (TABLOCK)
           (SalesOrderID                   
            ,SalesOrderDetailID             
            ,CarrierTrackingNumber                               
            ,ModifiedDate)                   
       SELECT * FROM Sales.SalesOrderDetail;
    • Comma at the begin of line, align columns

       INSERT INTO Sales.SalesHistory WITH (TABLOCK)
           ( SalesOrderID                   
            ,SalesOrderDetailID             
            ,CarrierTrackingNumber                               
            ,ModifiedDate)                   
       SELECT * FROM Sales.SalesOrderDetail;
    • Comma at the begin of line, align columns, space between comma and column is 1 or n

      Option: fmt042_insert_column_list_comma_option = before_item_outside_list_with_n_space, type: TFmtCommaOption.

      Option: fmt043_insert_column_list_comma_space = n, type: int.

       INSERT INTO Sales.SalesHistory WITH (TABLOCK)
           (  SalesOrderID                   
            , SalesOrderDetailID             
            , CarrierTrackingNumber                               
            , ModifiedDate)                   
       SELECT * FROM Sales.SalesOrderDetail;
  • Stacked value list

    Option: fmt041_insert_value_list_style = stacked, type: TFmtListStyle.

    • Parenthesis and first value option

      Option: fmt050_insert_value_list_start_parenthesis_in_newline = true, type: TFmtBoolean.

      Option: fmt051_insert_value_list_start_parenthesis_indent = n, type: int.

      Option: fmt052_insert_value_list_end_parenthesis_in_newline = true, type: TFmtBoolean.

      Option: fmt053_insert_value_list_end_parenthesis_indent = n, type: int.

      Option: fmt054_insert_value_list_first_value_in_newline = true, type: TFmtBoolean.

      Option: fmt055_insert_value_list_first_value_indent = n, type: int.

      INSERT INTO Production.Location WITH (XLOCK)(Name, CostRate, Availability)
      VALUES 
        (
          N'Final Inventory', 
          15.00, 
          80.00
        );
    • Comma at the end of line

      INSERT INTO Production.Location WITH (XLOCK)(Name, CostRate, Availability)
      VALUES 
        (N'Final Inventory', 
         15.00, 
         80.00);
    • Comma at the begin of line

      INSERT INTO Production.Location WITH (XLOCK)(Name, CostRate, Availability)
      VALUES 
        (N'Final Inventory' 
         ,15.00, 
         ,80.00);
    • Comma at the begin of line, align columns

      INSERT INTO Production.Location WITH (XLOCK)(Name, CostRate, Availability)
      VALUES 
        ( N'Final Inventory' 
         ,15.00, 
         ,80.00);
    • Comma at the begin of line, align columns, space between comma and column is 1 or n

      INSERT INTO Production.Location WITH (XLOCK)(Name, CostRate, Availability)
      VALUES 
        (  N'Final Inventory' 
         , 15.00, 
         , 80.00);
  • Insert ... select, select statement indent from 0 to n

    Option: fmt056_insert_subquery_indent = n, type: int.

    INSERT TOP (10) INTO HumanResources.NewEmployee 
        SELECT
           e.BusinessEntityID, c.LastName, c.FirstName, pp.PhoneNumber,
           a.AddressLine1, a.City, sp.StateProvinceCode, 
           a.PostalCode, e.CurrentFlag
        FROM HumanResources.Employee e
            INNER JOIN Person.BusinessEntityAddress AS bea
            ON e.BusinessEntityID = bea.BusinessEntityID
            INNER JOIN Person.Address AS a
            ON bea.AddressID = a.AddressID
            INNER JOIN Person.PersonPhone AS pp
            ON e.BusinessEntityID = pp.BusinessEntityID
            INNER JOIN Person.StateProvince AS sp
            ON a.StateProvinceID = sp.StateProvinceID
            INNER JOIN Person.Person as c
            ON e.BusinessEntityID = c.BusinessEntityID;    
Clone this wiki locally