Home » Developer & Programmer » Forms » insert more than one row
insert more than one row [message #110701] Wed, 09 March 2005 13:55 Go to next message
Khaled Ba Abdullah
Messages: 16
Registered: October 2003
Junior Member
Hi All
How can insert more than one row in table from forms same time?

Thanks
Re: insert more than one row [message #110910 is a reply to message #110701] Fri, 11 March 2005 00:24 Go to previous messageGo to next message
hblatha
Messages: 4
Registered: March 2005
Junior Member
After entering 1st record don't press SAVE button instead go for the next record(by clicking menu record=>next OR pressing down arrow button)
Now enter the second record.In the same way u can enter 3rd,4th...record.At the end press SAVE button.All the records would be inserted into the database.

Therefore more than one record is inserted at one time
Re: insert more than one row [message #110939 is a reply to message #110701] Fri, 11 March 2005 04:25 Go to previous messageGo to next message
fanni
Messages: 96
Registered: March 2004
Member
your statement is not clear as much , i have perceived that you want to populate the control block by quering data from DB.

cursors are used to insert more than one record in a control block.

declare
cursor c1 is select id,name from emp;
curr_row c1%rowtype;
begin
go_block('control_blk');
first_record;

for curr_row in c1 loop
control_blk.id := curr_row.id;
control_blk.name := curr_row.name;
next_record;
end loop;

end;
Re: insert more than one row [message #111017 is a reply to message #110939] Sat, 12 March 2005 02:46 Go to previous messageGo to next message
Khaled Ba Abdullah
Messages: 16
Registered: October 2003
Junior Member
Thank for all
I will explain my question
I have table name invoice_datails

Invoice_no item_no quantity item_price
104060 1010 1 10
104060 1020 1 30
104060 1010 1 10
104060 1010 1 10
104060 1030 1 20
104060 1040 1 50
104060 1030 1 20
104060 1040 1 50

After insert these records in invoice table I want to insert these records in another table like this
Table name ITEM_CARD

Invoice_no item_no quantity item_price
104060 1010 3 10
104060 1020 1 30
104060 1030 2 20
104060 1040 2 50

Count the quantity for each item.

For each invoice inserted I want to insert to item_card table same time.

Thanks







Re: insert more than one row [message #111024 is a reply to message #111017] Sat, 12 March 2005 03:56 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Use a DB trigger. Whenever you commit in Forms, the rows are inserted on the database, the trigger fires and the data is copied to your second table.

[EDIT]This is not a Forms-specific subject.

MHE

[Updated on: Sat, 12 March 2005 03:59]

Report message to a moderator

Re: insert more than one row [message #111025 is a reply to message #111017] Sat, 12 March 2005 04:06 Go to previous message
fanni
Messages: 96
Registered: March 2004
Member
use a db trigger for this purpose;

if (inserting) then
insert into ITEM_CARD
select Invoice_no,item_no,sum(quantity),item_price
group by item_no;
end if;
Previous Topic: Get_file_name
Next Topic: newbeee question
Goto Forum:
  


Current Time: Thu Sep 19 16:15:48 CDT 2024