4. Embedded SQL for Fortran : Dynamic Programming for Fortran : SQLVAR Array Usage : Fortran Variable Type Codes
 
Share this page                  
Fortran Variable Type Codes
The type codes listed below are the types that describe Ingres result fields and columns. For example, the SQL types date, long varchar, money, and decimal do not describe program variables, but rather data types that are compatible with Fortran types character and real*8. When these types are returned by the describe statement, the type code must be changed to a compatible SQL/Fortran type.
The following table describes the type codes to use with Fortran variables that will be pointed at by the sqldata pointers.
Embedded SQL/Fortran Type Codes (sqltype)
Length (sqllen)
Fortran Variable Type
IISQ_INT_TYPE
1
byte
IISQ_INT_TYPE
2
integer*2
IISQ_INT_TYPE
4
integer*4
IISQ_FLT_TYPE
4
real*4
IISQ_FLT_TYPE
8
real*8
IISQ_CHA_TYPE
LEN
character*LEN
IISQ_VCH_TYPE
LEN
character*LEN
IISQ_HDLR_TYPE
0
IISQHDLR
To retrieve a decimal value from the DBMS, you must use a float because Fortran does not have decimal variables.
Nullable data types (those variables that are associated with a null indicator) are specified by assigning the negative of the type code to the sqltype field. If the type is negative, a null indicator must be pointed at by the sqlind field.
Character data and the SQLDA have exactly the same rules as character data in regular Embedded SQL statements.