Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Host Language Dependent Aspects


You can call SQL modules (MSQL) in any host language that supports the C data types generated by the MSQL preprocessor. The following host languages are supported:

Note: This is not a complete description of the rules for writing SQL modules. The programmer should use the main body of this manual as a guide to writing programs and refer to this appendix for language-specific details.

This section describes the recommended data types to use in each of the above mentioned host languages when calling an SQL module procedure.

The SQL data types INT(n>18), FLOAT, BINARY and VARBINARY are handled by Module SQL as null-terminated C char arrays, no matter the calling host language. The host application needs to apply null termination to any input, and take precautions to null termination appearing in any output.

The SQL data types DATE, TIME, TIMESTAMP, INTERVAL, CHAR, VARCHAR, CLOB and BOOLEAN are handled by Module SQL as character arrays of the given host language, see Module declaration for more details.

C data types

SQL data type
C data type
BIGINT
long long*
BINARY(n)
unsigned char[n+1]
BLOB(size)
struct {
long hvn_reserved;
unsigned long hvn_length;
char hvn_data[size];
} hvn;
BOOLEAN
char[6]
CHAR(n)
char[n+1]
CLOB(size)
struct {
long hvn_reserved;
unsigned long hvn_length;
char hvn_data[size];
} hvn;
DATE
char[100]
DECIMAL(p)
DECIMAL(p,s)
double*
DOUBLE PRECISION
double*
FLOAT
double*
FLOAT(n)
char[n+8]
INTEGER
int*
INTEGER(n)
n <= 4: short*
5 <= n<= 9: int*
10 <= n <= 18: long long*
19 <= n <= 45: char[n+2]
INTERVAL data types
char[100]
NCHAR(n)
wchar_t[n+1]
NCLOB(size)
struct {
long hvn_reserved;
unsigned long hvn_length;
wchar_t hvn_data[size];
} hvn;
NVARCHAR(n)
wchar_t[n+1]
REAL
float*
SMALLINT
short*
SQLCODE
int*
SQLSTATE
char[6]
TIME data types
char[100]
TIMESTAMP data types
char[100]
VARBINARY(n)
unsigned char[n+1]
VARCHAR(n)
char[n+1]

COBOL data types

SQL data type
COBOL data type
BIGINT
PIC S9(18) USAGE IS BINARY
BINARY(n)
PICTURE X(n+1)
BLOB(size)
01 hvn.
49 hvn-RESERVED PIC S9(9) USAGE IS BINARY.
49 hvn-LENGTH PIC S9(9) USAGE IS BINARY.
49 hvn-DATA PIC X(size).
BOOLEAN
PICTURE X(5)
CHAR(n)
PICTURE X(n)
CLOB(size)
PICTURE X(size)
DATE
PICTURE X(100)
DECIMAL(p)
DECIMAL(p,0)
PIC S9(p) COMP-3
DECIMAL(p,s)
PIC S9(p)V9(s) COMP-3
DOUBLE PRECISION
COMP-2
FLOAT
COMP-2
FLOAT(n)
PICTURE X(n+8)
INTEGER
PIC S9(9) USAGE IS BINARY
INTEGER(n)
1 <= n <= 4: PIC S9(4) USAGE IS BINARY
5 <= n <= 9: PIC S9(9) USAGE IS BINARY
10 <= n <= 18: PIC S9(18) USAGE IS BINARY
19 <= n <= 45: PICTURE X(n+2)
INTERVAL data types
PICTURE X(100)
NCHAR(n)
PICTURE N(n+1)
NCLOB(size)
01 hvn.
49 hvn-RESERVED PIC S9(9) USAGE IS BINARY.
49 hvn-LENGTH PIC S9(9) USAGE IS BINARY.
49 hvn-DATA PIC N(size).
NVARCHAR(n)
PICTURE N(n+1)
REAL
COMP-1
SMALLINT
PIC S9(4) USAGE IS BINARY
SQLCODE
PIC S9(9) USAGE IS BINARY
SQLSTATE
PIC X(5)
TIME data types
PICTURE X(100)
TIMESTAMP data types
PICTURE X(100)
VARBINARY(n)
PICTURE X(n+1)
VARCHAR(n)
PICTURE X(n)

