Solution of Batch entry 0 insert into postgresql database table, Call getNextException to see the cause|| Learn How to solve this exception or error ||Java PostgreSQL Database Exception.
March 16, 2011 2 Comments
Have you ever faced this exception while executing sql query in your software or database?? Well, I am using Java programming language in the front end and PostGreSQL in the backend i.e. server side. Recently I have faced the following exception which was showing actually from the database. I searched internet for the solution but didn’t get any reliable solution. But at last I have solved it and sharing the solution procedure with you. Hope it will also work with your problem
Here is the problem (Exception)
Batch entry 0 insert into endproduct_mat_req(item_no,end_product_mat_no,mat_no,qty) values(523,71,44,100000.0) was aborted. Call getNextException to see the cause
Here Is the Database (PostGreSQL) Table which I am using in our ERP software
While Checking the log (output from System.out.println() function) What I have found, the following data was inserting in my table.
Here, What I have noticed, when Big Decimal value is going to six digits ( means, 1 lakh ) it is throwing this exception, this big decimal value was saving in the qty field of endproduct_mat_req table.
I have got one solution, the qty field in endproduct_mat_req table was numeric(15,5). To solve this exception I just increased the size of the qty field as below
After changing the size of qty field the exception gone.