G-7440
🆓Warning
Never use OUT parameters to return values from a function.
Reason
A function should return all its data through the return
clause. Having an out
parameter prohibits usage of a function within SQL statements.
Example
Non-Compliant Example
create or replace package body my_package is function my_function(out_date out date) return boolean deterministic is begin out_date := sysdate; return true; end my_function; end my_package; /
Issues
Line | Column | Message |
---|---|---|
2 | 34 |
★★★★★
Compliant Solution -
create or replace package body my_package is function my_function return date deterministic is begin return sysdate; end my_function; end my_package; /
References
- same as plsql:FunctionOutParametersCheck
- same as Trivadis G-7440