N
N
Nikolay Baranenko2017-05-08 18:13:17
Oracle
Nikolay Baranenko, 2017-05-08 18:13:17

Why was some of the data not migrated during migration, because not the size of the fields turned out to be small?

Hello.
Today I needed to migrate schema objects to another Oracle instance.
I took advantage of the capabilities of Oracle SQL Developer.
How surprised I was by the fact that it was not possible to execute Insert on one table. Oracle returned an error that the size of the field in the table is less than the size of the data in the Insert.
Table

create table EMPLOYEE
(
  id_employee VARCHAR2(100) not null,
  position    VARCHAR2(20),
  direction   VARCHAR2(20),
  date_from   DATE,
  date_to     DATE,
  region_id   NUMBER
)

The field was of type varchar2(20), data size in Insert 35.
Insert into EMPLOYEE (ID_EMPLOYEE,POSITION,DIRECTION,DATE_FROM,DATE_TO,REGION_ID) values ('вававав вавававава.123456789','вававав вавававава','aaaaaaaaaaaa',to_date('01.01.11','DD.MM.RR'),null,'01');

Tell me how is this possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Y, 2017-05-12
@drno-reg

For example, you have moved from a database with a one-byte encoding to another - with UTF8.
Compare the output of queries on different databases:

select name, value$ from sys.props$ where name = 'NLS_CHARACTERSET';

select 
    length('ффф') as in_char,
    lengthb('ффф') as in_byte
from dual;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question