Unable to insert checbox checked records [message #508613] |
Mon, 23 May 2011 07:49 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/cc4fd969631b2042f08fd4c6cda3318f?s=64&d=mm&r=g) |
oracle_qns
Messages: 9 Registered: May 2011
|
Junior Member |
|
|
Hi,
i have a multi-record block with a check box(:B_ASTHEAD.CB_CHECK) for each record.
user can select the record by clicking on the check box.
when checked, value is 'Y' and when unchecked, value is 'N'.
when user clicks on 'OK' button (when button pressed trigger), the records which are
selected(Checkbox) must be posted to the database table.
L_last_Rec number;
L_first_Rec number;
L_AST COP_DETL.AST%TYPE;
BEGIN
Go_Block('B_ASTHEAD');
Last_Record;
L_last_Rec:= :system.trigger_Record;
First_Record;
L_first_Rec:= :system.trigger_Record;
For i in L_first_Rec..L_last_Rec-1 Loop
if :B_ASTHEAD.CB_CHECK = 'Y' then
--insert into asn_invoiced (asn,item,invoice_ind) values (:ASN_SELECT.ASN,:ASN_SELECT.ITEM,'Y');
insert into ast_temp values (:B_ASTHEAD.AST);
end if;
Next_Record;
End Loop;
commit;
message('complete');
END;
The issue here is , check box selected records are not getting inserted
into table when OK button is clicked and i could see that all
checked checkboxes become unchecked immediately
. But if i comment the
--"if :B_ASTHEAD.CB_CHECK = 'Y' then "
part, then insert works , but inserts all record.
Can anybody guide me to insert only checkbox selected records.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Unable to insert checbox checked records [message #508643 is a reply to message #508637] |
Mon, 23 May 2011 09:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
So?
If it's a database datablock then a commit will cause it to issue an insert_record command. This is in addition to any insert statement you code.
If you want it to only insert on the insert statment then it shouldn't be a database datablock.
|
|
|