DB2 Version 10.1 for Linux, UNIX, and Windows

Declaration of the VARCHAR data type

You can declare host variables with VARCHAR data type, when you set the precompiler option COMPATIBILITY_MODE to ORA.

The following declaration of the VARCHAR data type is supported. The precompiler expands the VARCHAR data type into the equivalent C struct type:
EXEC SQL BEGIN DECLARE SECTION;
   VARCHAR var_name [n+1];
EXEC SQL END DECLARE SECTION;