CURSOR PROBLEM [message #133753] |
Mon, 22 August 2005 02:06 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
samit_gandhi
Messages: 226 Registered: July 2005 Location: Hong Kong
|
Senior Member |
![samit_gandhi](/forum/theme/orafaq/images/yahoo.png)
|
|
Dear
I have put following cursor in the program to get the records from the other table. This records are only for to display on the screen. I dont want to store it. But i am only getting a single record on the screen. I want all the records from the database.
declare
depcnt number;
cursor c1 IS SELECT stone_code,used_carat,used_diamond,size_of
FROM diamond_return_detail
WHERE design_no=:electro_polishing_return.design_no and counter=:electro_polishing_return.counter;
begin
select count(*)
into depcnt
from diamond_return_detail
WHERE design_no=:electro_polishing_return.design_no and counter=:electro_polishing_return.counter;
IF depcnt > 0 then
OPEN c1;
FIRST_RECORD;
LOOP
FETCH c1 into :stone_return.STONE_CODE,
:stone_return.USED_CARAT,
:stone_return.USED_DIAMOND,
:stone_return.SIZE_OF;
EXIT WHEN c1%NOTFOUND;
END LOOP;
END IF;
CLOSE c1;
end;
Please advise.
Samit Gandhi
|
|
|
|
|
Re: CURSOR PROBLEM [message #133761 is a reply to message #133753] |
Mon, 22 August 2005 02:30 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kiran
Messages: 503 Registered: July 2000
|
Senior Member |
|
|
Your question says that you just want to display the total records , now why are you trying to save the record.
--Kiran.
|
|
|
|
Re: CURSOR PROBLEM [message #133934 is a reply to message #133763] |
Mon, 22 August 2005 17:18 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I don't agree with your design but that is probably because I don't understand your objective or the data structure from which you are starting. That having been said, your loop is not going to the next record. Try issuing a 'down' or 'create_record' for your subsequent rows.
David
[Updated on: Mon, 22 August 2005 18:07] Report message to a moderator
|
|
|
|