0

While migrating a SQL Server database to Oracle, I end up with an error

ORA-12899: value too large for column

though the datatypes are the same.

This is happening with strings like 'enthält'. The data type NVARCHAR(7) should be able to hold the given string in SQL Server where as on Oracle VARCHAR2(7) not able to hold the value and throwing value too large error.

Is this something with the encoding style on Oracle? How can we resolve this?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
subash
  • 69
  • 2
  • 5
  • 1
    What character set are you using, what is the DDL for your table, and what is the value of the `NLS_LENGTH_SEMANTICS` parameter? Could be that the column length in Oracle is being evaluated as bytes instead of characters. – pmdba Jan 25 '22 at 03:48
  • 1
    The character set is UTF8, the NLS_LENGTH_SEMANTICS is Byte. Yes, the column length on oracle is set to bytes instead of characters. – subash Jan 25 '22 at 04:50

1 Answers1

0

You can create your Oracle table with something like varchar2(7 char) this causes it to allocate in units of characters, not bytes. This succeeds:

create table tbl(x varchar2(7 char));
insert into tbl values ('enthält');
tinazmu
  • 3,880
  • 2
  • 7
  • 20