Using type definitions

You can use a type definition (typedef) within a declare section to declare variables. For example:

exec sql begin declare section;
     /*
     ** The typedef and the use of the typedef
     ** can be in separate declare sections
     ** if the typedef comes first.
     ** The typedef can even be in an “exec
     ** sql include file”.
     */
     typedef int STORE_ID;
     STORE_ID current_ID;
 exec sql end declare section;
 
 exec sql select store_ID into :current_ID
     from sales_table where 
     store_name = 'Furniture Kingdom';