Skip to content

Instantly share code, notes, and snippets.

Created September 16, 2022 00:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Blog Handle IG Form and IG Regions - crud_apis
PROCEDURE create_task
(pr_task_rec IN cndemo_tasks%ROWTYPE,
x_task_id OUT cndemo_tasks.task_id%TYPE) IS
l_task_number cndemo_tasks.task_number%TYPE;
-- Generate Task Number.
l_task_number := TRUNC(dbms_random.value(100000,999999));
INSERT INTO cndemo_tasks
(task_number, task_name, task_detail,
task_owner, due_date, task_status)
(l_task_number, pr_task_rec.task_name, pr_task_rec.task_detail,
pr_task_rec.task_owner, pr_task_rec.due_date, 'NEW')
RETURNING task_id INTO x_task_id;
-- If INSERT succesfull, Add Call to Send Email here.
END create_task;
PROCEDURE update_task
(pr_task_rec IN cndemo_tasks%ROWTYPE) IS
UPDATE cndemo_tasks
SET task_number = pr_task_rec.task_number
, task_name = pr_task_rec.task_name
, task_detail = pr_task_rec.task_detail
, task_owner = pr_task_rec.task_owner
, due_date = pr_task_rec.due_date
, task_status = pr_task_rec.task_status
WHERE task_id = pr_task_rec.task_id;
-- If UPDATE succesfull and task_owner was changed,
-- Add Call to Send Email here.
END update_task;
PROCEDURE delete_task
(p_task_id cndemo_tasks.task_id%TYPE) IS
DELETE FROM cndemo_tasks
WHERE task_id = p_task_id;
END delete_task;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment