I don’t think you need a procedural unit if your actual logic is similar to the previous one.
Assuming this is your task:
"if the complete_date for id 1 is NULL, update it with XXX. Otherwise, set it to null.
You can just run ...
Update task_table
set complete_date = nvl2(complete_date,NULL, <**your date**>)
where task_id = 1;
This will only update records where full_date is null with your new date.
source
share