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 |
Description |
---|---|---|
NUMERIC-Types |
short, int, long, double, float |
|
VARCHAR |
char, char[n] varchar[n] |
Single character or n-byte character array varchar is "struct { int len; char arr[n] ;} " |
CHAR |
char, char[n] |
N-byte character array |
NUMBER(p,s) |
short int long float double |
Small integer integer large integer floating point number double-precision floating point number |
DATE |
char[n] SQL_DATE_STRUCTSQL_TIME_STRUCTSQL_TIMESTAMP_STRUCT |
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 |
BINARY |
APRE_CLOBAPRE_BLOBAPRE_BINARYAPRE_BYTESAPRE_NIBBLE |
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.
INDICATOR
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" clauses.int 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.
POINTER type
You can use a pointer type.
Also, You can use it as follows.
CONVBUFSZ
It is not supported-feature.