←Select platform

NewLineBeforeGroupByClause Property

Summary

Gets or sets a value indicating whether to include a line break before GROUP BY clauses in the formatted SQL result.

Syntax

C#
C++/CLI
public bool NewLineBeforeGroupByClause { get; set; } 
public:  
   property bool NewLineBeforeGroupByClause 
   { 
      bool get() 
      void set(bool value) 
   } 

Property Value

true to include a line break before GROUP BY clauses; otherwise, false.

Example

C#
using Leadtools.Dicom; 
using Leadtools.Dicom.Common; 
using Leadtools.Dicom.Common.Extensions; 
using Leadtools; 
using Leadtools.Dicom.Common.Linq.BasicDirectory; 
using Leadtools.Dicom.Common.DataTypes; 
 
using Leadtools.Codecs; 
 
 
public static void FormatSqlExample() 
{ 
   // unformatted SQL  
   string sql = 
      $"SELECT Patient.PatientID FROM Instance " + 
      $"INNER " + 
      $"JOIN Series on Instance.SeriesInstanceUID " + 
      $"= Series.SeriesInstanceUID INNER JOIN Study on  Series.StudyInstanceUID = " + 
      $"Study.StudyInstanceUID INNER JOIN Patient on Study.PatientID = Patient.PatientID WHERE " + 
      $"Patient.PatientID Like '%1%' ORDER BY PatientID"; 
 
   Formatters.FormatSqlOptions options = new Formatters.FormatSqlOptions(); 
   options.NewLineBeforeFromClause = true; 
   options.NewLineBeforeGroupByClause = true; 
   options.NewLineBeforeHavingClause = true; 
   options.NewLineBeforeJoinClause = true; 
   options.NewLineBeforeOrderByClause = true; 
   options.NewLineBeforeWhereClause = true; 
 
   string formattedSql = Formatters.FormatSql(sql, options); 
 
   // This is the result: 
   //  
   //    SELECT Patient.PatientID 
   //    FROM Instance 
   //    INNER JOIN Series on Instance.SeriesInstanceUID = Series.SeriesInstanceUID 
   //    INNER JOIN Study on Series.StudyInstanceUID = Study.StudyInstanceUID 
   //    INNER JOIN Patient on Study.PatientID = Patient.PatientID 
   //    WHERE Patient.PatientID Like '%1%' 
   //    ORDER BY PatientID 
 
   Console.WriteLine(formattedSql); 
} 

Requirements

Target Platforms

See Also

FormatSqlOptions Class

FormatSqlOptions Members

Leadtools.Dicom.Common.Extensions Namespace

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Common Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.