It also makes SQL more powerful by making use of PL/SQL functions. And, some SQL statements can run in parallel when calling a function and can enable the SQL statements inside the function to run in parallel. However, there is a small performance cost of context switching from SQL to PL/SQL when using the function in SQL. With the new version of oracle, the cost is going down and gives out some advantages, for instance, it outweighs the small context switch cost. By invoking Oracle built-in function UPPER, the passed character string test will be converted to upper case, and next is an example of calling a user-defined function get_dept_name inside the select. By selecting emp_id, one can get dept_name from the employee. Here, it will pass the call emp_dept_id to the function. The function can appear as a part of the condition in the Where clause or Having clause. And, it appears as a part of the select, update or insert statements.
For example, in GROUP BY clause, we get the count of employees and the department name returned by the get_dept_name function; taking in emp_dept_id from the employee table, and grouping it by the return value of a function. And, in some other places, it cannot appear in the default setting.
The capacity to place software engineer characterized PL/SQL capacities inside SQL is a capable improvement to the oracle advancement enforcement.