The Oracle-specific section of the Native SQL documentation deals with combinations of ABAP data types and column types of an Oracle table. It describes in detail the type conversions used for each type combination. The abbreviations introduced in the general description, such as [rtrunc] are used.
The list is divided roughly into the two data transfer directions:
· Storing values from ABAP fields in database columns (INSERT).
· Reading values from database columns into ABAP fields (SELECT).
Each description assumes that the starting value is a permitted value for the corresponding type. Cases where invalid bit patterns are created in an ABAP field using a FIELD-SYMBOL will not be taken into account.
The following index supports direct entry using the type of the initial value.
This description is valid for Oracle 8.0.4 and SAP Release 4.5A.
§ Float F
§ Date D
§ Time T
§ Varchar2
§ Float
(A) The following applies to the database column type number(x,y), including the case y < 0:
· Significant figures are those with values >= 10-y.
· Non-significant figures are those with values < 10-y.
Data value width: String length without trailing spaces
Database column type |
Case (notes) |
Result |
varchar2 (z) |
ABAP data value width > 4000 |
1461 |
ABAP field width (n) > database column width (z) ABAP data value width > database column width ABAP data value width <= database column width |
1401 ok |
|
ABAP field width (n) <= database column width (z) |
ok |
|
char (z) |
ABAP data value width > 4000 |
1461 |
ABAP field width (n) > database column width (z) ABAP data value width > database column width ABAP data value width >= database column width |
1401 ok |
|
ABAP field width (n) <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
ABAP data value is non-numeric |
1722 |
Loss of figures before decimal point in conversion |
1438 |
|
ABAP data value contains decimal places |
[round] |
|
ABAP data
value width <= database column width (z) |
ok / [round] |
|
number (z,y) |
ABAP data value is non-numeric |
1722 |
Loss of significant figures (see (A)). |
1438 |
|
Loss of non-significant figures (see (A)). |
||
ABAP data
value width <= database column width (z) |
ok / [round] |
|
float |
ABAP data value is non-numeric |
1722 |
ABAP data value not in interval ] -10126, 10126 |
1426 |
|
ABAP data
value in interval ] -10-130, 10-130 [ |
[0] |
|
ABAP data
value in interval ] -10126, 10126 [ |
ok / [0] / [round] |
|
date(9) |
ABAP data value has an invalid database date format |
1861 |
ABAP date value has a valid database date format [ 10-Jan-97 ] |
ok |
|
raw (z) |
ABAP data value width > 4000 |
1461 |
ABAP data
value has an invalid hexadecimal format |
1465 |
|
ABAP field width (n) > database column width (n>2z) ABAP data value width > database column width ABAP data
value width <= database column width |
1401 ok |
|
ABAP data
value width (n) <= database column width (n<=2z) |
ok |
|
long raw |
ABAP data value width > 4000 |
1461 |
ABAP data
value has an invalid hexadecimal format |
1465 |
|
ABAP data value width <= 4000 |
ok |
Data value width: Number of digits without leading zeros
Database column type |
Case (notes) |
Result |
varchar2 (z) |
Data value width > 4000 |
1461 |
ABAP field width (n) > database column width (z) |
1401 |
|
ABAP field width (n) <= database column width (z) |
ok |
|
char (z) |
Data value width > 4000 |
1461 |
ABAP field width (n) > database column width (z) |
1401 |
|
ABAP field width (n) <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
ABAP field width (n) > database column width (z) ABAP data value width > database column width ABAP data
value width <= database column width |
1438 ok / [ltrunc] |
ABAP field width (n) = database column width (z) ABAP data
value width <= database column width |
ok / [ltrunc] |
|
ABAP field width (n) < database column width (z) |
ok |
|
number
(x,y) |
Loss of significant figures (see (A)). |
1438 |
ABAP data
value width <= database column width (z) |
ok / [ltrunc] |
|
float |
ABAP data value >= 10126 |
1426 |
ABAP data
value < 10126 [ |
ok / [round] |
|
date |
|
1861 |
raw (z) |
ABAP field width (n) > database column width (n>2z) |
1401 |
ABAP data
value width (n) <= database column width (n<=2z) |
ok |
|
long raw |
Data value width > 4000 |
1461 |
Data value width <= 4000 |
ok |
m= bytes, d = decimal places
Data value width (n): Number of digits without leading zeros, n<=2m-1; n is increased by one for each of decimal point and minus sign.
Database column type |
Case (notes) |
Result |
varchar2 (z) |
ABAP data value width (n) < database column width (z) |
1401 |
ABAP data value width (n) <= database column width (z) |
ok |
|
char (z) |
ABAP data value width (n) < database column width (z) |
1401 |
ABAP data value width (n) <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
Loss of figures before decimal point in conversion |
1438 |
ABAP data value contains decimal places |
[round] |
|
ABAP data
value width (n) <= database column width (z) |
ok / [round] |
|
number
(x,y) |
Loss of significant figures (see (A)). |
1438 |
Loss of non-significant figures (see (A)). |
[round] |
|
ABAP data
value width <= database column width (z) |
ok / [round] |
|
float |
|
ok |
date |
|
932 |
raw |
|
932 |
long raw |
|
932 |
Data value width: Number of digits without leading zeros; n is increased by one if there is a minus sign.
Database column type |
Case (notes) |
Result |
varchar2 (z) |
ABAP data value width > database column width (z) |
1401 |
ABAP data value width <= database column width (z) |
ok |
|
char (z) |
ABAP data value width > database column width (z) |
1401 |
ABAP data value width <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
ABAP data
value width > Database column width (z) |
1438 |
ABAP data
value width <= Database column width (z) |
ok |
|
number
(x,y) |
Loss of significant figures (see (A)). |
1438 |
Loss of non-significant figures (see (A)). |
[round] |
|
ABAP data
value width <= database column width (z) |
ok / [round] |
|
float |
|
ok |
date |
|
932 |
raw |
|
932 |
long raw |
|
932 |
Inaccuracies can occur with any conversions involving floating point numbers.
Data value width: Number of digits without leading zeros; n is increased by one for each of decimal point and minus sign.
Database column type |
Case (notes) |
Result |
varchar2 (z) |
ABAP data value width > database column width (z) |
1401 |
ABAP data value width <= database column width (z) |
ok |
|
char (z) |
ABAP data value width > database column width (z) |
1401 |
ABAP data value width <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
ABAP data
value width > database column width (z) |
1438 |
ABAP data value contains decimal places |
[round] |
|
ABAP data
value width <= database column width (z) |
ok / [round] |
|
number
(x,y) |
Loss of significant figures (see (A)). |
1438 |
Loss of non-significant figures (see (A)). |
[round] |
|
ABAP data
value width <= database column width (z) |
ok / [round] |
|
float |
ABAP data value not in interval ] -10126, 10126 |
1426 |
ABAP data
value in interval ] -10-130, 10-130 [ |
[0] |
|
ABAP data value not in interval ] -10126, 10126 [ |
ok / [0] |
|
date |
|
932 |
raw |
|
932 |
long raw |
|
932 |
Data value width = 8 (fixed)
Database column type |
Case (notes) |
Result |
varchar2 (z) |
ABAP data value width (8) > database column width (z) |
1401 |
ABAP data value width (8) <= database column width (z) |
ok |
|
char (z) |
ABAP data value width (8) > database column width (z) |
1401 |
ABAP data value width (8) <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
ABAP data value is non-numeric |
1722 |
ABAP data value width (8) > database column width (z) |
1438 |
|
ABAP data value width (8) <= database column width (z) |
ok |
|
number
(x,y) |
ABAP data value is non-numeric |
1722 |
ABAP data value width (8) > database column width (z) |
1438 |
|
ABAP data value width (8) <= database column width (z) |
ok |
|
float |
ABAP data value is non-numeric |
1722 |
ABAP data value is numeric |
ok |
|
date |
|
1861 |
raw (z) |
ABAP data
value has an invalid hexadecimal format |
1465 |
ABAP data value width (8) > database column width (4>z) |
1401 |
|
ABAP data value width (8) <= database column width (4<=z) |
ok |
|
long raw |
ABAP data
value has an invalid hexadecimal format |
1465 |
ABAP data value has a valid hexadecimal format |
ok |
Data value width = 6 (fixed)
Database column type |
Case (notes) |
Result |
varchar2 (z) |
ABAP data value width (6) > database column width (z) |
1401 |
ABAP data value width (6) <= database column width (z) |
ok |
|
char (z) |
ABAP data value width (6) > database column width (z) |
1401 |
ABAP data value width (6) <= database column width (z) |
ok |
|
long |
|
ok |
number (z) |
ABAP data value is non-numeric |
1722 |
ABAP data value width (6) > database column width (z) |
1438 |
|
ABAP data value width (6) <= database column width (z) |
ok |
|
number
(x,y) |
ABAP data value is non-numeric |
1722 |
ABAP data value width (6) > database column width (z) |
1438 |
|
ABAP data value width (6) <= database column width (z) |
ok |
|
float |
ABAP data value is non-numeric |
1722 |
ABAP data value is numeric |
ok |
|
date |
|
1861 |
raw (z) |
ABAP data
value has an invalid database raw format |
1465 |
ABAP data value width (6) > database column width (3>z) |
1401 |
|
ABAP data value width (6) <= database column width (3<=z) |
ok |
|
long raw |
ABAP data
value has an invalid database raw format |
1465 |
ABAP data value has a valid hexadecimal format |
ok |
Data value width: Number of hexadecimal digits without trailing zeros
Database column type |
Case (notes) |
Result |
varchar2 (z) |
n > 4000 |
1461 |
ABAP field width (2n) > database column width (z), (2n > z) |
1401 |
|
ABAP field width 2n = 8000, database column width = 4000 |
[rtrunc ½] |
|
ABAP field width (2n) <= database column width (z), (2n <= z) |
ok |
|
char (z) |
ABAP field width (2n) > database column width (z), (2n > z) |
1401 |
ABAP field width (2n) <= database column width (z), (2n <= z) |
ok |
|
long |
n > 4000 |
1461 |
n <= 4000 |
[rtrunc ½] |
|
number (z) |
|
932 |
number (z,y) |
|
932 |
float |
|
932 |
date |
|
932 |
raw (z) |
n > 4000 |
1461 |
ABAP field width (n) > database column width (z), (n>z) |
1401 |
|
ABAP field width (n)<= database column width (z), (n<=z) |
ok |
|
long raw |
n > 4000 |
[rtrunc] |
n < 4000 |
ok |
(B) ABAP Data Types: Date, Time
Converting a database value into an ABAP date or time field is like converting it into an ABAP character field with length 8 or 6 respectively. It is technically possible to convert an invalid format, but this returns an ABAP field value with an invalid format, which you cannot usefully use. Conversions of this kind are indicated in the table with [ok].
Conversion of database data values to
· ABAP date format require the form: YYYYMMDD.
· ABAP time format require the form: HHMMSS.
(C) ABAP Data Type: Numeric Text
Conversions
into the ABAP type numeric text N(n) behave like conversions into an ABAP
character field C(n), that is, the field contents are left-justified and
filled with trailing spaces.
This is contrary to the numeric text definition, according to which a numeric
text field may only contain digits, and is filled with leading zeros. The
numeric text field may contain a string with an invalid numeric text format
following the conversion. Conversions of this kind are indicated in the table
with [ok].
(D) ABAP Data Type: Hexadecimal
If the data value width is less than the field width, a result string is transferred (if the data value contains an odd number of characters, a leading zero is added). The rest of the field length is not filled with trailing zeros, but with undefined values.
Data value width: String length (trailing spaces are not saved)
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database column width (z) > ABAP field width (n) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] ok |
Database column width (z) <= ABAP field width (n) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
|
Packed |
Database data value is non-numeric |
1722 |
Loss of figures before decimal point in conversion |
[null] |
|
Loss of decimal places in conversion |
[rtrunc] |
|
Database
data value width <= ABAP field width (n-d) |
ok / [rtrunc] |
|
Integer I |
Database data value is non-numeric |
1722 |
ABAP data value not in interval ] -231, 231 [ |
1455 |
|
Database data value contains decimal places |
[rtrunc] |
|
Database data value in interval ] -231, 231 [ |
ok / [rtrunc] |
|
Float F |
Database data value is non-numeric |
1722 |
Database
data value >= 10126 |
[undef] |
|
Database
data value <= -10126 |
[undef] |
|
Database
data value in interval ] -10-130, 10-130 [ |
[0] |
|
Truncation
in conversion |
[round] |
|
Database
data value in interval ] -10126, 10126 [ |
ok / [0] / [round] |
|
Date
D(8) |
Database column width (z) > ABAP field width (8) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (8) |
[ok] |
|
Time
T(6) |
Database column width (z) > ABAP field width (6) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (6) |
[ok] |
|
Hexadecimal
X(n) |
Database
data value has an invalid hexadecimal format |
1465 |
Database data value width (x) > ABAP field width, (x <= z, x > 2n) Database data value width (x) = ABAP field width, (x <= z, x = 2n) Database
data value width (x) < ABAP field width, (x <= z, x < 2n) |
[rtrunc] ok [undef] |
Data value width: String length (trailing spaces are not saved)
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database column width (z) > ABAP field width (n) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] ok |
Database column width (z) <= ABAP field width (n) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed |
Database data value is non-numeric |
1722 |
Loss of figures before decimal point in conversion |
[null] |
|
Loss of decimal places in conversion |
[rtrunc] |
|
Database
data value width <= ABAP field width (n-d) |
ok / [rtrunc] |
|
Integer I |
Database data value is non-numeric |
1722 |
ABAP data value not in interval ] -231, 231 [ |
1455 |
|
Database data value contains decimal places |
[rtrunc] |
|
Database data value in interval ] -231, 231 [ |
ok / [rtrunc] |
|
Float F |
Database data value is non-numeric |
1722 |
Database
data value >= 10126 |
[undef] |
|
Database
data value <= -10126 |
[undef] |
|
Database
data value in interval ] -10-130, 10-130 [ |
[0] |
|
Truncation
in conversion |
[round] |
|
Database
data value in interval ] -10126, 10126 [ |
ok / [0] / [round] |
|
Date
D(8) |
Database column width (z) > ABAP field width (8) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (8) |
[ok] |
|
Time
T(6) |
Database column width (z) > ABAP field width (6) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (6) |
[ok] |
|
Hexadecimal
X(n) |
Database
data value has an invalid hexadecimal format |
1465 |
Database column width (z) > ABAP field width (n), (z>2n) Database data value width (x) > ABAP field width, (x <= z, x > 2n) Database data value width (x) <= ABAP field width, (x <= z, x <= 2n) |
[rtrunc] 1465 |
|
Database column width (z) = ABAP field width(n), (z=2n) Database data value width (x) = ABAP field width, (x <= z, x = 2n) Database data value width (x) < ABAP field width, (x <= z, x < 2n) |
ok 1465 |
|
Database
column width (z) < ABAP field width (n), (z <= 2n) |
[undef] |
Data value width: String length (trailing spaces are not saved)
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width > ABAP field width |
[rtrunc] |
Database data value width <= ABAP field width |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed |
Data value is non-numeric |
1722 |
Loss of digits before the decimal point |
[null] |
|
Loss of digits after the decimal point |
[rtrunc] |
|
Database
data value width <= ABAP field width (n-d) |
ok / [rtrunc] |
|
Integer I |
|
[undef] |
Float F |
|
[undef] |
Date
D(8) |
Database data value width > ABAP field width (8) |
[rtrunc] |
Database data value width <= ABAP field width (8) |
[ok] |
|
Time
T(6) |
Database data value width > ABAP field width (6) |
[rtrunc] |
Database data value width <= ABAP field width (6) |
[ok] |
|
Hexadecimal
X(n) |
|
[undef] |
Data value width: Number of digits without leading zeros; n is increased by one if there is a minus sign.
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width > ABAP field width (n) |
[rtrunc] |
Database data value width <= ABAP field width (n) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed |
Loss of figures before decimal point in conversion |
[null] |
Database
data value width <= ABAP field width (n-d) |
ok |
|
Integer I |
ABAP data value not in interval ] -231, 231 [ |
1455 |
Database data value in interval ] -231, 231 [ |
ok |
|
Float F |
Truncation
in conversion |
[round] |
Database
data value Î ]
-10126, 10126 [ |
ok / [round] |
|
Date
D(8) |
Database column width (z) > ABAP field width (8) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (8) |
[ok] |
|
Time
T(6) |
Database column width (z) > ABAP field width (6) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (6) |
[ok] |
|
Hexadecimal
X(n) |
|
932 |
Data value width: Number of digits (z) without leading zeros; data value width is increased by one for each of decimal point and minus sign.
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width > ABAP field width (n) |
[rtrunc] |
Database data value width <= ABAP field width (n) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed |
Loss of significant figures (see (A)). |
[null] |
Loss of non-significant figures (see (A)). |
[rtrunc] |
|
Database
data value width <= ABAP field width (n-d) |
ok / [rtrunc] |
|
Integer I |
ABAP data value not in interval ] -231, 231 [ |
1455 |
Database data value contains decimal places |
[rtrunc] |
|
Database data value in interval ] -231, 231 [ |
ok / [rtrunc] |
|
Float F |
Truncation
in conversion |
[round] |
Database
data value in interval ] -10126, 10126 [ |
ok / [round] |
|
Date
D(8) |
Database column width (z) > ABAP field width (8), (z>=8) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (8), (z<8) |
[ok] |
|
Time
T(6) |
Database column width (z) > ABAP field width (6), (z>=6) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (6), (z<6) |
[ok] |
|
Hexadecimal
X(n) |
|
932 |
Data value width: Number of digits without leading zeros; n is increased by one for each of decimal point and minus sign.
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width > ABAP field width (n) |
[rtrunc] |
Database data value width <= ABAP field width (n) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed |
Loss of figures before decimal point in conversion |
[null] |
Loss of decimal places in conversion |
[rtrunc] |
|
Database
data value width <= ABAP field width (n-d) |
ok / [rtrunc] |
|
Integer I |
ABAP data value not in interval ] -231, 231 [ |
1455 |
Database data value contains decimal places |
[rtrunc] |
|
Database data value in interval ] -231, 231 [ |
ok / [rtrunc] |
|
Float F |
Truncation
in conversion |
[round] |
Database
data value in interval ] -10126, 10126 [ |
ok / [round] |
|
Date
D(8) |
Database data value width > ABAP field width (8) |
[rtrunc] |
Database data value width <= ABAP field width (8) |
[ok] |
|
Time
T(6) |
Database data value width > ABAP field width (6) |
[rtrunc] |
Database data value width <= ABAP field width (6) |
[ok] |
|
Hexadecimal
X(n) |
|
932 |
Data value width = 9 (fixed)
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width (9) > ABAP field width (n), (n<9) |
[rtrunc] |
Database data value width (9) <= ABAP field width (n), (n>=9) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed P |
|
932 |
Integer I |
|
932 |
Float F |
|
932 |
Date
D(8) |
|
ok / [rtrunc] |
Time
T(6) |
|
ok / [rtrunc] |
Hexadecimal
X(n) |
|
932 |
Column width: z = 2x
Data value width: Number of hexadecimal digits without trailing zeros
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database column width (z) > ABAP field width (n), (z>n) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] ok |
Database column width (z) <= ABAP field width (n), (z<=n) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed P |
|
932 |
Integer I |
|
932 |
Float F |
|
932 |
Date
D(8) |
Database column width (z) > ABAP field width (8), (z>8) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (8), (z<=8) |
[ok] |
|
Time
T(6) |
Database column width (z) > ABAP field width (6), (z<6) Database data value width > ABAP field width Database data value width <= ABAP field width |
[rtrunc] [ok] |
Database column width (z) <= ABAP field width (6), (z<=6) |
[ok] |
|
Hexadecimal
X(n) |
Database data value width > ABAP field width Database data value width = ABAP field width Database
column width < ABAP field width |
[rtrunc] ok [undef] |
Data value width: Number of hexadecimal digits without trailing zeros
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width <= ABAP field width |
ok |
Database data value width > ABAP field width |
[rtrunc] |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
[ok] |
Packed P |
|
932 |
Integer I |
|
932 |
Float F |
|
932 |
Date
D(8) |
Database data value width > ABAP field width (8) |
|
Database data value width <= ABAP field width (8) |
[ok] |
|
Time
T(6) |
Database data value width > ABAP field width (6) |
[rtrunc] |
Database data value width <= ABAP field width (6) |
[ok] |
|
Hexadecimal
X(n) |
Database data value width > ABAP field width (2n) |
[rtrunc] |
Database data value width = ABAP field width (2n) |
ok |
|
Database
column width < ABAP field width (2n) |
[undef] |
Data value width = 18 (fixed)
ABAP Data type |
Case (notes) |
Result |
Character C(n) |
Database data value width (18) > ABAP field width (n), (18 > 9) |
[rtrunc] |
Database data value width (18) <= ABAP field width (n), (18 <= 9) |
ok |
|
Numeric text (N(n), (see(C)) |
[ Conversion as for character fields |
|
Packed P |
|
932 |
Integer I |
|
932 |
Float F |
|
932 |
Date
D(8) |
|
[undef] |
Time
T(6) |
|
[undef] |
Hexadecimal
X(n) |
|
932 |