SqlMacroProcessor Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for Data Abstract for .NET
This page is generated from external data, please do not update

NamespacesInterfacesClassesEnumsImplements

Contents

Overview

The SqlMacroProcessor provides the base for classes that can process macros in SQL queries for different databases. It is part of the Macro Processor conception.

This class allows to use the following macros in SQL queries:

  • Date
  • DateTime
  • AddTime
  • FormatDateTime
  • FormatDate
  • Length
  • LowerCase
  • UpperCase
  • TrimLeft
  • TrimRight
  • Copy
  • NoLock


Location


Properties

DateFormat

Gets the date format for the current database.



Prism:   property DateFormat: String read
C#:   String DateFormat { get; }
VB:   Property ReadOnly DateFormat As String


DateTimeFormat

Gets the datetime format for the current database.



Prism:   property DateTimeFormat: String read
C#:   String DateTimeFormat { get; }
VB:   Property ReadOnly DateTimeFormat As String


DoubleQuoteStrings

Gets the quote string for the date and datetime formats for the current database. If this property is true, the datetime format is represented as "datetime", otherwise as 'datetime'.



Prism:   property DoubleQuoteStrings: Boolean read
C#:   Boolean DoubleQuoteStrings { get; }
VB:   Property ReadOnly DoubleQuoteStrings As Boolean


StoredProcedurePrefix

Gets the prefix for stored procedures for the current database.



Prism:   property StoredProcedurePrefix: String read
C#:   String StoredProcedurePrefix { get; }
VB:   Property ReadOnly StoredProcedurePrefix As String


StoredProcParamPrefix

Gets the prefix for stored procedure params for the current database.



Prism:   property StoredProcParamPrefix: String read
C#:   String StoredProcParamPrefix { get; }
VB:   Property ReadOnly StoredProcParamPrefix As String


UnknownIdentifier     (declared in MacroParser)

Points to the method that should be called when an unknown macro function or variable is encountered during expression parsing.

The called method is able to set the value of the otherwise undefined macro variable. For example, this approach is used to provide access to Session values in the {WHERE} of SchemaDataTable statements.



Prism:   property UnknownIdentifier: UnknownIdentifierEventHandler read write
C#:   UnknownIdentifierEventHandler UnknownIdentifier { get; set; }
VB:   Property UnknownIdentifier As UnknownIdentifierEventHandler


Variable     (declared in MacroParser)

Gets the macro variable at the specified index.



Prism:   property Variable[aIndex: Int32]: MacroVar read
C#:   MacroVar Variable[Int32 aIndex] { get; }
VB:   Property ReadOnly Variable[aIndex As Int32] As MacroVar


VariableCount     (declared in MacroParser)

Gets the number of macro variables registered in the current MacroParser instance.



Prism:   property VariableCount: Int32 read
C#:   Int32 VariableCount { get; }
VB:   Property ReadOnly VariableCount As Int32


Instance Methods

constructor ()     (declared in MacroParser)

Creates a new instance of the MacroParser class.


Oxygene:   constructor
C#:   constructor()
VB:   Sub New


constructor (String, String, Boolean, String)



Oxygene:   constructor(dateFormat: String; datetimeFormat: String; doubleQuoteStrings: Boolean; parameterPrefix: String)
C#:   constructor(String dateFormat, String datetimeFormat, Boolean doubleQuoteStrings, String parameterPrefix)
VB:   Sub New (dateFormat As String, datetimeFormat As String, doubleQuoteStrings As Boolean, parameterPrefix As String)


Parameters:

  • dateFormat:
  • datetimeFormat:
  • doubleQuoteStrings:
  • parameterPrefix:


AddTime   protected

In the descendant, this method should process the AddTime macro.


