Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added * expression for indicating to select all fields from a table. C…
…loses #11. This is particular relevant when utilising the TableJoins because by default all fields are selected, however sometimes aliases need to be added to particular fields.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
' ___________________________________________________ | ||
' | ||
' (c) Hi-Integrity Systems 2012. All rights reserved. | ||
' www.hisystems.com.au - Toby Wicks | ||
' ___________________________________________________ | ||
' | ||
|
||
Option Strict On | ||
Option Explicit On | ||
|
||
Namespace SQL | ||
|
||
''' <summary> | ||
''' Represents '*' or 'T.*' when used to select all fields from a table or join. | ||
''' </summary> | ||
''' <remarks></remarks> | ||
Public Class SQLAllFieldsExpression | ||
Inherits SQLExpression | ||
|
||
Private pobjTable As SQLSelectTable | ||
|
||
Public Sub New() | ||
|
||
End Sub | ||
|
||
Public Sub New(ByVal objTable As SQLSelectTable) | ||
|
||
Me.Table = objTable | ||
|
||
End Sub | ||
|
||
Public Property Table() As SQLSelectTable | ||
Get | ||
|
||
Return pobjTable | ||
|
||
End Get | ||
|
||
Set(ByVal Value As SQLSelectTable) | ||
|
||
pobjTable = Value | ||
|
||
End Set | ||
End Property | ||
|
||
Friend Overrides Function SQL(ByVal eConnectionType As Database.ConnectionType) As String | ||
|
||
Dim strSQL As String = String.Empty | ||
|
||
If pobjTable IsNot Nothing Then | ||
strSQL = SQLConvertIdentifierName(pobjTable.GetPrefix, eConnectionType) & "." | ||
End If | ||
|
||
Return strSQL & "*" | ||
|
||
End Function | ||
|
||
End Class | ||
|
||
End Namespace |