%TSQL.Impl
class %TSQL.Impl extends %Library.RegisteredObject
Implementation of TSQL scalar and other functions not supported by SQL
Method Inventory (Including Private)
- AnalyseRangePattern()
- CHARINDEX()
- CompareStringPos2()
- CompareStringPos3()
- DATALENGTH()
- ExtractRangeText()
- FLOOR()
- Find()
- IFNULL()
- IsStream()
- LEN()
- REPLACE()
- ROUND()
- RangeToPattern()
- STUFF()
- SUBSTRING()
- ZBITWISEAND()
- ZBITWISEOR()
- ZBITWISEXOR()
- ZCONVERRFROMTSQL()
- ZFORMATMESSAGE()
- ZLIKETOCOSPATTERN()
- ZLIKETOCOSPATTERNLIST()
- ZLIKETOCOSPATTERNS()
- ZPATINDEXFB()
- ZPATINDEXL()
- ZPATINDEXLR()
- ZPATINDEXPL()
- ZPATINDEXPLR()
- ZPATINDEXPN()
- ZPATINDEXU()
- ZPATINDEXUL()
- ZPATINDEXULR()
- ZPATTERNMATCH()
- ZRAND()
- ZREMAMPM()
- ZRPATINDEX()
- ZRPATINDEXPLP()
- ZWITHDATETIME()
Methods (Including Private)
Given RangeText with what appeared between [..] with the escapes for LikeEscape and "-" intact
Return a COS pattern fragment which matches the range
Implement CHARINDEX(tofind,findin[,startat])
N1-N2 are COS string positions, 1-based and 0 means not found
If one of the positions is undisputedly earlier its tag is returned
otherwise return 0
N1-N3 are COS string positions, 1-based and 0 means not found
If one of the positions is undisputedly earliest of the three its tag is returned
otherwise return 0
Implement DATALENGTH(item)
Given the position just after the "["
Return with the position just after the "]" - or after the end of the string if there is no "]"
Return the raw range text (with relevant escapes for "-" and the escape character itself still in place)
Implement FLOOR for COS context
Look for LookIn in LookFor starting at StartLook (defaults to 1)
If the string isn't found then 0 is returned
If the string is found then the 1-based offset to the start of LookFor in LookIn is returned
Implement IFNULL(expr1,expr2[,expr3])
Is the given value a stream id?
- if so: return 1 and set StreamOref
- otherwise: return 0 and set StreamOref to $$$NULLOREF
Implement LEN for COS context
Implement REPLACE(expr,old,new)
Implement ROUND(number,length,function)
Implement STUFF(sourcestring,startpos,replacelength,replacestring)
Implement SUBSTRING(item, start, length)
Implement bitwiseAND
Implement bitwiseOR
Implement bitwiseXOR
Translate a TSQL error code to a SQLCODE
Format a RAISERROR message with the given arguments
Given a LIKE pattern and optional LIKE ESCAPE, return the corresponding COS pattern (non-SQL strings)
Given a LIKE pattern and optional LIKE ESCAPE, return a list of top-level COS pattern elements
Given a LIKE pattern and optional LIKE ESCAPE, return the corresponding COS pattern (SQL strings)
PATINDEX for anything that isn't covered above (FB=fallback) - returns 0/1
- will not give the correct result for a pattern beginning with "%"
PATINDEX for: literal - returns 0/1
PATINDEX for: literal rest - returns 0/1
PATINDEX for: percent literal - returns 0/position of literal
PATINDEX for: percent literal rest - 0/returns position of literal
PATINDEX for: percent non-literal - returns 0/position of non-literal
PATINDEX for: underline(s) - returns 0/1
PATINDEX for: underline(s) literal - returns 0/1
PATINDEX for: underline(s) literal rest - returns 0/1
Implement ZRAND(scalefactor)
Implement ZREMAMPM(item) to remove the "AM" or "PM" if necessary
PATINDEX for non-literal patterns
PATINDEX for "%"+XXX+"%" patterns
Implement ZWITHDATETIME(item) to append a date of 1/1/1900 and/or a time of midnight to the item if necessary
Inherited Members
Inherited Methods (Including Private)
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %ConstructCloneInit()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OnAddToSaveSet()
- %OnClose()
- %OnConstructClone()
- %OnNew()
- %OnValidateObject()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()