risnull()
Checks whether a C variable is null
rsetnull()
Sets a C variable to null
rtypalign()
Aligns data on proper type boundaries
rtypmsize()
Gives byte size of SQL data types
rtypname()
Returns the name of a specified SQL data type
rtypwidth()
Returns minimum number of characters that a character data type needs to avoid truncation
When you compile your ESQL/C program with the esql command, esql calls on the linker to link these functions to your program. The following pages describe these functions. risnull() The risnull() function checks whether a C or an ESQL/C variable contains a null value. Syntax
type
is an integer that corresponds to the data type of a C or ESQL/C variable. This type can be any data type except var binary or an lvarchar pointer variable. For more information, see "Defined Constants for Data Types".
ptrvar
is a pointer to the C or ESQL/C variable.
Return Codes
1
The variable does contain a null value.
0
The variable does not contain a null value.
Example Output
Example This sample program is in the rsetnull.ec file in the demo directory.
pos
is the current position in a buffer.
is an integer that corresponds to the data type of a C or ESQL/C variable. This type can be any data type except var binary. For more information, see "Defined Constants for Data Types".
>0
The return value is the offset of the next proper boundary for a variable of type data type.
sqltype
is the integer code of the ESQL/C or SQL data type. For more information, see "Defined Constants for Data Types".
sqllen
is the number of bytes in the data file for the specified data type.
The sqltype is not a valid SQL type.
The return value is the number of bytes that the sqltype data type requires.
is an integer code for one of the SQL data types. For more information, see "Defined Constants for Data Types".
The sqltype is not a valid SQL data type.
> 0
The return value is the minimum number of characters that the sqltype data type requires.