Home » Developer & Programmer » Forms » post data in detail table from other table (developer 6 or 6i, 9i)
post data in detail table from other table [message #431232] Mon, 16 November 2009 04:32 Go to next message
shahzad-ul-hasan
Messages: 464
Registered: August 2002
Senior Member
pls find the attached file.and give me help how i can do this.
  • Attachment: form.JPG
    (Size: 98.08KB, Downloaded 122 times)
Re: post data in detail table from other table [message #431314 is a reply to message #431232] Mon, 16 November 2009 13:15 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is either INSERT or UPDATE; as these values are to be put into first several form items, it might really be an update (if other record values already exist). In that case, you'll need to create a WHERE clause so that only desired records are getting updated.

However, as there's the "s_no" item which looks like a candidate for a primary key column, maybe it is an insert. I can't decide which one it is, really.
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 messageGo to next message
shahzad-ul-hasan
Messages: 464
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
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;
Previous Topic: Finding location of directory on c:\ drive
Next Topic: Form Personalization using custom.pll - LOV to be deleted from the existing record group.
Goto Forum:
  


Current Time: Sun Dec 04 02:56:09 CST 2016

Total time taken to generate the page: 0.09964 seconds