|
|
Re: post data in detail table from other table [message #431388 is a reply to message #431232] |
Tue, 17 November 2009 03:56 ![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) |
shahzad-ul-hasan
Messages: 643 Registered: August 2002
|
Senior Member |
|
|
i have tried this trigger.it is working but it will show me the last(suppose i have 4 records. it will show me the last one.)
When New Block Instance.
DECLARE
v_id number(5); --s_no%TYPE;
v_art varchar2(100); --itm_name%TYPE;
v_sml number(5); --%TYPE;
v_xl number(5); --xl%TYPE;
v_xxl number(5); --xxl%TYPE;
CURSOR c_item IS
SELECT *
FROM item
ORDER BY S_NO;
BEGIN
OPEN c_item;
LOOP
FETCH c_item
INTO v_id, v_art, v_sml,
v_xl,v_xxl;
:inv1.s_no := v_id; :inv1.art := v_art; :inv1.smlrate := v_sml;
:inv1.xlrate :=v_xl;
:inv1.xxlrate :=v_xxl;
EXIT WHEN c_item%NOTFOUND;
END LOOP;
CLOSE c_item;
END;
|
|
|
Re: post data in detail table from other table [message #431396 is a reply to message #431388] |
Tue, 17 November 2009 04:06 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
manob
Messages: 7 Registered: November 2009 Location: Kolkata, India
|
Junior Member |
|
|
YOU WROTE
OPEN c_item;
LOOP
FETCH c_item
INTO v_id, v_art, v_sml,
v_xl,v_xxl;
:inv1.s_no := v_id; :inv1.art := v_art; :inv1.smlrate := v_sml;
:inv1.xlrate :=v_xl;
:inv1.xxlrate :=v_xxl;
EXIT WHEN c_item%NOTFOUND;
END LOOP;
CLOSE c_item;
ADD BOLD LINE
OPEN c_item;
FIRST_RECORD;
LOOP
FETCH c_item
INTO v_id, v_art, v_sml,
v_xl,v_xxl;
:inv1.s_no := v_id; :inv1.art := v_art; :inv1.smlrate := v_sml;
:inv1.xlrate :=v_xl;
:inv1.xxlrate :=v_xxl;
EXIT WHEN c_item%NOTFOUND;
NEXT_RECORD;
END LOOP;
CLOSE c_item;
FIRST_RECORD;
|
|
|