Absolute value, min, max
Trig and Numeric functions
Version functions
Trim and Pad functions
Other string functions
Date functions
function absdbl double
precision returns double precision by value
function absflt float returns float by value
function absint integer returns integer by value
function abssml smallint returns smallint by
value
Returns the absolute value.
function mindbl double
precision, double precision returns double precision by value
function minflt float, float returns float by value
function minint integer, integer returns integer by value
function minsml smallint, smallint returns smallint by value
Description
Returns the minimum value.
function
maxdbl double precision, double precision returns double
precision by value
function maxflt float, float returns float by value
function maxint integer, integer returns integer by value
function maxsml smallint, smallint returns smallint by value
Description
Returns the maximum value.
function fud_cos double precision returns double precision by value
Returns the cosine of a. a is in radians.
This function is the same as the UDFLib cos function.
function fud_acos double precision returns double precision by value
Returns the arccosine of a in radians. a must be in the range -1 <= a <= 1.
If a is not in the correct range then -999999 is returned.
This function is the same as the UDFLib acos function.
function fud_sin double precision returns double precision by value
Returns the sine of a. a is in radians.
This function is the same as the UDFLib sin function.
declare external function fud_asin double precision returns double precision by value
Returns the arcsine of a in radians. a must be in the range -1 <= a <= 1.
If a is not in the correct range then -999999 is returned.
This function is the same as the UDFLib asin function.
function fud_tan double precision returns double precision by value
Returns the tangent of a. a is in radians.
This function is the same as the UDFLib tan function.
function fud_atan double precision returns double precision by value
Returns the arctangent of a in radians.
This function is the same as the UDFLib atan function.
function fud_atan2 double precision, double precision returns double precision by value
Returns the arctangent of a / b in radians. b must satisfy b <> 0.
If b is zero then -999999 is returned.
This function is the same as the UDFLib atan2 function.
function ceiling double precision returns double precision by value
Returns the smallest integer bigger than or equal to a.
This function is the same as the UDFLib ceiling function.
function fud_floor double precision returns double precision by value
Returns the largest integer smaller than or equal to a.
This function is the same as the UDFLib floor function.
function degrees double precision returns double precision by value
Converts a from radians into degrees.
function radians double precision returns double precision by value
Converts a from degrees into radians.
function fud_PI returns double precision by value
Returns PI.
This function is the same as the UDFLib PI function.
function fact double precision returns double precision by value
Converts a to an integer by truncation and then returns the factorial of a. a must be in the range 0<= a < 101.
If a is not in range then -999999 is returned.
function exp double precision returns double precision by value
Returns e to the power of a. a must be in the range -700 <= a < 700.
If a is not in range then -999999 is returned.
function fud_log double precision returns double precision by value
Returns the natural logarithm of a. a must be bigger than or equal to 1.0e-304.
If a is not in range then -999999 is returned.
This function is the same as the UDFLib log function.
function pow10 double precision returns double precision by value
Returns 10 to the power of a. a must be in the range -305 <= a < 305.
If a is not in range then -999999 is returned.
declare external function fud_log10 double precision returns double precision by value
Returns the logarithm to base 10 of a. a must be bigger than or equal to 1.0e-304.
If a is not in range then -999999 is returned.
This function is the same as the UDFLib log10 function.
function pow double precision, double precision returns double precision by value
Returns a to the power of b. a must be greater than or equal to 0.
If a is not in range then -999999 is returned.
function round double precision, integer returns double precision by value
Rounds a to b decimal places. If b is negative then a is rounded to a value of the order 10^-b. For example round(723.123, -2) is 700. b must be in the range -304 < b < 304.
If b is not in range then -999999 is returned.
function truncate double precision, integer returns double precision by value
Truncates a to b decimal places. a is always truncated downwards even if a is negative. If b is negative then a is truncated to a value of the order 10^-b. For example truncate(-723.123, -2) is -800. b must be in the range -304 < b < 304.
If b is not in range then -999999 is returned.
function fud_sqrt double precision returns double precision by value
Returns the square root of a. a must be equal to or greater than zero.
If a is not in range then -999999 is returned.
This function is the same as the UDFLib sqrt function.
declare external function modquot integer, integer returns integer by value
Returns the quotient when a is divided by b. b must not be equal to zero.
If b is not in range then -999999 is returned.
function modrem integer, integer returns integer by value
Returns the remainder when a is divided by b. b must not be equal to zero.
If b is not in range then -999999 is returned.
function ver returns double precision by value
Returns the version number of UDFLib that FUDLibrary emulates. As I have no idea what this number should be the function returns 1.
function fud_ver returns integer by value
Returns the version number FUDLibrary multiplied by 100. For example if you have version 0.5 of FUDLibrary then this function returns 50.
function alltrim cstring(256)
returns cstring(256) free_it
function valltrim cstring(256) returns cstring(256) free_it
Trims any space characters (ascii value 32) from the start and the end of the string. Note other types of white space such as tabs are not stripped.
valltrim is identical to alltrim and is provided for UDFLib compatibility
function alltrimc cstring(256),
char(1) returns cstring(256) free_it
function valltrimc cstring(256), cstring(1) returns cstring(256)
free_it
Trims any character b from the start and the end of the string.
valltrimc is identical to alltrimc and provided for UDFLib compatibility.
function vltrim cstring(256) returns cstring(256) free_it
Trims any space characters (ascii value 32) from the start of the string. Note other types of white space such as tabs are not stripped.
This function is the same as the UDFLib ltrim function.
function ltrimc cstring(256),
char(1) returns cstring(256) free_it
function vltrimc cstring(256), cstring(1) returns cstring(256)
free_it
Trims any character b from the start of the string.
vltrimc is identical to ltrimc and is provided for UDFLib compatibility.
function vrtrim cstring(256) returns cstring(256) free_it
Trims any space characters (ascii value 32) from the end of the string. Note other types of white space such as tabs are not stripped.
This function is the same as the UDFLib rtrim function.
function rtrimc cstring(256),
char(1) returns cstring(256) free_it
function vrtrimc cstring(256), cstring(1) returns cstring(256)
free_it
Trims any character b from the end of the string.
vrtrimc is identical to rtrimc and is provided for UDFLib compatibility
function pad cstring(256),
cstring(1), integer returns cstring(256) free_it
function vpad cstring(256), cstring(1), integer returns cstring(256)
free_it
Pads the end of the str with character c until it is n characters long.
If c is empty, or n is less than the length of the string or n > 255 then the function returns "Bad parameters in rpad".
vpad is identical to pad and is provided for UDFLib compatibility
function lpad cstring(256),
cstring(1), integer returns cstring(256) free_it
function vlpad cstring(256), cstring(1), integer returns cstring(256)
free_it
Pads the start of the str with character c until it is n characters long.
If c is empty, or n is less than the length of the string or n > 255 then the function returns "Bad parameters in lpad".
vlpad is identical to lpad and is provided for UDFLib compatibility.
function centre cstring(256),
cstring(1), integer returns cstring(256) free_it
function vcentre cstring(256), cstring(1), integer returns
cstring(256) free_it
function center cstring(256), cstring(1), integer returns cstring(256)
free_it
function vcenter cstring(256), cstring(1), integer returns
cstring(256) free_it
Pads the start and end of the str with character c until it is n characters long.
If c is empty, or n is less than the length of the string or n > 255 then the function returns "Bad parameters in center".
vcentre, center, vcenter are identical to center and are provided for UDFLib compatibility.
function fud_soundex cstring(256) returns cstring(256) free_it
Converts a string into its Soundex Code. This function uses the Soundex Algorothm described by Donald Knuth in The Art of Computer Programming Volume 3. The file examples/soundex.sql gives an example of how to use the fud_soundex function to do 'sounds like' searching.
function len cstring(256) returns integer by value
Returns the length of str.
vlen is identical to len and is provided for UDFLib compatibility.
function fud_lower cstring(256)
returns cstring(256)
function vlower cstring(256) returns cstring(256)
Converts the string to lower case.
vlower is identical to fud_lower and is provided for UDFLib compatibility
function cstradd cstring(256),cstring(256)
returns cstring(512) free_it
function vcharadd cstring(256),cstring(256) returns cstring(512)
free_it
Concatenates str1 and str2.
vcharadd is identical to cstradd and is provided for UDFLib compatibility
function cstrdel cstring(256),
integer, integer returns cstring(256) free_it
function vchardel cstring(256), integer, integer returns cstring(256)
free_it
Deletes the substring of length substr_len characters which starts at character pos from string str. pos is zero based.
If pos < 0 or substr_len < 0 or the substring extends beyond the end of the string then "Bad paramaters in chrdelete" is returned instead.
vchardel is identical to cstrdel and is provided for UDFLib compatibility.
function cstr_plus_int cstring(256), integer returns cstring(256) free_it
Appends num on to the end of str. The resulting string must be less than 255 characters long.
If the resulting string would exceed 255 characters then "Bad parameters in cstr_plus_int" is returned instead.
function int_plus_cstr cstring(256), integer returns cstring(256) free_it
Adds num on to the start of str. The resulting string must be less than 255 characters long.
If the resulting string would exceed 255 characters then "Bad parameters in cstr_int_plus_cstr" is returned instead.
function cstr_to_dbl cstring(256) returns double precision by value
Converts the string to a double.
function ascii cstring(1) returns integer by value
Returns the ascii value of c.
function chr integer returns cstring(1) free_it
Returns the character whose ascii value is n. n must be between 0 and 255.
If n is out of range then "Value out of range" is returned instead.
function parse cstring(256),
cstring(1), integer returns cstring(256) free_it
function vparse cstring(256), cstring(1), integer returns cstring(256)
free_it
This function views str as a series of substrings separated by the token character. It then returns the substring specified by pos. If pos is 1 then it returns the first substring etc.
If token is empty or pos < 1 then "Bad Paramaters in Parse" is returned. If pos is too large then it returns "Token to long in parse".
vparse is identical to parse and is provided for UDFLib compatibility.
function pos cstring(256),
cstring(256), integer, integer returns integer by value
function vpos cstring(256), cstring(256), integer, integer
returns integer by value
Searches str for a substring substr. start is the zero based index to start the search. occurrence specifies which substring to find. If occurrence is 1 then the first substring is required. The function returns the zero based index of the substring.
If the substring is not found then -1 is returned. If there is an error in the parameters then -999999 is returned.
vpos is identical to pos and is provided for UDFLib compatibility.
function pos cstring(256),
cstring(256), integer, integer returns integer by value
function vpos cstring(256), cstring(256), integer, integer
returns integer by value
Converts the first letter of every word to upper case. For example proper("david bowyer") would return "David Bowyer".
vproper is identical to proper and is provided for UDFLib compatibility.
function reverse cstring(256)
returns cstring(256) free_it
function vreverse cstring(256) returns cstring(256) free_it
Returns the inversion of str.
vreverse is identical to reverse and is provided for UDFLib compatibility.
function lefts cstring(256),
integer returns cstring(256) free_it
function vlefts cstring(256), integer returns cstring(256)
free_it
Returns the first num characters in str.
vlefts is identical to lefts and is provided for UDFLib compatibility.
function rights cstring(256),
integer returns cstring(256) free_it
function vrights cstring(256), integer returns cstring(256)
free_it
Returns the last num characters in str.
vrights is identical to rights and is provided for UDFLib compatibility.
function substring cstring(256),
integer, integer returns cstring(256) free_it
function vsubstring cstring(256), integer, integer returns
cstring(256) free_it
Returns the substring of str which starts at index start and finishes at index end. Both start and end are one based.
vsubstring is identical to substring and is provided for UDFLib compatibility.
function replicate cstring(1),
integer returns cstring(256) free_it
function vreplicate cstring(1), integer returns cstring(256)
free_it
Returns a string of length n consisting of the character c. n must be in the range 0 <= n <= 255. c must not be empty.
If c is empty or n is out of range then "Bad parameters" is returned.
vreplicate is identical to replicate and is provided for UDFLib compatibility.
function mer_year timestamp returns integer by value
Returns the year portion of the timestamp.
function mer_month timestamp returns integer by value
Returns the month portion of the timestamp as a number. 1 is January, 2 is February etc.
function month_of_year timestamp returns cstring(255) free_it
Returns the month portion of the timestamp as a string.
function mer_day timestamp returns integer by value
Returns the day in the month portion of the time stamp as an integer.
function day_of_week timestamp returns cstring(255) free_it
Returns the weekday name. e.g. Monday.
function dow timestamp returns integer by value
Days since Sunday. (1 for Sunday, 2 for Monday, ...)
function julian timestamp returns integer by value
Days since 1st January. (1 for 1st Jan, 2 for 2nd Jan, ...)
function mer_hour timestamp returns integer by value
Hour portion of the timestamp.
function mer_minute timestamp returns integer by value
Minute portion of the timestamp.
function sec timestamp returns integer by value
Second portion of the timestamp.
function msec timestamp returns integer by value
Millisecond portion of the timestamp. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function maxtime timestamp returns timestamp free_it
Sets the time portion of the timestamp to 23:59:59.9999. The day portion is left intact. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function zerotime timestamp returns timestamp free_it
Sets the time portion of the timestamp to 00:00:00.0000. The day portion is left intact. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function firstday timestamp returns timestamp free_it
Sets the day portion of the timestamp to the first day of the month. Sets the time portion of the timestamp to 00:00:00.0000. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function lastday timestamp returns timestamp free_it
Sets the day portion of the timestamp to the last day of the month. Sets the time portion of the timestamp to 23:59:59.9999. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function week timestamp returns int by value
Returns the week in the year as a number. (1 , 52)
function quarter timestamp, integer returns cstring(255) free_it
Returns the financial quarter the timestamp lies in. The format is YYQN where YY is the two digit year and N is from 1 to 4. fiscalyear gives the start of the financial year. (1 for January, 2 for February, ...).
For example
select quarter(CAST('1996-12-1' AS DATE), 1) from RDB$DATABASE
returns "96Q4".
function add_time timestamp, integer, integer, integer, integer, integer returns timestamp free_it
Adds the time period specified by day, hour, min, sec, msec to the
timestamp. Note none of the parameters is constrained. For
example hour could be 30.
The implementation of this function relies on 'undocumented'
information about the format of timestamps in Interbase.
function sub_time timestamp, integer, integer, integer, integer, integer returns timestamp free_it
Subtracts the time period specified by day, hour, min, sec, msec from the timestamp. Note none of the parameters is constrained. For example hour could be 30. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function makedate integer, integer, integer, integer, integer, integer returns timestamp free_it
Creates a timestamp from year, month, day, hour, min, sec. Note none of the parameters is constrained. For example hour could be 30. The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
function makedate integer, integer, integer, integer, integer, integer returns timestamp free_it
Returns the difference in time between the two timestamps. control specifies the units:
4 days
3 hours
2 minutes
1 seconds
0 milliseconds
The implementation of this function relies on 'undocumented' information about the format of timestamps in Interbase.
If control is not in the range (0, 4) then -999999 is returned. Also if the return value of this function would cause the integer to overflow then -999999 is returned instead.
UDFLib will happily let the return value of this function overflow. I view this as a defect in UDFLib and hence this function will not let the return value overflow. Any code which relies on this 'feature' will need to be changed.