Solved

precision too large error

Posted on 2008-10-07
7
583 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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 information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

726 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