Load Definitions Facility for DB2

The Load Definitions functionality is supported for DB2.

Functionality

The Load Definitions facility for DB2 loads tables, views, columns, and indexes.

It does not load relationships.

Configuration

Before loading definitions from DB2:

  • Specify the DB2 connector in the [DRIVERS] section of the IDE assignment file.
  • Define the $DB2W path in the [PATHS] section of the IDE assignment file.

For example:

[DRIVERS]
DB2=U4.0

[PATHS]
$DB2 DB2:Rdbdire:MYLIB|User|Password
$DB2W $DB2

For more detailed instructions, see Import Data Definitions From a DBMS .

Note: When selecting your database in the Tables tab in the IDE, use the connector with the name DB2W: (DB2).

Data Type Mapping

The Load Definitions utility maps DB2 data types to Uniface data types and packing codes. The following table lists these mappings.

Load Definitions Support for DB2 Data Types

DB2 Data Type

Supported by Load Definitions

Uniface Data Type

Uniface Packing Code

Remarks

bigint

Yes

N

I8

Range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

integer Yes N I4 Range -2,147,483,648 to 2,147,483,647

smallint

Yes

N

I2

Range -32,768 to 32,767

char, character

Yes

S

Cn

n<=254

varchar, long varchar

Yes

S

VCn

n>=255
clob Yes S SC*  
blob Yes R SR*  
graphic Yes S Wn  
vargraph, varg, vargraphic and long vargraphic Yes S VWn  
dlbclob Yes S SW*  
date

Yes

D

D

Uniface does not allow BC dates.

time

Yes

T

T

Uniface accuracy is limited to ticks.

timestamp, timestmp

Yes

E

E

Uniface accuracy is limited to ticks.

decimal(p,s) and numeric(p,s)

Yes

N

N(p+1).s, N(p+1)

pis precision (total number of digits); for Uniface p must be 30 max, field is skipped with a warning if p is larger.

sis scale (number of decimal places); for Uniface s must be smaller than p, field is skipped with a warning if they are equal.

s=0 generates N(p+1), rather than N(p+1).0

A ValRep is generated to enforce the exact DBMS max/min values during data entry and store validation; the ValRep range depends on p and s.

float, real, decfloat

Yes

F

F4 (Length <=4) or F8 (Length>4)

Uniface allows -1e+38 to 1e+38

Uniface will read the full database range. Storing outside the Uniface range generates an error.

double

Yes

F

F8

Uniface allows -1e+38 to 1e+38

Uniface will read the full database range. Storing outside the Uniface range generates an error.

Other data types      

The following data types are skipped with a warning message TYPE_NOT_SUPPORTED:

  • BINARY
  • VARBIN
  • ARRAY
  • VARBINARY
  • CURSOR
  • DFS_EXTERNAL_INPUT_LIBRARY_TYPE
  • NLS_STRING_UNITS_TYPE
  • REFERENCE
  • ROW
  • XML

Fields with a data type that is not known in the service are skipped with a warning message: TYPE_NOT_RECOGNIZED.

Related Topics