loop insert empty row ?? [message #463790] |
Sat, 03 July 2010 09:19 |
ahmed_samir
Messages: 61 Registered: January 2009 Location: EGYPT
|
Member |
|
|
hi there this is my insert loop but the problem is there is row added more than the normal count ..
DECLARE
var_record_count NUMBER;
var_p_request NUMBER;
var_items_count NUMBER;
BEGIN
var_record_count := GET_BLOCK_PROPERTY ('control', current_record); -- supplier
var_items_count := GET_BLOCK_PROPERTY ('PURCH_ITEMS_PRICE', current_record); -- items in
--go_block('PURCH_PRICE_REQUEST'); 5463194 512 tedata + nada
--first_record;
--GO_BLOCK ('PURCH_ITEMS_PRICE');
--FIRST_RECORD;
----------------------------------- loop in side loop ------------------------------------
---- note am delet the relation ( . _ . ) *********************************************
GO_BLOCK ('control');
FIRST_RECORD;
-- loop depend on the supplier count
FOR supp_loop IN 1 .. var_record_count
LOOP
SELECT seq_fahs_id.NEXTVAL
INTO :GLOBAL.var_p_request
FROM DUAL;
INSERT INTO PURCH_PRICE_REQUEST (
P_REQUEST_ID, P_REQUEST_DATE, P_REQUEST_SIGN_PURCH, SUPP_ID)
VALUES (:GLOBAL.var_p_request ,null ,null ,:control.TXT_SUPP );
-- commit_form;
--------------- loop depend on the items in the for the supplier
GO_BLOCK ('PURCH_ITEMS_PRICE');
FIRST_RECORD;
for item_loop in 1 .. var_items_count
loop
INSERT INTO PURCH_ITEMS_PRICE (
ITEM_ID, P_REQUEST_ID, ITEM_PRICE, NOTES)
VALUES ( :item_id,:GLOBAL.var_p_request ,null ,null );
-- commit_form;
NEXT_RECORD;
end loop;
GO_BLOCK ('control');
NEXT_RECORD;
END LOOP;
commit_form;
END;
thanks
|
|
|
|
Re: loop insert empty row ?? [message #465223 is a reply to message #465207] |
Tue, 13 July 2010 04:07 |
ahmed_samir
Messages: 61 Registered: January 2009 Location: EGYPT
|
Member |
|
|
yes that's right but when i try this .. more error happen to me .. coz there is relation between the two block must be deleted to work depend on the oracle inserting but if i use the insert statement it's the data worked well ..
sorry 4 my English language but hope to understand what i want to say ..
thanks
|
|
|
|
|