Insert row data into table when checkbox selected
725345May 21 2010 — edited May 21 2010Hi
I have created this problem on a new post after posting it initially on a Correct thread.
Data is inserted into a table LD_ROLE_DEF from a checkbox report. The insert process pulls information from the report. However, it inputs different data from the rows selected (in the report) into table LD_ROLE_DEF. It usually inserts the top rows as seen in the report even though they weren't selected. Obviously, the insert process is not finding the correct rows that are ticked and entering the top rows instead.
I tried using the '#ROWNUM#' to capture the actual row being ticked and in testing I can seen the '#ROWNUM#' is returning the correct number to the row(s) being ticked but the other application items don't pull in the correct data to the row(s) selected.
The insert process must not be wrong but I can't seem to solve it.
Any help is welcome, Paul
my report code
-----------------------------------------------------------------------------
select APEX_ITEM.CHECKBOX(1,'#ROWNUM#','UNCHECKED')" " ,
APEX_ITEM.TEXT_FROM_LOV(CGID_FGN,'LD_COMPETENCY_GROUP_LOV')||APEX_ITEM.HIDDEN(2,CGID_FGN) COMPETENCY_GROUP,
APEX_ITEM.TEXT_FROM_LOV(CTID_FGN,'LD_COMP_TYPE_LOV')||APEX_ITEM.HIDDEN(3,CTID_FGN) COMPETENCY_TYPE,
APEX_ITEM.TEXT_FROM_LOV(CID,'LD_COMP_LOV')||APEX_ITEM.HIDDEN(4,CID) COMPETENCY,
APEX_ITEM.TEXT_FROM_LOV(CLID_FGN,'LD_COMP_LEVEL_LOV')||APEX_ITEM.HIDDEN(5,CLID_FGN) COMPETENCY_LEVEL
from LD_COMPETENCY_VIEW
where CGID_FGN = decode(:P12_xgroup, '%null%',CGID_FGN,:P12_XGROUP)
order by competency_group, competency_type, competency, competency_level
----------------------------------------------------------------------------------
insert process
----------------------------------------------------------------------------------
begin
for i in 1..apex_application.g_f01.count loop
INSERT INTO LD_role_def (R,CG,CT,C,CL)
VALUES (:p12_xrole,to_number(APEX_application.g_f02(i)),to_number(APEX_application.g_f03(i)), to_number(APEX_application.g_f04(i)),to_number(APEX_application.g_f05(i)));
end loop;
end;