Oxygene:   method AddTime(sender: Object; parameters: array of String): String
C#:   String AddTime(Object sender, array of String parameters)
VB:   Function AddTime(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


AddVariable     (declared in MacroParser)

Creates a new macro variable and adds it to the internal macro variables list.


Oxygene:   method AddVariable(aName: String): MacroVar
C#:   MacroVar AddVariable(String aName)
VB:   Function AddVariable(aName As String) As MacroVar


Parameters:

  • aName:


ClearProcs     (declared in MacroParser)

Clears the internal list of registered macro procedures.


Oxygene:   method ClearProcs
C#:   void ClearProcs()
VB:   Sub ClearProcs


ClearVariables     (declared in MacroParser)

Clears the internal list of registered macro variables.


Oxygene:   method ClearVariables
C#:   void ClearVariables()
VB:   Sub ClearVariables


ComposeLengthCall



Oxygene:   method ComposeLengthCall(argument: String): String
C#:   String ComposeLengthCall(String argument)
VB:   Function ComposeLengthCall(argument As String) As String


Parameters:

  • argument:


ComposeToLowerCall



Oxygene:   method ComposeToLowerCall(argument: String): String
C#:   String ComposeToLowerCall(String argument)
VB:   Function ComposeToLowerCall(argument As String) As String


Parameters:

  • argument:


ComposeToUpperCall



Oxygene:   method ComposeToUpperCall(argument: String): String
C#:   String ComposeToUpperCall(String argument)
VB:   Function ComposeToUpperCall(argument As String) As String


Parameters:

  • argument:


Copy   protected

In the descendant, this method should process the Copy macro.


Oxygene:   method Copy(sender: Object; parameters: array of String): String
C#:   String Copy(Object sender, array of String parameters)
VB:   Function Copy(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


Date   protected

In the descendant, this method should process the Date macro.


Oxygene:   method Date(sender: Object; parameters: array of String): String
C#:   String Date(Object sender, array of String parameters)
VB:   Function Date(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


DateTime   protected

In the descendant, this method should process the DateTime macro.


Oxygene:   method DateTime(sender: Object; parameters: array of String): String
C#:   String DateTime(Object sender, array of String parameters)
VB:   Function DateTime(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


DeleteVariable     (declared in MacroParser)

Removes the macro variable with the specified name from the internal list of registered variables.


Oxygene:   method DeleteVariable(aIndex: Int32)
C#:   void DeleteVariable(Int32 aIndex)
VB:   Sub DeleteVariable(aIndex As Int32)


Parameters:

  • aIndex:


Eval     (declared in MacroParser)

Evaluates the given expression, substituting macro tags with specific variable values or macro function results.

String constants within provided expressions can be delimited using the TextDelimiter char.


Oxygene:   method Eval(Text: String; TextDelimiter: Char): String
C#:   String Eval(String Text, Char TextDelimiter)
VB:   Function Eval(Text As String, TextDelimiter As Char) As String


Parameters:

  • Text: Expression to process
  • TextDelimiter: String constants delimiter


EvalToken     (declared in MacroParser)

Evaluates the provided macro token. This method calls the macro function or replaces the macro variable placeholder with its value.


Oxygene:   method EvalToken(Text: String): String
C#:   String EvalToken(String Text)
VB:   Function EvalToken(Text As String) As String


Parameters:

  • Text: Macro expression token


FindVariable     (declared in MacroParser)

Gets the macro variable with the specified name from the registered variables. Search is not case-sensitive.

If there is no variable with the provided name, null is returned.


Oxygene:   method FindVariable(aName: String): MacroVar
C#:   MacroVar FindVariable(String aName)
VB:   Function FindVariable(aName As String) As MacroVar


Parameters:

  • aName: Variable name


FormatDate   protected

Returns the formatted date according to the DoubleQuoteStrings and DateFormat properties.


Oxygene:   method FormatDate(sender: Object; parameters: array of String): String
C#:   String FormatDate(Object sender, array of String parameters)
VB:   Function FormatDate(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


FormatDateTime   protected

Returns the formatted date and time according to the DoubleQuoteStrings and DateFormat properties.


Oxygene:   method FormatDateTime(sender: Object; parameters: array of String): String
C#:   String FormatDateTime(Object sender, array of String parameters)
VB:   Function FormatDateTime(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


GetNewInstance



Oxygene:   method GetNewInstance: SqlMacroProcessor
C#:   SqlMacroProcessor GetNewInstance()
VB:   Function GetNewInstance As SqlMacroProcessor


Length   protected

In the descendant, this method should process the Length macro.


Oxygene:   method Length(sender: Object; parameters: array of String): String
C#:   String Length(Object sender, array of String parameters)
VB:   Function Length(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


LowerCase   protected

In the descendant, this method should process the LowerCase macro.


Oxygene:   method LowerCase(sender: Object; parameters: array of String): String
C#:   String LowerCase(Object sender, array of String parameters)
VB:   Function LowerCase(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


NoLock   protected



Oxygene:   method NoLock(sender: Object; parameters: array of String): String
C#:   String NoLock(Object sender, array of String parameters)
VB:   Function NoLock(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


RegisterMacros   protected

Registers the existing standard macros:

  • Date
  • DateTime
  • AddTime
  • FormatDateTime
  • FormatDate
  • Length
  • LowerCase
  • UpperCase
  • TrimLeft
  • TrimRight
  • Copy
  • NoLock


Oxygene:   method RegisterMacros
C#:   void RegisterMacros()
VB:   Sub RegisterMacros


RegisterProc     (declared in MacroParser)

Creates a new macro procedure and adds it to the internal macro procedures list.


Oxygene:   method RegisterProc(aName: String; aExProc: ExternalProcEventHandler; aParamCount: Int32)
C#:   void RegisterProc(String aName, ExternalProcEventHandler aExProc, Int32 aParamCount)
VB:   Sub RegisterProc(aName As String, aExProc As ExternalProcEventHandler, aParamCount As Int32)


Parameters:

  • aName:
  • aExProc:
  • aParamCount: Number of procedure parameters


Session   protected



Oxygene:   method Session(sender: Object; parameters: array of String): String
C#:   String Session(Object sender, array of String parameters)
VB:   Function Session(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


Time   protected

In the descendant, this method should process the Time macro.


Oxygene:   method Time(sender: Object; parameters: array of String): String
C#:   String Time(Object sender, array of String parameters)
VB:   Function Time(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


TrimLeft   protected

In the descendant, this method should process the TrimLeft macro.


Oxygene:   method TrimLeft(sender: Object; parameters: array of String): String
C#:   String TrimLeft(Object sender, array of String parameters)
VB:   Function TrimLeft(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


TrimRight   protected

In the descendant, this method should process the TrimRight macro.


Oxygene:   method TrimRight(sender: Object; parameters: array of String): String
C#:   String TrimRight(Object sender, array of String parameters)
VB:   Function TrimRight(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


UpperCase   protected

In the descendant, this method should process the UpperCase macro.


Oxygene:   method UpperCase(sender: Object; parameters: array of String): String
C#:   String UpperCase(Object sender, array of String parameters)
VB:   Function UpperCase(sender As Object, parameters As array of String) As String


Parameters:

  • sender:
  • parameters:


Descendants


See Also


Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Delphi and Xcode

GlossaryArticlesFeaturesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox