Fetching the records [message #134256] |
Wed, 24 August 2005 01:58 |
samit_gandhi
Messages: 226 Registered: July 2005 Location: Hong Kong
|
Senior Member |
|
|
Dear Sir,
I have two blocks. One is database block and other is non database block. I want to show the record of the table in a non database block. I have written the cursor like this but it is fetching a last record only. I want all the records which satisfy the sql query. The cursor for that is like this :
DECLARE
depcnt number;
cursor c1 IS SELECT stone_code,used_carat,used_diamond,size_of
FROM diamond_return_detail
WHERE design_no=:electro_PLATING_return.design_no and counter=:electro_PLATING_return.counter;
BEGIN
select count(*)
into depcnt
from diamond_return_detail
WHERE design_no=:electro_PLATING_return.design_no and counter=:electro_PLATING_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;
What i have to do please advise. it is urgent pls help.
samit gandhi
|
|
|
|
|
|
|