Polymorphic Table Functions and SQL Macros
Alex Nuijten, Patrick Barel · Apress eBooks · 2023
A lot of functionality is provided by Oracle Database out of the box. Most common functions and procedures are at your fingertips. But what do they offer when you need something not provided by Oracle? Suppose you have to figure out the total work hours when you only have a check-in and check-out time. An aggregate to sum up the interval differences between the start and end times would be very helpful. Unfortunately, Oracle Database does not provide an aggregate that sums up intervals yet. (You never know when they will implement a function like that.) You could create a “normal” PL/SQL function, but then you would always take a performance hit.