📄 ib_udf.sql
字号:
*****************************************/
DECLARE EXTERNAL FUNCTION log10
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_log10' MODULE_NAME 'ib_udf';
/*****************************************
*
* l o w e r
*
*****************************************
*
* Functional description:
* Returns the input string into lower
* case characters. Note: This function
* will not work with international and
* non-ascii characters.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION lower
CSTRING(80)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';
/*****************************************
*
* l p a d
*
*****************************************
*
* Functional description:
* Appends the given character to beginning
* of the input string until length of the result
* string becomes equal to the given number.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION lpad
CSTRING(80), INTEGER, CSTRING(1)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_lpad' MODULE_NAME 'ib_udf';
/*****************************************
*
* l t r i m
*
*****************************************
*
* Functional description:
* Removes leading spaces from the input
* string.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION ltrim
CSTRING(80)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_ltrim' MODULE_NAME 'ib_udf';
/*****************************************
*
* m o d
*
*****************************************
*
* Functional description:
* Returns the remainder part of the
* division of the two input parameters.
*
*****************************************/
DECLARE EXTERNAL FUNCTION mod
INTEGER, INTEGER
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_mod' MODULE_NAME 'ib_udf';
/*****************************************
*
* p i
*
*****************************************
*
* Functional description:
* Returns the value of pi = 3.1459...
*
*****************************************/
DECLARE EXTERNAL FUNCTION pi
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_pi' MODULE_NAME 'ib_udf';
/*****************************************
*
* r a n d
*
*****************************************
*
* Functional description:
* Returns a random number between 0
* and 1. Note the random number
* generator is seeded using the current
* time.
*
*****************************************/
DECLARE EXTERNAL FUNCTION rand
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_rand' MODULE_NAME 'ib_udf';
/*****************************************
*
* r p a d
*
*****************************************
*
* Functional description:
* Appends the given character to end
* of the input string until length of the result
* string becomes equal to the given number.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION rpad
CSTRING(80), INTEGER, CSTRING(1)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_rpad' MODULE_NAME 'ib_udf';
/*****************************************
*
* r t r i m
*
*****************************************
*
* Functional description:
* Removes trailing spaces from the input
* string.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION rtrim
CSTRING(80)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_rtrim' MODULE_NAME 'ib_udf';
/*****************************************
*
* s i g n
*
*****************************************
*
* Functional description:
* Returns 1, 0, or -1 depending on whether
* the input value is positive, zero or
* negative, respectively.
*
*****************************************/
DECLARE EXTERNAL FUNCTION sign
DOUBLE PRECISION
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_sign' MODULE_NAME 'ib_udf';
/*****************************************
*
* s i n
*
*****************************************
*
* Functional description:
* Returns the sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* returns an indefinite (same as a quiet NaN).
*
*****************************************/
DECLARE EXTERNAL FUNCTION sin
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sin' MODULE_NAME 'ib_udf';
/*****************************************
*
* s i n h
*
*****************************************
*
* Functional description:
* Returns the hyperbolic sine of x. If x is greater
* than or equal to 263, or less than or
* equal to -263, a loss of significance
* in the result occurs, in which case the
* function generates a _TLOSS error and
* returns an indefinite (same as a quiet NaN).
*
*****************************************/
DECLARE EXTERNAL FUNCTION sinh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sinh' MODULE_NAME 'ib_udf';
/*****************************************
*
* s q r t
*
*****************************************
*
* Functional description:
* Returns the square root of a number.
*
*****************************************/
DECLARE EXTERNAL FUNCTION sqrt
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_sqrt' MODULE_NAME 'ib_udf';
/*****************************************
*
* s u b s t r
*
*****************************************
*
* Functional description:
* substr(s,m,n) returns the substring
* of s which starts at position m and
* ending at position n.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
* Change by Claudio Valderrama: when n>length(s),
* the result will be the original string instead
* of NULL as it was originally designed.
*
*****************************************/
DECLARE EXTERNAL FUNCTION substr
CSTRING(80), SMALLINT, SMALLINT
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_substr' MODULE_NAME 'ib_udf';
/*****************************************
*
* s u b s t r l e n
*
*****************************************
*
* Functional description:
* substr(s,i,l) returns the substring
* of s which starts at position i and
* ends at position i+l-1, being l the length.
* Note: This function is NOT limited to
* receiving and returning only 80 characters,
* rather, it can use as long as 32767
* characters which is the limit on an
* INTERBASE character string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION substrlen
CSTRING(80), SMALLINT, SMALLINT
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_substrlen' MODULE_NAME 'ib_udf';
/*****************************************
*
* s t r l e n
*
*****************************************
*
* Functional description:
* Returns the length of a given string.
*
*****************************************/
DECLARE EXTERNAL FUNCTION strlen
CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';
/*****************************************
*
* t a n
*
*****************************************
*
* Functional description:
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* (same as a quiet NaN).
*
*****************************************/
DECLARE EXTERNAL FUNCTION tan
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_tan' MODULE_NAME 'ib_udf';
/*****************************************
*
* t a n h
*
*****************************************
*
* Functional description:
* Returns the tangent of x. If x is
* greater than or equal to 263, or less
* than or equal to -263, a loss of
* significance in the result occurs, in
* which case the function generates a
* _TLOSS error and returns an indefinite
* (same as a quiet NaN).
*
*****************************************/
DECLARE EXTERNAL FUNCTION tanh
DOUBLE PRECISION
RETURNS DOUBLE PRECISION BY VALUE
ENTRY_POINT 'IB_UDF_tanh' MODULE_NAME 'ib_udf';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -