public interface SqlExpr
Builds expressions to call functions in the sql server library for a row pipeline.
| Modifier and Type | Method and Description |
|---|---|
XsIntegerExpr |
bitLength(XsStringExpr str)
Returns the length of the string “str” in bits.
|
XsStringExpr |
collatedString(XsStringExpr string,
String collationURI)
Returns an
rdf:collatedString value with the given value and collation tag. |
XsStringExpr |
collatedString(XsStringExpr string,
XsStringExpr collationURI)
Returns an
rdf:collatedString value with the given value and collation tag. |
ItemExpr |
dateadd(XsStringExpr datepart,
int number,
ItemExpr date)
Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date
|
ItemExpr |
dateadd(XsStringExpr datepart,
XsIntExpr number,
ItemExpr date)
Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date
|
XsIntegerExpr |
datediff(XsStringExpr datepart,
ItemExpr startdate,
ItemExpr enddate)
Returns the count (signed integer) of the specified datepart boundaries crossed between the specified startdate and enddate.
|
XsIntegerExpr |
datepart(XsStringExpr datepart,
ItemExpr date)
Returns an integer that represents the specified
datepart of the specified date. |
XsIntegerExpr |
day(ItemExpr arg)
Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of arg.
|
XsStringExpr |
dayname(ItemExpr arg)
Returns an xs:string representing the dayname value in the localized value of arg.
|
XsIntegerExpr |
hours(ItemExpr arg)
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of arg.
|
XsStringExpr |
insert(XsStringExpr str,
double start,
double length,
String str2)
Returns a string that that is the first argument with length characters removed starting at start and the second string has been inserted beginning at start.
|
XsStringExpr |
insert(XsStringExpr str,
XsNumericExpr start,
XsNumericExpr length,
XsStringExpr str2)
Returns a string that that is the first argument with length characters removed starting at start and the second string has been inserted beginning at start.
|
XsUnsignedIntExpr |
instr(XsStringExpr str,
String n)
Find the starting location of a pattern in a string.
|
XsUnsignedIntExpr |
instr(XsStringExpr str,
XsStringExpr n)
Find the starting location of a pattern in a string.
|
XsStringExpr |
left(ItemSeqExpr str,
double n)
Returns a string that is the leftmost characters of the target string.
|
XsStringExpr |
left(ItemSeqExpr str,
XsNumericExpr n)
Returns a string that is the leftmost characters of the target string.
|
XsStringExpr |
ltrim(XsStringExpr str)
Return a string that removes leading empty spaces in the input string.
|
XsIntegerExpr |
minutes(ItemExpr arg)
Returns an xs:integer value between 0 to 59, both inclusive, representing the value of the minutes component in the localized value of arg.
|
XsIntegerExpr |
month(ItemExpr arg)
Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of arg.
|
XsStringExpr |
monthname(ItemExpr arg)
Returns month name, calculated from the localized value of arg.
|
XsIntegerExpr |
octetLength(XsStringExpr x)
Returns the length of the string “str” in bits.
|
XsIntegerExpr |
quarter(ItemExpr arg)
Returns an xs:integer between 1 and 4, both inclusive, calculating the quarter component in the localized value of arg.
|
XsUnsignedLongExpr |
rand(XsUnsignedLongExpr n)
Return a random number.
|
XsStringExpr |
repeat(ItemSeqExpr str,
double n)
Returns a string that concatenates the first argument as many times as specified by the second argument.
|
XsStringExpr |
repeat(ItemSeqExpr str,
XsNumericExpr n)
Returns a string that concatenates the first argument as many times as specified by the second argument.
|
XsStringExpr |
right(ItemSeqExpr str,
double n)
Returns a string that is the rightmost characters of the target string.
|
XsStringExpr |
right(ItemSeqExpr str,
XsNumericExpr n)
Returns a string that is the rightmost characters of the target string.
|
XsStringExpr |
rtrim(XsStringExpr str)
Return a string that removes trailing empty spaces in the input string.
|
XsDecimalExpr |
seconds(ItemExpr arg)
Returns an xs:decimal value between 0 and 60.999…, both inclusive, representing the seconds and fractional seconds in the localized value of arg.
|
ItemSeqExpr |
sign(XsNumericExpr x)
Returns the sign of number x.
|
XsStringExpr |
space(XsNumericExpr n)
Returns a string that is the given number of spaces.
|
ItemExpr |
timestampadd(XsStringExpr dateTimeType,
int value,
ItemExpr timestamp)
Returns a xs:string? timestamp created by adding a number to the given dateTimeType field of a given timestamp.
|
ItemExpr |
timestampadd(XsStringExpr dateTimeType,
XsIntExpr value,
ItemExpr timestamp)
Returns a xs:string? timestamp created by adding a number to the given dateTimeType field of a given timestamp.
|
XsIntegerExpr |
timestampdiff(XsStringExpr dateTimeType,
ItemExpr timestamp1,
ItemExpr timestamp2)
Returns the difference in dateTimeType field of two given timestamps.
|
XsStringExpr |
trim(XsStringExpr str)
Return a string that removes leading empty spaces in the input string.
|
XsIntegerExpr |
week(ItemExpr arg)
Returns an xs:integer between 1 and 53, both inclusive, representing the week value in the localized value of arg.
|
XsIntegerExpr |
weekday(ItemExpr arg1) |
XsIntegerExpr |
year(ItemExpr arg)
Returns an xs:integer representing the year component in the localized value of arg.
|
XsIntegerExpr |
yearday(ItemExpr arg)
Returns an xs:integer between 1 and 366, both inclusive, representing the yearday value in the localized value of arg.
|
XsIntegerExpr bitLength(XsStringExpr str)
Returns the length of the string “str” in bits.
Provides a client interface to a server function. See sql:bit-length
str - The string to be evaluated.XsStringExpr collatedString(XsStringExpr string, String collationURI)
Returns an rdf:collatedString value with the given value and collation tag. The rdf:collatedString type extends xs:string , and represents a collation tagged string in RDF.
This function is a built-in.
Provides a client interface to a server function. See sql:collated-string
string - The lexical value.collationURI - The collation URI.XsStringExpr collatedString(XsStringExpr string, XsStringExpr collationURI)
Returns an rdf:collatedString value with the given value and collation tag. The rdf:collatedString type extends xs:string , and represents a collation tagged string in RDF.
This function is a built-in.
Provides a client interface to a server function. See sql:collated-string
string - The lexical value.collationURI - The collation URI.ItemExpr dateadd(XsStringExpr datepart, int number, ItemExpr date)
Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date
Provides a client interface to a server function. See sql:dateadd
datepart - Is the part of date where the number will be added. The following table lists all valid datepart arguments. User-defined variable equivalents are not valid. The return data type is the data type of the date argument. Options:
datepart parameter abbreviation includes:
- “year”,“yyyy”,“yy”
- The year part of the
date- “quarter”,“qq”,“q”
- The quarter part of the
date- “month”,“mm”,“m”
- The month part of the
date- “dayofyear”,“dy”,“y”
- The day of the year from the
date- “day”,“dd”,“d”
- The day of the month from the
date- “week”,“wk”,“ww”
- The week of the year from the
date- “weekday”,“dw”
- The day of the week from the
date- “hour”,“hh”
- The hour of the day from the
date- “minute”,“mi”,“n”
- The minute of the hour from the
date- “second”,“ss”,“s”
- The second of the minute from the
date- “millisecond”,“ms”
- The millisecond of the minute from the
date- “microsecond”,“msc”
- The microsecond of the minute from the
date- “nanosecond”,“ns”
- The nanosecond of the minute from the
date
number - This number will be added to the datepart of the given date.date - Is an expression that can be resolved to a time, date or datetime, value. date can be an expression, column expression, user-defined variable or string literal. startdate is subtracted from enddate.ItemExpr dateadd(XsStringExpr datepart, XsIntExpr number, ItemExpr date)
Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date
Provides a client interface to a server function. See sql:dateadd
datepart - Is the part of date where the number will be added. The following table lists all valid datepart arguments. User-defined variable equivalents are not valid. The return data type is the data type of the date argument. Options:
datepart parameter abbreviation includes:
- “year”,“yyyy”,“yy”
- The year part of the
date- “quarter”,“qq”,“q”
- The quarter part of the
date- “month”,“mm”,“m”
- The month part of the
date- “dayofyear”,“dy”,“y”
- The day of the year from the
date- “day”,“dd”,“d”
- The day of the month from the
date- “week”,“wk”,“ww”
- The week of the year from the
date- “weekday”,“dw”
- The day of the week from the
date- “hour”,“hh”
- The hour of the day from the
date- “minute”,“mi”,“n”
- The minute of the hour from the
date- “second”,“ss”,“s”
- The second of the minute from the
date- “millisecond”,“ms”
- The millisecond of the minute from the
date- “microsecond”,“msc”
- The microsecond of the minute from the
date- “nanosecond”,“ns”
- The nanosecond of the minute from the
date
number - This number will be added to the datepart of the given date.date - Is an expression that can be resolved to a time, date or datetime, value. date can be an expression, column expression, user-defined variable or string literal. startdate is subtracted from enddate.XsIntegerExpr datediff(XsStringExpr datepart, ItemExpr startdate, ItemExpr enddate)
Returns the count (signed integer) of the specified datepart boundaries crossed between the specified startdate and enddate.
Provides a client interface to a server function. See sql:datediff
datepart - Is the part of startdate and enddate that specifies the type of boundary crossed. The following table lists all valid datepart arguments. User-defined variable equivalents are not valid. Options:
datepart parameter abbreviation includes:
- “year”,“yyyy”,“yy”
- The year part of the
date- “quarter”,“qq”,“q”
- The quarter part of the
date- “month”,“mm”,“m”
- The month part of the
date- “dayofyear”,“dy”,“y”
- The day of the year from the
date- “day”,“dd”,“d”
- The day of the month from the
date- “week”,“wk”,“ww”
- The week of the year from the
date- “weekday”,“dw”
- The day of the week from the
date- “hour”,“hh”
- The hour of the day from the
date- “minute”,“mi”,“n”
- The minute of the hour from the
date- “second”,“ss”,“s”
- The second of the minute from the
date- “millisecond”,“ms”
- The millisecond of the minute from the
date- “microsecond”,“msc”
- The microsecond of the minute from the
date- “nanosecond”,“ns”
- The nanosecond of the minute from the
date
startdate - Is an expression that can be resolved to a time, date, datetime or value. date can be an expression, column expression, user-defined variable or string literal. startdate is subtracted from enddate.enddate - Same as startdate.XsIntegerExpr datepart(XsStringExpr datepart, ItemExpr date)
Returns an integer that represents the specified datepart of the specified date.
If datepart or date is the empty sequence, the function returns the empty sequence.
Provides a client interface to a server function. See sql:datepart
datepart - The part of date that to be returned. Options:
datepart parameter abbreviation includes:
- “year”,“yyyy”,“yy”
- The year part of the
date- “quarter”,“qq”,“q”
- The quarter part of the
date- “month”,“mm”,“m”
- The month part of the
date- “dayofyear”,“dy”,“y”
- The day of the year from the
date- “day”,“dd”,“d”
- The day of the month from the
date- “week”,“wk”,“ww”
- The week of the year from the
date- “weekday”,“dw”
- The day of the week from the
date- “hour”,“hh”
- The hour of the day from the
date- “minute”,“mi”,“n”
- The minute of the hour from the
date- “second”,“ss”,“s”
- The second of the minute from the
date- “millisecond”,“ms”
- The millisecond of the minute from the
date- “microsecond”,“msc”
- The microsecond of the minute from the
date- “nanosecond”,“ns”
- The nanosecond of the minute from the
date- “TZoffset”,“tz”
- The timezone offset from the
date
date - Is an expression that can be resolved to a xs:date, xs:time, xs:dateTime. date can be an expression, column expression,user-defined variable, or string literal.XsIntegerExpr day(ItemExpr arg)
Returns an xs:integer between 1 and 31, both inclusive, representing the day component in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:day
arg - The xs:genericDateTimeArg whose day component will be returned.XsStringExpr dayname(ItemExpr arg)
Returns an xs:string representing the dayname value in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:dayname
arg - The date whose dayname value will be returned.XsIntegerExpr hours(ItemExpr arg)
Returns an xs:integer between 0 and 23, both inclusive, representing the value of the hours component in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:hours
arg - The genericDateTime whose hours component will be returned.XsStringExpr insert(XsStringExpr str, double start, double length, String str2)
Returns a string that that is the first argument with length characters removed starting at start and the second string has been inserted beginning at start.
Provides a client interface to a server function. See sql:insert
str - The string to manipulate.start - The starting position where characters will be inserted.length - The number of characters to be removed.str2 - The string to insert.XsStringExpr insert(XsStringExpr str, XsNumericExpr start, XsNumericExpr length, XsStringExpr str2)
Returns a string that that is the first argument with length characters removed starting at start and the second string has been inserted beginning at start.
Provides a client interface to a server function. See sql:insert
str - The string to manipulate.start - The starting position where characters will be inserted.length - The number of characters to be removed.str2 - The string to insert.XsUnsignedIntExpr instr(XsStringExpr str, String n)
Find the starting location of a pattern in a string.
Provides a client interface to a server function. See sql:instr
str - The string to be evaluated.n - The pattern to be evaluated.XsUnsignedIntExpr instr(XsStringExpr str, XsStringExpr n)
Find the starting location of a pattern in a string.
Provides a client interface to a server function. See sql:instr
str - The string to be evaluated.n - The pattern to be evaluated.XsStringExpr left(ItemSeqExpr str, double n)
Returns a string that is the leftmost characters of the target string. The number of characters to return is specified by the second argument.
Provides a client interface to a server function. See sql:left
str - The base string. If the value is not a string, its string value will be used.n - The number of leftmost characters of the string to return.XsStringExpr left(ItemSeqExpr str, XsNumericExpr n)
Returns a string that is the leftmost characters of the target string. The number of characters to return is specified by the second argument.
Provides a client interface to a server function. See sql:left
str - The base string. If the value is not a string, its string value will be used.n - The number of leftmost characters of the string to return.XsStringExpr ltrim(XsStringExpr str)
Return a string that removes leading empty spaces in the input string.
Provides a client interface to a server function. See sql:ltrim
str - The string to be evaluated.XsIntegerExpr minutes(ItemExpr arg)
Returns an xs:integer value between 0 to 59, both inclusive, representing the value of the minutes component in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:minutes
arg - The genericDateTime whose minutes component will be returned.XsIntegerExpr month(ItemExpr arg)
Returns an xs:integer between 1 and 12, both inclusive, representing the month component in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:month
arg - The genericDateTime whose month component will be returned.XsStringExpr monthname(ItemExpr arg)
Returns month name, calculated from the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:monthname
arg - The date whose month-name will be returned.XsIntegerExpr octetLength(XsStringExpr x)
Returns the length of the string “str” in bits.
Provides a client interface to a server function. See sql:octet-length
x - The string to be evaluated.XsIntegerExpr quarter(ItemExpr arg)
Returns an xs:integer between 1 and 4, both inclusive, calculating the quarter component in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:quarter
arg - The genericDateTime whose quarter component will be returned.XsUnsignedLongExpr rand(XsUnsignedLongExpr n)
Return a random number. This differs from xdmp:random in that the argument is a seed.
Provides a client interface to a server function. See sql:rand
n - The random seed. Currently this parameter is ignored.XsStringExpr repeat(ItemSeqExpr str, double n)
Returns a string that concatenates the first argument as many times as specified by the second argument.
Provides a client interface to a server function. See sql:repeat
str - The string to duplicate. If the value is not a string, its string value will be used.n - The number of times to repeat the string.XsStringExpr repeat(ItemSeqExpr str, XsNumericExpr n)
Returns a string that concatenates the first argument as many times as specified by the second argument.
Provides a client interface to a server function. See sql:repeat
str - The string to duplicate. If the value is not a string, its string value will be used.n - The number of times to repeat the string.XsStringExpr right(ItemSeqExpr str, double n)
Returns a string that is the rightmost characters of the target string. The number of characters to return is specified by the second argument.
Provides a client interface to a server function. See sql:right
str - The base string. If the value is not a string, its string value will be used.n - The number of rightmost characters of the string to return.XsStringExpr right(ItemSeqExpr str, XsNumericExpr n)
Returns a string that is the rightmost characters of the target string. The number of characters to return is specified by the second argument.
Provides a client interface to a server function. See sql:right
str - The base string. If the value is not a string, its string value will be used.n - The number of rightmost characters of the string to return.XsStringExpr rtrim(XsStringExpr str)
Return a string that removes trailing empty spaces in the input string.
Provides a client interface to a server function. See sql:rtrim
str - The string to be evaluated.XsDecimalExpr seconds(ItemExpr arg)
Returns an xs:decimal value between 0 and 60.999…, both inclusive, representing the seconds and fractional seconds in the localized value of arg. Note that the value can be greater than 60 seconds to accommodate occasional leap seconds used to keep human time synchronized with the rotation of the planet.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:seconds
arg - The time whose seconds component will be returned.ItemSeqExpr sign(XsNumericExpr x)
Returns the sign of number x.
Provides a client interface to a server function. See sql:sign
x - The number to be evaluated.XsStringExpr space(XsNumericExpr n)
Returns a string that is the given number of spaces.
Provides a client interface to a server function. See sql:space
n - The number of spaces to return as a string.ItemExpr timestampadd(XsStringExpr dateTimeType, int value, ItemExpr timestamp)
Returns a xs:string? timestamp created by adding a number to the given dateTimeType field of a given timestamp.
Provides a client interface to a server function. See sql:timestampadd
dateTimeType - The dateTimeType of the timestamp where addition should take place. Available types are: SQL_TSI_FRAC_SECOND
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR
value - The integer to add to the given dateTimeType field of the third parameter.timestamp - The xs:dateTime timestamp to which addition has to take place.ItemExpr timestampadd(XsStringExpr dateTimeType, XsIntExpr value, ItemExpr timestamp)
Returns a xs:string? timestamp created by adding a number to the given dateTimeType field of a given timestamp.
Provides a client interface to a server function. See sql:timestampadd
dateTimeType - The dateTimeType of the timestamp where addition should take place. Available types are: SQL_TSI_FRAC_SECOND
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR
value - The integer to add to the given dateTimeType field of the third parameter.timestamp - The xs:dateTime timestamp to which addition has to take place.XsIntegerExpr timestampdiff(XsStringExpr dateTimeType, ItemExpr timestamp1, ItemExpr timestamp2)
Returns the difference in dateTimeType field of two given timestamps.
Provides a client interface to a server function. See sql:timestampdiff
dateTimeType - The dateTimeType of the timestamp where addition should take place. Available types are: SQL_TSI_FRAC_SECOND
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR
timestamp1 - The integer to add to the given dateTimeType field of the third parameter.timestamp2 - The xs:dateTime timestamp to which addition has to take place.XsStringExpr trim(XsStringExpr str)
Return a string that removes leading empty spaces in the input string.
Provides a client interface to a server function. See sql:trim
str - The string to be evaluated.XsIntegerExpr week(ItemExpr arg)
Returns an xs:integer between 1 and 53, both inclusive, representing the week value in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:week
arg - The dateTime/date/string whose day component will be returned.XsIntegerExpr weekday(ItemExpr arg1)
XsIntegerExpr year(ItemExpr arg)
Returns an xs:integer representing the year component in the localized value of arg. The result may be negative.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:year
arg - The dateTime/date/string whose day component will be returned.XsIntegerExpr yearday(ItemExpr arg)
Returns an xs:integer between 1 and 366, both inclusive, representing the yearday value in the localized value of arg.
If arg is the empty sequence, returns the empty sequence.
Provides a client interface to a server function. See sql:yearday
arg - The xs:genericDateTimeArg whose days of the year will be returned.Copyright © 2013-2017 MarkLogic Corporation.