G-7810
🆓Warning
Never use SQL inside PL/SQL to read sequence numbers (or SYSDATE).
Reason
Since Oracle Database 11g it is no longer needed to use a select
statement to read a sequence (which would imply a context switch).
Example
Non-Compliant Example
declare l_sequence_number employees.employee_id%type; begin select employees_seq.nextval into l_sequence_number from dual; my_package.do_something(l_sequence_number); end; /
Issues
Line | Column | Message |
---|---|---|
4 | 25 |
★★★★★
Compliant Solution -
declare l_sequence_number employees.employee_id%type; begin l_sequence_number := employees_seq.nextval; my_package.do_something(l_sequence_number); end; /
Parameters
Use parameters to customize the rule to your needs.
Parameter | Description | Default Value |
---|---|---|
DisableAllQuickFix | Comma-separated ist of rules for which a quick fix should not be applied to all the problems in a file. | Core G-3130 |
References
- same as Trivadis G-7810