Entering content frame

 Conventions for Host Variables 

Observe the following conventions for host variables.

·        The name of a host variable can have a maximum of 32 characters.

·        The name of a host variable cannot start with the characters sq.

·        A host variable can be a structure or an array. A structure can contain arrays, and arrays of structures are also possible.

·        A host variable can be a pointer variable of permitted data types. Pointer to Pointer and Pointer to Array are not permitted.

·        In each declaration, you can specify a maximum of one pointer and arrays with up to four dimensions. Arrays of pointer variables are permitted, but not Pointer to Array.

·        The precompiler cannot check the lengths of host variables with the data type char *, and writes a warning to the precompiler log. At runtime, the character pointer must point to a NULL-delimited character string.

·        So that they can include the closing NULL bytes, host variables with the data type char [n] must be declared with one more field than the corresponding column in the database table.
When char variables are send to a database table, the variable content is copied up to the closing NULL byte. Longer table columns are filled up with blank characters.
When char variables are read from a database table, all following blank characters in the table content are truncated, and the closing NULL byte is set in the variable after the last character that is not a blank character. If the host variable is shorter than the table column, then the last character is overwritten.

 

Leaving content frame