Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for SQL length string function. Closes #25.
Added support for SQL Server, MySQL and Access regarding the length string function.
- Loading branch information
Showing
3 changed files
with
72 additions
and
1 deletion.
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
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,43 @@ | ||
|
||
' ___________________________________________________ | ||
' | ||
' © Hi-Integrity Systems 2012. All rights reserved. | ||
' www.hisystems.com.au - Toby Wicks | ||
' ___________________________________________________ | ||
' | ||
|
||
Option Strict On | ||
Option Explicit On | ||
|
||
Namespace SQL | ||
|
||
''' <summary> | ||
''' SQL function that returns the length of a string. | ||
''' </summary> | ||
Public Class SQLLengthFunctionExpression | ||
Inherits SQLFunctionExpression | ||
|
||
Public Sub New(objExpression As SQLExpression) | ||
|
||
MyBase.New(objExpression) | ||
|
||
End Sub | ||
|
||
Protected Overrides Function FunctionName(ByVal eConnectionType As Database.ConnectionType) As String | ||
|
||
Select Case eConnectionType | ||
Case Database.ConnectionType.MySQL | ||
Return "LENGTH" | ||
Case Database.ConnectionType.SQLServer, Database.ConnectionType.MicrosoftAccess | ||
Return "LEN" | ||
Case Else | ||
Throw New NotImplementedException(eConnectionType.ToString) | ||
End Select | ||
|
||
Return MyBase.FunctionName(eConnectionType) | ||
|
||
End Function | ||
|
||
End Class | ||
|
||
End Namespace |