Determine if truncation has occurred on a character array
If
you define lname in the customer table with a length
that is longer than 15 characters, nameind contains the actual
length of the lname column. The name host variable contains
the first 15 characters of the lname value. (The string name must
be terminated with a null character.) If the family name of the company
representative with customer_num = 105 is shorter than 15 characters, truncates
only the trailing blanks.
Check for a null value
If company has a null value for
this same customer, compind has a negative value. The contents
of the character array comp cannot be predicted.
The following figure shows the program
that uses the EXEC SQL syntax for the SQL statements.
The following figure shows the program
that uses the dollar sign ($) format for the SQL statements.
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.