📄 orl.h
字号:
PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). number (IN) - Oracle number to be converted fmt (IN) - conversion format fmt_length (IN) - length of the 'fmt' parameter nls_params (IN) - nls format specification, if null string i.e. (oratext *)0, then the default parameters for the session is used nls_p_length (IN) - length of the 'nls_params' parameter buf_size (IN/OUT) - size of the buffer must be passed as input by the caller, this function will return the length of the resulting string in bytes via this parameter. The length does not include the terminating null ('\0'). buf (OUT) - buffer into which the converted string is placed. The resulting string is null terminated. DESCRIPTION: Converts the given number to a character string according to the specified format. Refer to "TO_NUMBER" conversion function described in "Oracle SQL Language Reference Manual" for a description of format and NLS parameters. The converted number string is stored in the buffer 'buf', up to a max of '*buf_size' bytes. Length of the resulting string is returned via 'buf_size'. RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'buf' is null buffer too small invalid format invalid nls format number to text translation for the given format causes overflow *//*-------------------------- OCINumberFromText ------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberFromText(/*_ OCIError *err, CONST oratext *str, ub4 str_length, CONST oratext *fmt, ub4 fmt_length, CONST oratext *nls_params, ub4 nls_p_length, OCINumber *number _*/);#else /* ANSI C */sword OCINumberFromText( OCIError *err, CONST oratext *str, ub4 str_length, CONST oratext *fmt, ub4 fmt_length, CONST oratext *nls_params, ub4 nls_p_length, OCINumber *number );#endif/* NAME: OCINumberFromText - OCINumber convert String TO Number PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). str (IN) - input string to be converted to Oracle number str_length (IN) - size of the input string fmt (IN) - conversion format fmt_length (IN) - length of the 'fmt' parameter nls_params (IN) - nls format specification, if null string i.e. (oratext *)0, then the default parameters for the session is used nls_p_length (IN) - length of the 'nls_params' parameter number (OUT) - given string converted to number DESCRIPTION: Converts the given string to a number according to the specified format. Refer to "TO_NUMBER" conversion function described in "Oracle SQL Language Reference Manual" for a description of format and NLS parameters. RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'str' is null 'str_length' is 0 invalid format invalid nls format invalid input string *//*-------------------------- OCINumberToInt ---------------------------------*/#define OCI_NUMBER_UNSIGNED 0 /* Unsigned type -- ubX */#define OCI_NUMBER_SIGNED 2 /* Signed type -- sbX */#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberToInt(/*_ OCIError *err, CONST OCINumber *number, uword rsl_length, uword rsl_flag, dvoid *rsl _*/);#else /* ANSI C */sword OCINumberToInt( OCIError *err, CONST OCINumber *number, uword rsl_length, uword rsl_flag, dvoid *rsl );#endif/* NAME: OCINumberToInt - OCINumber convert number TO Integer PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). number (IN) - number to be converted rsl_length (IN) - size of the desired result rsl_s_flag (IN) - flag denoting the desired sign of the output; valid values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED rsl (OUT) - pointer to space for the result DESCRIPTION: Native type conversion function. Converts the given Oracle number into an xbx (e.g. ub2, ub4, sb2 etc.) RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'rsl' is null integer value of 'number' is too big -- overflow integer value of 'number' is too small -- underflow invalid sign flag value ('rsl_s_flag') *//*--------------------------- OCINumberFromInt ------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberFromInt(/*_ OCIError *err, CONST dvoid *inum, uword inum_length, uword inum_s_flag, OCINumber *number _*/);#else /* ANSI C */sword OCINumberFromInt( OCIError *err, CONST dvoid *inum, uword inum_length, uword inum_s_flag, OCINumber *number );#endif/* NAME: OCINumberFromInt - OCINumber convert Integer TO Number PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). inum (IN) - pointer to the integer to be converted inum_length (IN) - size of the integer inum_s_flag (IN) - flag that designates the sign of the integer; valid values are OCI_NUMBER_UNSIGNED, OCI_NUMBER_SIGNED number (OUT) - given integer converted to Oracle number DESCRIPTION: Native type conversion function. Converts any Oracle standard machine-native integer type (xbx) to an Oracle number. RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'inum' is null integer too BIG -- the number is too large to fit into an Oracle number invalid sign flag value ('inum_s_flag') *//*------------------------- OCINumberToReal ---------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberToReal(/*_ OCIError *err, CONST OCINumber *number, uword rsl_length, dvoid *rsl _*/);#else /* ANSI C */sword OCINumberToReal( OCIError *err, CONST OCINumber *number, uword rsl_length, dvoid *rsl );#endif/* NAME: OCINumberToReal - OCINumber convert number TO Real PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). number (IN) - number to be converted rsl_length (IN) - is the size of the desired result, sizeof( float | double | long double) rsl (OUT) - pointer to space for storing the result DESCRIPTION: Native type conversion function. Converts an Oracle number into a machine-native real type. This function only converts numbers up to LDBL_DIG, DBL_DIG, or FLT_DIG digits of precision and removes trailing zeroes. The above constants are defined in float.h RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'rsl' is null 'rsl_length' is 0 *//*-------------------------- OCINumberFromReal ------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberFromReal(/*_ OCIError *err, CONST dvoid *rnum, uword rnum_length, OCINumber *number _*/);#else /* ANSI C */sword OCINumberFromReal( OCIError *err, CONST dvoid *rnum, uword rnum_length, OCINumber *number );#endif/* NAME: OCINumberFromReal - OCINumber convert Real TO Number PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). rnum (IN) - pointer to the floating point number to be converted rnum_length (IN) - size of the desired result, i.e. sizeof({float | double | long double}) number (OUT) - given float converted to Oracle number DESCRIPTION: Native type conversion function. Converts a machine-native floating point type to an Oracle number. RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'rnum' is null 'rnum_length' is 0 *//*----------------------------- OCINumberCmp --------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberCmp(/*_ OCIError *err, CONST OCINumber *number1, CONST OCINumber *number2, sword *result _*/);#else /* ANSI C */sword OCINumberCmp( OCIError *err, CONST OCINumber *number1, CONST OCINumber *number2, sword *result );#endif/* NAME: OCINumberCmp - OCINumber CoMPare numbers PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). number1, number2 (IN) - numbers to be compared result (OUT) - 0 if equal, negative if number1 < number2, positive if number1 > number2 DESCRIPTION: The function OCINumberCmp compares two numbers. RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number1' or 'number2' or 'result' is null *//*---------------------------- OCINumberSign --------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberSign(/*_ OCIError *err, CONST OCINumber *number, sword *result _*/);#else /* ANSI C */sword OCINumberSign( OCIError *err, CONST OCINumber *number, sword *result );#endif/* NAME: OCINumberSign - OCINumber obtains SiGN of an Oracle number PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). number (IN) - number whose sign is returned result (OUT) - 0 if number == 0, -1 if number < 0, 1 if number > 0 DESCRIPTION: Obtains sign of an Oracle number RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'result' is null *//*---------------------------- OCINumberIsZero ------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberIsZero(/*_ OCIError *err, CONST OCINumber *number, boolean *result _*/);#else /* ANSI C */sword OCINumberIsZero( OCIError *err, CONST OCINumber *number, boolean *result );#endif/* NAME: OCINumberIsZero - OCINumber comparison with ZERo PARAMETERS: err (IN/OUT) - error handle. If there is an error, it is recorded in 'err' and this function returns OCI_ERROR. The error recorded in 'err' can be retrieved by calling OCIErrorGet(). number (IN) - numbers to be compared result (OUT) - set to TRUE if equal to zero else FALSE DESCRIPTION: Test if the given number is equal to zero. RETURNS: OCI_SUCCESS if the function completes successfully. OCI_INVALID_HANDLE if 'err' is NULL. OCI_ERROR if 'number' or 'result' is null *//*---------------------------- OCINumberIsInt -------------------------------*/#if !defined(__STDC__) && !defined(__cplusplus) /* K&R C - not ANSI C */sword OCINumberIsInt(/*_ OCIError *err, CONST OCINumber *number, boolean *result _*/);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -