Skip to end of metadata
Go to start of metadata

APRE compile options

APRE has three parse-options. (refer to this document).

If you want to declare host-variables without "EXEC SQL BEGIN DECLARE" and "EXEC SQL END DECLARE" clauses,

You have to use option like "-parse full".

Data Types

Internal Type in DB

C Type in your source-code



short, int, long, double, float



char, char[n] varchar[n]

Single character or n-byte character array varchar is "struct { int len; char arr[n] ;} "


char, char[n]

N-byte character array


short int long float double

Small integer integer large integer floating point number double-precision floating point number



N-byte character array year, month, day : small integer hour, minute, second : small integer year, month, day, hour, minute, second : small integer and fraction : integer



N-byte charater array. Definition in APRE is as follows. typedef char APRE_CLOB; typedef char APRE_BLOB; typedef char APRE_BINARY; typedef char APRE_BYTES; typedef char APRE_NIBBLE;

  • APRE doesn't support a "ROWID" type.
  • APRE doesn't support "LONG" and "RAW" type.
  • For example, Even though you can use a char-type host-variable for integer-column, We don't recommend a conversion between char-type and numeric-type.


You can use every host-varaible with optional indicator-varaible defined as 4-byte integer.

Indicator-variable indicates that a return-value from DB is NULL. 

CURSOR Variable

APRE doesn't support a cursor-variable like "SQL_CURSOR".

CONTEXT Variable

APRE doesn't support a context-variable like "ALLOCATE", "CONTEXT".

HOST Structure

You can use a structure host-variable as follows.

APRE supports host-structure and arrays...

You can not use a structure type in structure like ORACLE.

  • APRE supports "For" rows_to_insert;
    rows_to_insert = 2;
    EXEC SQL FOR :rows_to_insert INSERT INTO employee VALUES (:array_variable);

You can use Indicator structure and arrays as follows.

Indicator structure arrays sample-code.


You can use a pointer type.

Also, You can use it as follows.


It is not supported-feature.

  • No labels