Danelle PoeticSoul Hankins Danelle PoeticSoul Hankins - 6 months ago 26
SQL Question

ora-12899 error in sql

I have created a table

SQL> DESC Customers


Name Null? Type
----------------------------------------- -------- ----------------------------
ACCT_ID NOT NULL VARCHAR2(10)
NAME NOT NULL VARCHAR2(30)
ZIP_CODE CHAR(5)


I tried to insert a line into the table

INSERT INTO customers (acct_id, name, zip_code)
VALUES ('1234567890', '(Danelle)', '(20743)');


I get this error and i cant seem to fix it.


ERROR at line 2:
ORA-12899: value too large for column "CM420E08"."CUSTOMERS"."ZIP_CODE"
(actual: 7, maximum: 5)


I am only entering 5 digits but its saying i am entering 7. any ideas?

Answer

You are entering 7 characters-- your name and zip_code strings appear to have a "(" as the first character and a ")" as the second character. You probably want

INSERT INTO customers (acct_id, name, zip_code)
VALUES ('1234567890', 'Danelle', '20743');