Detail block display only first record [message #306896] |
Mon, 17 March 2008 03:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
aorlunla
Messages: 20 Registered: March 2008
|
Junior Member |
|
|
I have form which includes Master-Detail block(Item=master,Item's components=Detail)
User can find Item by click 'Find' Button and choose one of them from LOV.
What should I do if i want to show every record in Detail block
it always display only first record returned.
coding in when-button-pressed is
go_item('MTL_ITEMS.INVENTORY_ITEM_ID');
list_values;
declare
cursor c1 is
select bcv.line_number,
bcv.fab_code,
bcv.fab_desc,
bcv.status
from bpc_fab_data bcv
where bcv.item_id = :MTL_ITEMS.INVENTORY_ITEM_ID
order by bcv.item_id;
v_line_number number;
v_fab_code varchar2(20);
v_fab_desc varchar2(200);
v_status varchar2(1);
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO v_line_number,v_fab_code,v_fab_desc,v_status;
EXIT WHEN c1%NOTFOUND;
:BPC_FAB_DATA.line_number := v_line_number;
:BPC_FAB_DATA.fab_code := v_fab_code;
:BPC_FAB_DATA.fab_desc := v_fab_desc;
:BPC_FAB_DATA.status := v_status;
END LOOP;
CLOSE c1;
END;
refer to http://forums.oracle.com/forums/thread.jspa?threadID=622460&tstart=0&messageID=2366947
I've tried this one but it still display only first record
Please help me, Thank you so much.
|
|
|
|
|
|
Re: Detail block display only first record [message #307123 is a reply to message #306896] |
Mon, 17 March 2008 21:06 ![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) |
aorlunla
Messages: 20 Registered: March 2008
|
Junior Member |
|
|
If there's NEXT_RECORD in the loop, SECOND record will display and then
error message : FRM-41106 You cannot create records without parent record and the second error message is FRM-40102: Record must be entered or deleted first.
Littlefoot thank you so much.
I'm very newbie for programmer and not so good in English but please help me.
[Updated on: Mon, 17 March 2008 21:23] Report message to a moderator
|
|
|
|
Re: Detail block display only first record [message #307285 is a reply to message #306896] |
Tue, 18 March 2008 05:53 ![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) |
aorlunla
Messages: 20 Registered: March 2008
|
Junior Member |
|
|
I've change my coding to
declare
cursor c1 is
select bcv.line_number,
bcv.fab_code,
bcv.fab_desc,
bcv.status
from bpc_fab_data bcv
where bcv.item_id = :MTL_ITEMS.INVENTORY_ITEM_ID
order by bcv.line_number;
BEGIN
OPEN c1;
GO_BLOCK('BPC_FAB_DATA');
FIRST_RECORD;
LOOP
FETCH c1 INTO
:BPC_FAB_DATA.line_number ,
:BPC_FAB_DATA.fab_code ,
:BPC_FAB_DATA.fab_desc ,
:BPC_FAB_DATA.status ;
EXIT WHEN c1%NOTFOUND;
NEXT_RECORD;
END LOOP;
CLOSE c1;
END;
this coding will display all records
Thank you so much to Littlefoot and everybody
|
|
|
|
|