#docslug#/obci/obci/V1.2.0/cv0p3d
OCINumberToInt
Description : You can call this function to convert an Oracle NUMBER type to an integer.
Function prototype :
sword OCINumberToInt (
OCIError *err,
const OCINumber *number,
uword rsl_length,
uword rsl_flag,
void *rsl );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | An error handle. |
| number(IN) | The number to be converted. |
| rsl_length(IN) | The size of the rsl parameter. |
| rsl_flag(IN) | The flag that designates the sign of the output. Valid values: |
| rsl(OUT) | The pointer to the result space. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCINumberToReal
Description : You can call this function to convert an Oracle NUMBER type to a real type.
Function prototype :
sword OCINumberToReal (
OCIError *err,
const OCINumber *number,
uword rsl_length,
void *rsl );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | An error handle. |
| number(IN) | The number to be converted. |
| rsl_length(IN) | The size of the desired result. The value equals sizeof({ float | double | long double}). |
| rsl(OUT) | The pointer to the result space. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCINumberToText
Description : You can call this function to convert an Oracle NUMBER to a string type in specified format.
Function prototype :
sword OCINumberToText (
OCIError *err,
const OCINumber *number,
const OraText *fmt,
ub4 fmt_length,
const OraText *nls_params,
ub4 nls_p_length,
ub4 *buf_size,
OraText *buf );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | An error handle. |
| number(IN) | The number to be converted. |
| fmt(IN) | The conversion format. |
| fmt_length(IN) | The length of the format. |
| nls_params(IN) | Default parameters of the session are used if it is a NULL string ((text *) 0). |
| nls_p_length(IN) | The length of nls_params. |
| buf_size(IN) | The size of the buffer. |
| buf(OUT) | The buffer where the converted string is placed. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCINumberIsInt
Description : You can call this function to test whether the OCINumber value is an integer.
Function prototype :
sword OCINumberIsInt (
OCIError *err,
const OCINumber *number,
boolean *result );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | An error handle. |
| number(IN) | The number to be tested. |
| result(OUT) | Set it to TRUE if the result is an integer, or FALSE if otherwise. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCINumberFromText
Description : You can call this function to convert a string to an Oracle NUMBER.
Function prototype :
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 );
Parameters :
| Parameter | Description |
|---|---|
| err(IN/OUT) | An error handle. |
| str(IN) | The input string to be converted to an Oracle NUMBER. |
| str_length(IN) | The size of the input string. |
| fmt(IN) | The conversion format. |
| fmt_length(IN) | The length of the format. |
| nls_params(IN) | Default parameters of the session are used if it is a NULL string (""). |
| nls_p_length(IN) | The length of nls_params. |
| number(OUT) | Converted number. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.