I am very new to oracle apex and constantly fail in creating tables for inserting data into my chart. My scenario is the following.
I have two tables
1. tasks (job_id, job_name)
2. Efforts (Eff_id, Task_id, Hours_spent, Notes).
I want to create a tabular form to insert data into the Efforts table with the tasks I have in the task table. I have created the tabular form with the query below.
SELECT APEX_ITEM.CHECKBOX(1,TASK_ID) "TASK_ID", TASK_NAME, APEX_ITEM.TEXT(2,'')"HOURS_SPENT", APEX_ITEM.TEXT(3,'')"NOTES" FROM TASKS;
but when I create the "after Submit" process to read the values in this report and try to put some effort into my table with the following code, something odd happens. When I select the checkbox for lines 1,2 and 3, only line 1 is inserted in the table of efforts, but for the rest, only the values of the task ID are inserted, not the whole line . I missed "hours_spent and notes". in my table of efforts for lines 2 and 3 .. here is my block plsql
BEGIN FOR i in APEX_APPLICATION.G_F01.COUNT LOOP INSERT INTO EFFORTS(EFF_ID,TASK_ID,HOURS_SPENT,NOTES) VALUES (SEQ_EFFORTS.NEXTVAL,APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F03(i)) END LOOP; commit; END;
Can someone help me! If there is another way to do my requirement, then I am more than happy to do it.