SQL Error: ORA-12899: value too large for column

匿名 (未验证) 提交于 2019-12-03 00:52:01

问题:

I have created the following table

CREATE TABLE Customers(   CustomerID varchar2(9) PRIMARY KEY,    Customer_Contact varchar2(40) NOT NULL,    Address varchar2(20) NOT NULL,   Post_Code varchar2(7) NOT NULL,    Telephone_Number varchar2(11) NOT NULL) 

And I am currently trying to use the INSERT VALUES statement. I have written the following statement

INSERT INTO Customers VALUES(   501623129,    'John Petterson',    '-- Singleton Close London',    '--- ---', 02082860222) 

When I try to run the statement it gives me the following error message.

Error starting at line 4 in command: INSERT INTO Customers VALUES(501623129, 'David Patterson', '30 Singleton Close London', 'SW17 9JY', 02082860642) Error report: SQL Error: ORA-12899: value too large for column "DJ"."CUSTOMERS"."ADDRESS" (actual: 25, maximum: 20) 12899. 00000 - "value too large for column %s (actual: %s, maximum: %s)"

回答1:

ORA-12899: value too large for column "DJ"."CUSTOMERS"."ADDRESS" (actual: 25, maximum: 2 

Tells you what the error is. Address can hold maximum of 20 characters, you are passing 25 characters.



回答2:

Here is an example:

CREATE TABLE Customers(CustomerID  VARCHAR2(9 BYTE), ... 

or

CREATE TABLE Customers(CustomerID  VARCHAR2(9 CHAR), ... 


回答3:

This answer still comes up high in the list for ORA-12899 and lot of non helpful comments above, even if they are old. The most helpful comment was #4 for any professional trying to find out why they are getting this when loading data.

Some characters are more than 1 byte in length, especially true on SQL Server. And what might fit in a varchar(20) in SQLServer won't fit into a similar varchar2(20) in Oracle.

I ran across this error yesterday with SSIS loading an Oracle database with the Attunity drivers and thought I would save folks some time.



回答4:

example : 1 and 2 table is available

1 table delete entry and select nor 2 table records and insert to no 1 table . when delete time no 1 table dont have second table records example emp id not available means this errors appeared



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!