SqlParametersParser

Overview

Location

 

constructor

 

constructor

 

SqlParametersParser()

 

Sub New()

AddPrefix

 

class method AddPrefix(name: String; prefix: String): String

 

static String AddPrefix(String name, String prefix)

 

Shared Function AddPrefix(name As String, prefix As String) As String

Parameters:

  • name:
  • prefix:

GetParameterNames

 

method GetParameterNames(sql: String; parameterSymbol: Char; quoteSymbols: array of Char; textDelimiter: Char; caseInsensitive: Boolean; extractUniqueNamesOnly: Boolean): IList<String>

 

IList<String> GetParameterNames(String sql, Char parameterSymbol, Char[] quoteSymbols, Char textDelimiter, Boolean caseInsensitive, Boolean extractUniqueNamesOnly)

 

Function GetParameterNames(sql As String, parameterSymbol As Char, quoteSymbols As Char(), textDelimiter As Char, caseInsensitive As Boolean, extractUniqueNamesOnly As Boolean) As IList<String>

Parameters:

  • sql:
  • parameterSymbol:
  • quoteSymbols:
  • textDelimiter:
  • caseInsensitive:
  • extractUniqueNamesOnly:

RemovePrefix

 

class method RemovePrefix(name: String; prefix: String): String

 

static String RemovePrefix(String name, String prefix)

 

Shared Function RemovePrefix(name As String, prefix As String) As String

Parameters:

  • name:
  • prefix:

ReplaceParameterSymbol

Replaces each : character in the provided SQL statement with the database-specific parameter character.

Note that : characters contained in the string constants (denoted by the textDelimiter character) won't be affected by this method.

 

method ReplaceParameterSymbol(sql: String; parameterSymbol: Char; textDelimiter: Char): String

 

String ReplaceParameterSymbol(String sql, Char parameterSymbol, Char textDelimiter)

 

Function ReplaceParameterSymbol(sql As String, parameterSymbol As Char, textDelimiter As Char) As String

Parameters:

  • sql: SQL statement to be processed
  • parameterSymbol: Character that identifies the parameter (f.e. @ for T-SQL statements)
  • textDelimiter: Character that denotes the string statements included into the provided sql statement

ReplaceSequentialParameters

Returns list of unique parameter names from the statement provided via sourceString argument and replaces all parameter names in the provided SQL statement with the parameterPlaceholder string.

Parameter name is identified as a sequence of characters that begins with the parameterSymbol character and is continous sequence of A .. Z, a .. z, 0 .. 9, _ characters. Part of the provided sourceString statement that is quoted by textDelimiter characters is ignored during the parameter name extraction.

This method is used to extract parameter names from provided SQL statements for further processing and to adjust the provided SQL statement when sequential data parameters access is used (f.e. for OLEDB-based database drivers).

 

method ReplaceSequentialParameters(sql: String; parameterNames: IList<String>; parameterSymbol: Char; quoteSymbols: array of Char; textDelimiter: Char; parameterPlaceholder: String): String

 

String ReplaceSequentialParameters(String sql, IList<String> parameterNames, Char parameterSymbol, Char[] quoteSymbols, Char textDelimiter, String parameterPlaceholder)

 

Function ReplaceSequentialParameters(sql As String, parameterNames As IList<String>, parameterSymbol As Char, quoteSymbols As Char(), textDelimiter As Char, parameterPlaceholder As String) As String

Parameters:

  • sql: SQL statement to be processed
  • parameterNames:
  • parameterSymbol: Character that identifies the parameter (f.e. @ for T-SQL statements)
  • quoteSymbols: Quote chars
  • textDelimiter: Character that denotes the string statements included into the provided sql statement
  • parameterPlaceholder: Parameter placeholder. All parameter identifiers found in the provided SQL statement will be replaced with the value of this argument. The value used by most database drivers is "?"

SetDefaultParameterValues

 

method SetDefaultParameterValues(sql: String; parameterSymbol: Char; quoteSymbols: array of Char; textDelimiter: Char): String

 

String SetDefaultParameterValues(String sql, Char parameterSymbol, Char[] quoteSymbols, Char textDelimiter)

 

Function SetDefaultParameterValues(sql As String, parameterSymbol As Char, quoteSymbols As Char(), textDelimiter As Char) As String

Parameters:

  • sql:
  • parameterSymbol:
  • quoteSymbols:
  • textDelimiter:

 

