Progress
Embedded SQL-92
Guide and Reference


CHARACTER Data Type

The Progress SQL-92 data type CHARACTER (alias CHAR) corresponds to a NULL terminated character string with a maximum length of 2000 characters. The host language representation is a C Language character string.

You can use a literal character string or a host variable declared as a character array as an INPUT host variable. You must enclose string constants or literals in single or double quotes. You can also use a host variable declared as a character array as an OUTPUT host variable.

EXAMPLES

The SELECT statement in the following code fragment uses an INPUT host variable and an OUTPUT host variable, each with data type CHAR:

EXEC SQL BEGIN DECLARE SECTION ;
     char city_v[19] ;
     char name_v[19] ;
EXEC SQL END DECLARE SECTION ;
   .
   .
   .
EXEC SQL
     SELECT city
     INTO :city_v
     FROM customer
     WHERE last_name = :name_v ; 

The city_v variable is an OUTPUT host variable, and name_v is an INPUT host variable. Each is declared as a character array in the DECLARE SECTION. An INPUT host variable can also be a character literal, as shown in this example:

WHERE last_name = ’JOHN’ ; 

You can use the scalar functions SUBSTR, INSTR, LENGTH, LOWER, and UPPER to manipulate character strings. See Chapter 4, “SQL-92 Functions,” in the Progress SQL-92 Guide and Reference for additional information on scalar functions.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095