-1
   Create TABLE Customer(
   id number NOT NULL,
   Name varchar(200) NOT NULL,
   Address varchar(200) NOT NULL,
   Salary number(10,2) NOT NULL,
   CONSTRAINT Customer_pk PRIMARY KEY (id)
    );



     INSERT INTO Customer (id,Name, Address, Salary)
     VALUES (2, 'Tom B. Erichsen', 'Skagen 21', 30000.00);

getting an error ORA-01438: value larger than specified precision when trying to insert values into created table

MT0
  • 143,790
  • 11
  • 59
  • 117
high tech
  • 7
  • 5

1 Answers1

-1

Try replacing varchar with varchar2.

The other suggestion I have is putting a limit on id number.
Examples being:

Address varchar2(200) NOT NULL,
id number (5) NOT NULL

Unfortunately, as my reputation is too low, where does the application you are using actually pinpoint the error is occurring? That would help you narrow it down.

Ragxion
  • 113
  • 10
  • 1
    [`VARCHAR` is currently a synonym for `VARCHAR2`](https://stackoverflow.com/a/1171200/1509264) so changing one for the other will make zero difference. [`NUMBER`](http://docs.oracle.com/cd/B19306_01/server.102/b14220/datatype.htm#sthref3810) has 38 digits of precision - restricting it to `NUMBER(5)`, a lower precision, will not help the OP who has the problem `value larger than specified precision`. – MT0 Jun 23 '17 at 22:03