Solved

precision too large error

Posted on 2008-10-07
7
580 Views
Last Modified: 2013-12-07
dear all,
This is my code and its showing numeric or value error : number precision too large  at line 18 , I cant find any mistake.
declare
cust_id_var ph2_item.customer_id% TYPE :=0;
ship_date_var ph2_item.ship_date% TYPE :=to_date('01-jan-90','dd-mon-yy') ;
item_id_var ph2_item.item_id% TYPE;
new_item_id ph2_item.item_id% TYPE;
new_ord_id ph2_item.order_id% TYPE;
cursor consolidation_cursor is
select n.no_of_sites ,p.customer_id,p.order_id, p.item_id, p.order_date, p.ship_date FROM ph2_item p, no_of_sites n ORDER BY p.order_date, p.customer_id, p.ship_date, p.order_id, p.item_id for UPDATE OF p.order_id, p.item_id;
begin
for con_cursor in consolidation_cursor loop
if ( con_cursor.customer_id = cust_id_var AND
con_cursor.ship_date=ship_date_var AND
con_cursor.no_of_sites>1 )
or
(con_cursor.item_id > item_id_var)  THEN
new_item_id := new_item_id + 1;
else
select new_order_id.nextval into new_ord_id from dual;
new_item_id:=1;
end if;

cust_id_var := con_cursor.customer_id;
ship_date_var :=  con_cursor.ship_date;
item_id_var:= con_cursor.item_id;

update ph2_item
SET item_id = new_item_id,
order_id = new_ord_id
WHERE CURRENT OF consolidation_cursor;
end LOOP;

end;
/

Many thanks
0
Comment
Question by:anju_a_sagar
  • 4
  • 3
7 Comments
 
LVL 15

Accepted Solution

by:
Shaju Kumbalath earned 500 total points
ID: 22657462
select new_order_id.nextval from dual;
CHECK THE OUTPUT OF ABOVE QUERY  , IT SHOULD NOT BE GREATER THAN COLUMN LENGTH ORDER_ID;
 
0
 

Author Comment

by:anju_a_sagar
ID: 22657487
its 10025, yes it is greater
but i created a seq like this
CREATE  SEQUENCE
             new_order_id
           START WITH 622 INCREMENT BY 1;
 Why it is returning this number    
0
 

Author Comment

by:anju_a_sagar
ID: 22657492
how can i get a value from sequence in PL/Sql?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 15

Expert Comment

by:Shaju Kumbalath
ID: 22657514
u have done that many selection on that sequence;
 
0
 
LVL 15

Expert Comment

by:Shaju Kumbalath
ID: 22657530
sequence value  increases  by 1 each time the loop executes. check how many rows are returned by ur cursor
0
 

Author Comment

by:anju_a_sagar
ID: 22657555
155493
0
 

Author Closing Comment

by:anju_a_sagar
ID: 31503742
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
oracle report printing 2 pages in one page 2 58
compre toata in where clue oracle 4 56
query returning everything 11 87
Oracle Subquery bad Join 11 59
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now