I am designing a database for a system where billing occurs at regular, custom intervals. Because the intervals can be customized, I need to be able to process billing regularly, perhaps even daily. I would like this to be a function of the database itself so that the interface doesn’t need to manage this, which could be problematic.
I know that database triggers generally work off of DML statements. Is there a way to create a trigger or automatic function in MySQL, PostgreSQL, or Oracle that would be able to process billing on a daily basis without using anything external to the database to trigger it besides system date?
With oracle you would use the dbms_scheduler package
For MySQL the Event Scheduler seems to do similar things (took this from Nicos comment)
There won’t be a single solution which works for all these databases. If you need something cross platform, you might try a OS solution like cron on unix or something based on some other language which is present on the system you develop. E.g. Quartz Scheduler for Java