AddPrefix

 

class method AddPrefix(name: String; prefix: String): String

 

static String AddPrefix(String name, String prefix)

 

Shared Function AddPrefix(name As String, prefix As String) As String

Parameters:

  • name:
  • prefix:

RemovePrefix

 

class method RemovePrefix(name: String; prefix: String): String

 

static String RemovePrefix(String name, String prefix)

 

Shared Function RemovePrefix(name As String, prefix As String) As String

Parameters:

  • name:
  • prefix:

 

constructor

 

constructor

 

SqlParametersParser()

 

Sub New()

GetParameterNames

 

method GetParameterNames(sql: String; parameterSymbol: Char; quoteSymbols: array of Char; textDelimiter: Char; caseInsensitive: Boolean; extractUniqueNamesOnly: Boolean): IList<String>

 

IList<String> GetParameterNames(String sql, Char parameterSymbol, Char[] quoteSymbols, Char textDelimiter, Boolean caseInsensitive, Boolean extractUniqueNamesOnly)

 

Function GetParameterNames(sql As String, parameterSymbol As Char, quoteSymbols As Char(), textDelimiter As Char, caseInsensitive As Boolean, extractUniqueNamesOnly As Boolean) As IList<String>

Parameters:

  • sql:
  • parameterSymbol:
  • quoteSymbols:
  • textDelimiter:
  • caseInsensitive:
  • extractUniqueNamesOnly:

ReplaceParameterSymbol

Replaces each : character in the provided SQL statement with the database-specific parameter character.

Note that : characters contained in the string constants (denoted by the textDelimiter character) won't be affected by this method.

 

method ReplaceParameterSymbol(sql: String; parameterSymbol: Char; textDelimiter: Char): String

 

String ReplaceParameterSymbol(String sql, Char parameterSymbol, Char textDelimiter)

 

Function ReplaceParameterSymbol(sql As String, parameterSymbol As Char, textDelimiter As Char) As String

Parameters:

  • sql: SQL statement to be processed
  • parameterSymbol: Character that identifies the parameter (f.e. @ for T-SQL statements)
  • textDelimiter: Character that denotes the string statements included into the provided sql statement

ReplaceSequentialParameters

Returns list of unique parameter names from the statement provided via sourceString argument and replaces all parameter names in the provided SQL statement with the parameterPlaceholder string.

Parameter name is identified as a sequence of characters that begins with the parameterSymbol character and is continous sequence of A .. Z, a .. z, 0 .. 9, _ characters. Part of the provided sourceString statement that is quoted by textDelimiter characters is ignored during the parameter name extraction.

This method is used to extract parameter names from provided SQL statements for further processing and to adjust the provided SQL statement when sequential data parameters access is used (f.e. for OLEDB-based database drivers).

 

method ReplaceSequentialParameters(sql: String; parameterNames: IList<String>; parameterSymbol: Char; quoteSymbols: array of Char; textDelimiter: Char; parameterPlaceholder: String): String

 

String ReplaceSequentialParameters(String sql, IList<String> parameterNames, Char parameterSymbol, Char[] quoteSymbols, Char textDelimiter, String parameterPlaceholder)

 

Function ReplaceSequentialParameters(sql As String, parameterNames As IList<String>, parameterSymbol As Char, quoteSymbols As Char(), textDelimiter As Char, parameterPlaceholder As String) As String

Parameters:

  • sql: SQL statement to be processed
  • parameterNames:
  • parameterSymbol: Character that identifies the parameter (f.e. @ for T-SQL statements)
  • quoteSymbols: Quote chars
  • textDelimiter: Character that denotes the string statements included into the provided sql statement
  • parameterPlaceholder: Parameter placeholder. All parameter identifiers found in the provided SQL statement will be replaced with the value of this argument. The value used by most database drivers is "?"

SetDefaultParameterValues

 

method SetDefaultParameterValues(sql: String; parameterSymbol: Char; quoteSymbols: array of Char; textDelimiter: Char): String

 

String SetDefaultParameterValues(String sql, Char parameterSymbol, Char[] quoteSymbols, Char textDelimiter)

 

Function SetDefaultParameterValues(sql As String, parameterSymbol As Char, quoteSymbols As Char(), textDelimiter As Char) As String

Parameters:

  • sql:
  • parameterSymbol:
  • quoteSymbols:
  • textDelimiter: