I'm making a task tracking application in Oracle Apex. I'm having trouble figuring out how to insert multiple copies of the same record based on the RESOURCES value. When assigning a task, it may have more than one resource attached to it. I believe the delimiter in Apex is a colon ':' character. How do I insert a task record the same amount of times as there are resources attached to the task (and have each resource attached to one)? RESOURCES is of type VARCHAR2.
INSERT INTO TASKS_PM (TASK_ID,PROJECTID,START_DATE,END_DATE,DESCRIPTION,TASK_NAME,RESOURCES,PRIORITY,STATUS,PROGRESS,HAS_PARENT,PARENT_TASK)
VALUES (
null,
:P3_PROJECTID,
TO_DATE(:P3_START_DATE,'DD-MON-YYYY'),
TO_DATE(:P3_END_DATE,'DD-MON-YYYY'),
:P3_DESCRIPTION,
:P3_TASK_NAME,
:P3_RESOURCES,
:P3_PRIORITY,
:P3_STATUS,
:P3_PROGRESS,
:P3_HAS_PARENT,
:P3_PARENT_TASK);
For example, if the following resources were attached to an insert: "Bobby Joe" and "Tyrion Lannister", there would be two copies of this record made, one with Bobby Joe as the resource, and the other with Tyrion Lannister as the resource.
Thanks!