Data Conversion for Adabas or RDBMS

#### Search Results

Search

# Data Conversion for Adabas or RDBMS

The conversion tables shown in this section list the Natural data formats and their corresponding data types in an Adabas database or in a relational database management system (RDBMS).

The generation of DDMs from an RDBMS requires the conversion from RDBMS-specific data types to Natural data formats. For general information on data access and data conversion, see the list of related documentation in Related Topics.

For information on using large and dynamic variables and/or fields, refer to the section DDM Generation and Editing for Varying Length Columns in the Statements documentation.

This section covers the following topics:

- Adabas

- Adabas D

- Db2

- Oracle

- Microsoft SQL Server

- MySQL

- PostgreSQL

- Related Topics

## Adabas

Data Type | Adabas Data Format | Natural Data Format/Length
--- | --- | ---
alphanumeric | A (n) | An
binary | B (n) | Bn
fixed | F (n) but: F8 | In I4
float | G (n) | Fn
packed | P (n) | P (2 * n - 1)
unpacked | U (n) | Nn
wide character (Unicode) | W (n) | U (n/2 rounded down)

## Adabas D

RDBMS Data Type | Natural Data Format/Length
--- | ---
boolean | L
char (n) | An
date | A10
fixed (p,q) | Np-q.q
float | F8
integer | I4
long | A (DYNAMIC)
long varchar | A (DYNAMIC)
smallint | I2
string | An
time | A8
timestamp | A26
varchar | An

## Db2

RDBMS Data Type | Natural Data Format/Length
--- | ---
date | A10
blob | B (DYNAMIC)
clob | A (DYNAMIC)
dbclob | U (DYNAMIC)
decimal(5) | N5
decimal(10,4) | N6.4
fixed character(5) | A5
float | Fn
graphic(n) | Un
longvar | A (DYNAMIC)
longvarg | A (DYNAMIC)
large integer | I4
scientific notation | N10.6
small integer | I2
special data | A253
system date and time | A10
time | A8
timestamp | A26
varchar | An
varg | 2*An
vargraphic(n) | Un

Notes:

1. Prerequisite for the use of the data types `blob`, `clob`, `dbclob`, `graphic` and `vargraphic` with Db2 is Entire Access Version 6.2.1 and above.
2. In Db2, the data types `graphic` and `vargraphic` are only available when the database has been generated with a statement like `CREATE DATABASE mydb USING CODESET UTF-8 TERRITORY US`. Refer to your local Db2 documentation for further information.

## Oracle

RDBMS Data Type | Natural Data Format/Length
--- | ---
blob | B (DYNAMIC)
char (n) | An
clob | A (DYNAMIC)
date | A10
decimal (p,q) | Np-q.q
double precision | F8
float | F4
integer | I4
long | A (DYNAMIC)
long raw | B (DYNAMIC)
nchar(n) | Un
nclob | U (DYNAMIC)
number | Nn
nvarchar2(n) | Un
raw (n) | Bn
real | F4
rowid | An
smallint | I2
timestamp | A26
varchar | An
varchar2 (n) | An

Notes:

1. Do not confuse the data types `long` and `long raw`, and `clob` and `blob` in the same table.
2. Prerequisite for the use of data type `timestamp` is Entire Access Version 6.2.1 and above. The timestamp variants `timestamp with time zone` and `timestamp with local time zone` are not supported.
3. Prerequisite for the use of the data types `nchar`, `nvarchar2` and `nclob` with Oracle is Entire Access Version 6.2.1 and above.

## Microsoft SQL Server

RDBMS Data Type | Natural Data Format/Length
--- | ---
binary (n) | Bn
bit | N1
char (n) | An
datetime | A26
float | F8
image | B (DYNAMIC)
int | I4
money | N15.4
nchar(2*n) | Un
ntext | U (DYNAMIC)
nvarchar(2*n) | Un
real | F4
smalldatetime | A26
smallint | I2
smallmoney | N6.4
text | A (DYNAMIC)
timestamp | B8
tinyint | I2
varbinary (n) | Bn
varchar (n) | An

Note
Prerequisite for the use of the data types `nchar`, `nvarchar` and `ntext` with Microsoft SQL Server is Entire Access Version 6.2.1 and above. Furthermore, these data types require the use of the MSSQLODBC driver of Entire Access Version 6.2.1 and above.

## MySQL

RDBMS Data Type | Natural Data Format/Length
--- | ---
bigint | P19
binary (n) | Bn
bit | N1
blob | B (DYNAMIC)
char (n) | An
date | A10
datetime | A26
decimal | N10.0
decimal (p,q) | Np-q.q
double | F8
float | F4
int | I4
mediumblob | B (DYNAMIC)
mediumint | I4
mediumtext | A (DYNAMIC)
numeric | N10.0
numeric (p,q) | Np-q.q
longblob | B (DYNAMIC)
longtext | A (DYNAMIC)
text | A (DYNAMIC)
time | A26
timestamp | A26
tinyblob | B (DYNAMIC)
tinytext | A (DYNAMIC)
tinyint | I2
smallint | I2
varbinary (n) | Bn
varchar (n) | An
year | A4

## PostgreSQL

RDBMS Data Type | Natural Data Format/Length
--- | ---
bigint | P19
bigserial | P19
boolean | L
bytea | B (DYNAMIC)
character (n) | An
character varying (n) | An
date | A10
decimal | N10.0
decimal (p,q) | Np-q.q
double precision | F8
integer | I4
interval | A20
numeric | N10.0
numeric (p,q) | Np-q.q
real | F4
serial | I4
smallint | I2
smallserial | I2
text | A (DYNAMIC)
time | A26
timestamp | A26

## Related Topics

The following documentation sections relate to converting data from Adabas or RDBMSs:

- Programming Guide:
  Accessing Data in an Adabas Database

  Accessing Data in an SQL Database

### On this page

- Adabas
- Adabas D
- Db2
- Oracle
- Microsoft SQL Server
- MySQL
- PostgreSQL
- Related Topics