Skip to content

Commit

Permalink
Add more types of queries that should not be formatted by SQL formatt…
Browse files Browse the repository at this point in the history
…er because they are a variant of pass-through queries.
  • Loading branch information
bclothier committed Oct 20, 2023
1 parent 736c33c commit 5b5e037
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Version Control.accda.src/modules/clsDbQuery.cls
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ Private Sub IDbComponent_Export(Optional strAlternatePath As String)
On Error GoTo 0
If strSql <> vbNullString Then
' Pass-through queries should not be formatted, since they support formatting and comments.
If Options.SaveQuerySQL And dbs.QueryDefs(m_Query.Name).Type <> dbQSQLPassThrough Then
With New clsSqlFormatter
Perf.OperationStart "Format SQL"
WriteFile .FormatSQL(strSql), strFile
Perf.OperationEnd
End With
If Options.SaveQuerySQL Then
Select Case dbs.QueryDefs(m_Query.Name).Type
Case dbQSQLPassThrough, dbQSPTBulk, dbQSetOperation
'Do not format
Case Else
With New clsSqlFormatter
Perf.OperationStart "Format SQL"
WriteFile .FormatSQL(strSql), strFile
Perf.OperationEnd
End With
End Select
Else
WriteFile strSql, strFile
End If
Expand Down

0 comments on commit 5b5e037

Please sign in to comment.