IDASQLMacroProcessor
Overview
The IDASQLMacroProcessor interface provides access to TDASQLMacroProcessor descendants that can process macros in SQL queries for different databases.
Location
- Unit: uDASQLMacroProcessor.pas
- Ancestry: IDASQLMacroProcessor
Required Methods
AddTime
Returns a new datetime value based on adding an interval to the specified date.
function AddTime(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (date) - Specified input valid datetime value
[1] (interval) - number of years, weeks, days, hours, minutes, seconds
[2] (interval_type) - The part of date or time that has to be added: "year", "week", "day", "hour", "min", "sec"
Copy
Returns <count> characters starting from <index> from <value>
function Copy(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name
[1] (index) - position from where to start copying
[2] (count) - number of characters to copy
Date
Returns the current date from the server.
function Date(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters: none
DatePart
Returns an integer representing the specified datepart of the provided date.
function DatePart(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (date) - a valid date
[1] (interval_type) - sec, min, hour, day, week, month, year
DateTime
Returns the current datetime from the server.
function DateTime(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters: none
FormatDate
Formats the specified date to the date format used by the database.
function FormatDate(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string representation of a date
FormatDateTime
Formats the specified datetime to the datetime format used by the database.
function FormatDateTime(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string representation of a date
Length
Returns the length of the given string.
function Length(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name
LowerCase
Converts the given string to lower case.
function LowerCase(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name
Modulo
Generates modulo statement.
function Modulo(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (dividend)
[1] (divisor)
NoLock
Returns (NOLOCK)
for Microsoft SQL Server and empty string for other databases.
function NoLock(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters: none
Time
Returns the current time from the server.
function Time(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters: none
Trim
Removes both leading and trailing spaces from a string
function Trim(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name
[1] (char) - (optional) character to trim. The default value isspace
character (char(32))
TrimLeft
Removes the leading spaces from a string
function TrimLeft(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name
[1] (char) - (optional) character to trim. The default value isspace
character (char(32))
TrimRight
Removes the trailing spaces from a string.
function TrimRight(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name
[1] (char) - (optional) character to trim. The default value isspace
character (char(32))
UpperCase
Converts the given string to upper case.
function UpperCase(Sender: TObject; const Parameters: array of string): string
Parameters:
- Sender: Sender
- Parameters:
[0] (value) - string value or field name