So, I am a bit new to the Oracle world, and I want to know if I am approaching an issue I have properly by using a temp table, or if there might be a better approach. I am trying to improve a few processes that have recently been given to me that are just not terribly well done.
Currently:
We have a query that selects a large number of e-mails addresses of our customers, and sends a notice to them that they have information that has been recently posted to their account and is now viewable.
We then have an insert statement that uses the same criteria to update a table that records who we should have sent the notice to for auditing purposes.
The problem with this is if there are changes that occur between the to statements running, we may either e-mail one customer and not add them to the audit table, or add someone to the table that was not e-mailed.
What I would like to do:
I was thinking of creating a temporary table that an initial insert would populate and then send the emails from a query of the temp table. After the emails are sent then update the audit table with the info in the temp table. After the audit table is populated, the info in the temp table should be deleted. This should give me a static set of data between the email and update, but is this the best approach to this issue?
We do have a fair number of very similar processes that update the same audit table, and I figured, if I set it up properly, that they could all use the same temp table.
Currently:
We have a query that selects a large number of e-mails addresses of our customers, and sends a notice to them that they have information that has been recently posted to their account and is now viewable.
We then have an insert statement that uses the same criteria to update a table that records who we should have sent the notice to for auditing purposes.
The problem with this is if there are changes that occur between the to statements running, we may either e-mail one customer and not add them to the audit table, or add someone to the table that was not e-mailed.
What I would like to do:
I was thinking of creating a temporary table that an initial insert would populate and then send the emails from a query of the temp table. After the emails are sent then update the audit table with the info in the temp table. After the audit table is populated, the info in the temp table should be deleted. This should give me a static set of data between the email and update, but is this the best approach to this issue?
We do have a fair number of very similar processes that update the same audit table, and I figured, if I set it up properly, that they could all use the same temp table.