Why am I getting a precision error?
INSERT INTO ISBN_LIST (ISBN) VALUES (9780261102354);
Given the table:
CREATE TABLE ISBN_LIST (
ISBN NUMBER (20,20) NOT NULL -- NUMBER(13) also didn't work
);
ALTER TABLE ISBN_LIST
ADD CONSTRAINT PK_ISBN_LIST PRIMARY KEY ( ISBN );
[bonus points if you recognise the ISBN!]
The reason why you’re getting a precision error for number(20, 20) is because you are creating a number with precision 20 and scale 20, which means numbers:
between 0.00000000000000000000 and 0.99999999999999999999.
According to this sqlfiddle,
number(13)works (maybe you need to specifynumber(13, 0)to ensure the right scale, though I would agree with @xavier that avarchar2(13 char)is probably a better choice of datatype.