Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Define BINARY DATA column (DB2 to Oracle migration)

user15004Aug 31 2006 — edited Sep 1 2006
Have a table where a column is defined as 'FOR BIT DATA'. This specifies that the contents of the column are to be treated as bit (binary) data. During data exchange with other systems, code page conversions are not performed. Comparisons are done in binary, irrespective of the database collating sequence.

During conversion to Oracle using Oracle Migration Workbench, this table is converted irrespective of this definition. Please see below for details:
DB2 table definition:
CREATE TABLE ADMIN.XENCY (
ID INTEGER NOT NULL ,
XENCYSYMBOL CHAR(2) FOR BIT DATA NOT NULL ,
IN TS_XENCY ;

Oracle table definition as generated by OMWB:

CREATE TABLE ADMIN.XENCY
( ID NUMBER(10,0) NOT NULL ENABLE,
XENCYSYMBOL CHAR(2) NOT NULL ENABLE,
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE TS_XENCY;

During data loading from DB2 to Oracle it fails for this table with the following error:
Type: Error
Time: 14-08-2006 18:21:02
Phase: Migrating
Message: Unable to migrate data from source table ADMIN.XENCY to destination table ADMIN.XENCY : ADMIN.XENCY; ORA-12899: value too large for column "ADMIN"."XENCY"."XENCYSYMBOL" (actual: 4, maximum: 2)

For Oracle the length of the data in this column is 4; however for DB2 it is 2 only as shown below:

$ db2 "select max(length(Xencysymbol)) from admin.Xency with ur"

1
-----------
2

1 record(s) selected.

$

The distinct contents of this table is as follows:

$ db2 "select distinct Xencysymbol from admin.Xency with ur"

XENCYSYMBOL
-------------------------------
x'0024'
x'2020'

2 record(s) selected.

$

How do I define a column as containing binary data in Oracle?


Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2006
Added on Aug 31 2006
2 comments
2,264 views