Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 63
TYPE Clause
SQL VARCHAR Field Output for pTAL and TAL. The following examples show how
DDL translates definitions and descriptions of SQL VARCHAR fields into pTAL or TAL
source code:
Bit Field Output for C. The following examples show how DDL translates definitions
and descriptions of bit fields into C source code:
DDL Type
pTAL or TAL Type
DEF name TYPE SQL VARCHAR 25
VALUE "Mary".
DEF customer.
02 customer-name TYPE name.
02 address TYPE SQL VARCHAR 29
OCCURS 10 TIMES.
END
STRUCT NAME FIELDALIGN (SHARED2);
BEGIN
INT LEN;
STRING VAL[1:25];
END;
! value is "Mary"
STRUCT CUSTOMER^DEF (*) FIELDALIGN (SHARED2);
BEGIN
STRUCT CUSTOMER^NAME;
BEGIN
INT LEN;
STRING VAL[1:25];
END;
! value is "Mary"
FILLER 1;
STRUCT ADDRESS[1:10];
BEGIN
INT LEN;
STRING VAL[1:29];
FILLER 1;
END;
END;
DDL Type
C Type
DEF Bit-1 TYPE BIT 1
DEF New-Bit-1 TYPE Bit-1
DEF Bit-10 TYPE BIT 10
UNSIGNED.
DEF Bit-Map.
2 Bits-8 TYPE BIT 8.
2 Bits-3 TYPE BIT 3 UNSIGNED.
2 Bits-10 TYPE BIT 10.
End.
DEF Bit-Struct.
2 Bits-0 TYPE Bit-1.
2 Bits-1-To-10 TYPE Bit-10.
End.
typedef unsigned short bit_1_def;
typedef bit_1_def new_bit_1_def;
typedef unsigned short bit_10_def;
#pragma fieldalign shared2 __bit_map
typedef struct __bit_map
{
short bits_8:8;
unsigned short bits_3:3;
short bits_10:10;
} bit_map_def;
#pragma fieldalign shared2 __bit_struct
typedef struct
{
unsigned short bits_0:1;
unsigned short bits_1_to_10:10;
} bit_struct_def;
Содержание DDL D40
Страница 36: ...Introduction to DDL Data Definition Language DDL Reference Manual 426798 002 1 14 Examining a Dictionary ...
Страница 66: ...Named Constants Data Definition Language DDL Reference Manual 426798 002 4 10 Standard SPI Constants ...
Страница 230: ...Dictionary Manipulation Statements Data Definition Language DDL Reference Manual 426798 002 8 14 SHOW USE OF Statement ...
Страница 370: ...Dictionary Maintenance Data Definition Language DDL Reference Manual 426798 002 10 24 Converting a Dictionary ...
Страница 456: ...Sample Schemas Data Definition Language DDL Reference Manual 426798 002 B 12 ASSNDDL Statements ...
Страница 470: ...DDL Data Translation Data Definition Language DDL Reference Manual 426798 002 C 14 ...
Страница 528: ...Dictionary Reports Data Definition Language DDL Reference Manual 426798 002 E 8 Requesting Reports ...
Страница 552: ...DDL Alignment Rules Data Definition Language DDL Reference Manual 426798 002 H 4 FIELDALIGN_SHARED8 Alignment Rules ...
Страница 576: ...Index Data Definition Language DDL Reference Manual 426798 002 Index 22 Special Characters ...