Fortran data types

SQL data type
Fortran data type
BIGINT
INTEGER*8
BINARY(n)
INTEGER*1(n+1)
BLOB(size)
INTEGER*1 hvn(size + 8)
INTEGER*4 hvn_RESERVED
INTEGER*4 hvn_LENGTH
INTEGER*1 hvn_DATA(size)
EQUIVALENCE(hvn(1), hvn_RESERVED)
EQUIVALENCE(hvn(5), hvn_LENGTH)
EQUIVALENCE(hvn(9), hvn_DATA)
BOOLEAN
CHARACTER*5
CHARACTER(n)
CHARACTER*n
CLOB(size)
CHARACTER*size
DATE
CHARACTER*100
DECIMAL(p)
DECIMAL(p,s)
DOUBLE PRECISION
DOUBLE PRECISION
DOUBLE PRECISION
FLOAT
DOUBLE PRECISION
FLOAT(n)
INTEGER*1(n+8)
INTEGER
INTEGER*4
INTEGER(n)
1 <= n <= 4: INTEGER*2
5 <= n <= 9: INTEGER*4
10 <= n <= 18: INTEGER*8
19 <= n <= 45: INTEGER*1(n+2)
INTERVAL data types
CHARACTER*100
NCHAR(n)
INTEGER*4(n+1)
NCLOB(size)
INTEGER*1 hvn(size*4 + 8)
INTEGER*4 hvn_RESERVED
INTEGER*4 hvn_LENGTH
INTEGER*4 hvn_DATA(1222)
EQUIVALENCE(hvn(1), hvn_RESERVED)
EQUIVALENCE(hvn(5), hvn_LENGTH)
EQUIVALENCE(hvn(9), hvn_DATA)
NVARCHAR(n)
INTEGER*4(n+1)
REAL
REAL
SMALLINT
INTEGER*2
SQLCODE
INTEGER*4
SQLSTATE
CHARACTER*5
TIME data types
CHARACTER*100
TIMESTAMP data types
CHARACTER*100
VARBINARY(n)
INTEGER*1(n+1)
VARCHAR(n)
CHARACTER*n

Pascal data types

SQL data type
Pascal data type
BIGINT
integer64
BINARY(n)
packed array [1..n+1] of char
BLOB(size)
TYPE X = RECORD
hvn_RESERVED : INTEGER;
hvn_LENGTH : INTEGER;
hvn_DATA : PACKED ARRAY [1..size] OF CHAR;
END;
BOOLEAN
packed array [1..5] of char
CHARACTER(n)
packed array [1..n] of char
CLOB(size)
packed array [1..size] of char
DATE
packed array [1..100] of char
DECIMAL(p)
DECIMAL(p,s)
double
DOUBLE PRECISION
double
FLOAT
double
FLOAT(n)
packed array [1..n+8] of char
INTEGER
integer32
INTEGER(n)
1 <= n <= 4: integer16
5 <= n <= 9: integer32
10 <= n <= 18: integer64
19 <= n <= 45: packed array [1..n+2] of char
INTERVAL data types
packed array [1..100] of char
NCHAR(n)
packed array [1..n] of char
NCLOB(size)
TYPE X = RECORD
hvn_RESERVED : INTEGER;
hvn_LENGTH : INTEGER;
hvn_DATA : PACKED ARRAY [1..size] OF CHAR;
END;
NVARCHAR(n)
packed array [1..n] of char
REAL
single
SMALLINT
integer16
SQLCODE
integer32
SQLSTATE
packed array [1..5] of char
TIME data types
packed array [1..100] of char
TIMESTAMP data types
packed array [1..100] of char
VARBINARY(n)
packed array [1..n+1] of char
VARCHAR(n)
packed array [1..n] of char


Mimer
Mimer Information Technology AB
Phone: +46 18 780 92 00
info@mimer.com
Mimer SQL Documentation TOC PREV NEXT INDEX