Trivadis PL/SQL Cop Version 2.3.1 (2019-09-29 12:43:26 +0200) for Trivadis PL/SQL & SQL Coding Guidelines Version 3.6

Copyright 2010-2019 by Trivadis AG
Sägereistrasse 29
CH-8152 Glattbrugg (Zurich)
www.trivadis.com

License

Philipp Salvisberg, Trivadis AG, CH-8152 Glattbrugg
valid thru9999-12-31
valid for versions less than3
max. filesunlimited
max. linesunlimited
max. commandsunlimited
max. bytesunlimited
limited topersonal use

Parameters

path/usr/local/bin/tvdcc/sample/.
filter(sql|prc|fnc|pks|pkb|trg|vw|tps|tpb|tbp|plb|pls|rcv|spc|typ|aqt|aqp|ctx|dbl|tab|dim|snp|con|collt|seq|syn|grt|sp|spb|sps|pck)$
timeout10
complexity10
output/usr/local/bin/tvdcc/sample/./tvdcc_report.html
templatehtml.xsl
exceltrue
htmltrue
transonlyfalse
cleanuptrue
check
skip
nosonartrue
license
validatorcom.trivadis.tvdcc.validators.TrivadisGuidelines3
genmodelfalse

Processing

Start of processing2019-12-11 08:04:28
End of processing2019-12-11 08:04:37
Processing time in seconds8.839

Content

Number of files93
Number of bytes183,172
Number of lines (LOC)8,015
Number of comment lines814
Number of blank lines1,294
Number of net lines5,907
Number of commands211
Number of statements (PL/SQL)1,426
Max. cyclomatic complexity5   ( < 11   11..50   > 50 )
Max. Halstead volume575   ( < 1001   1001..3000   > 3000 )
Min. maintainability index (MI)83   ( > 84   64..84   < 64 )
Number of issues288
Number of warnings288
Number of errors0




Issue Overview

#%SeverityCharacteristicsMessage
10.3%BlockerPortability, Reliability
G-2150: Avoid comparisons with NULL value, consider using IS [NOT] NULL.
10.3%BlockerReliability, Testability
G-5030: Never assign predefined exception names to user defined exceptions.
20.7%CriticalReliability
G-5070: Avoid using Oracle predefined exceptions
10.3%CriticalReliability
G-2160: Avoid initializing variables using functions in the declaration section.
10.3%CriticalReliability
G-4120: Avoid using %NOTFOUND directly after the FETCH when working with BULK OPERATIONS and LIMIT clause.
10.3%CriticalEfficiency, Reliability
G-4230: Always use COALESCE instead of NVL, if parameter 2 of the NVL function is a function call or a SELECT statement.
10.3%CriticalEfficiency, Reliability
G-4240: Always use CASE instead of NVL2 if parameter 2 or 3 of NVL2 is either a function call or a SELECT statement.
10.3%CriticalMaintainability
G-5020: Never handle unnamed exceptions using the error number.
4013.9%MajorEfficiency
G-7460: Try to define your packaged/standalone function to be deterministic if appropriate.
82.8%MajorReliability
G-7230: Avoid declaring global variables public.
41.4%MajorMaintainability
G-3120: Always use table aliases when your SQL statement involves more than one source.
41.4%MajorMaintainability
G-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop.
31.0%MajorMaintainability
G-2180: Never use quoted identifiers.
31.0%MajorChangeability, Reliability
G-3180: Always specify column names instead of positional references in ORDER BY clauses.
31.0%MajorReliability
G-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers.
31.0%MajorMaintainability, Reliability, Testability
G-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit.
20.7%MajorPortability
G-2510: Avoid using the LONG and LONG RAW data types.
20.7%MajorMaintainability, Reliability
G-3140: Try to use anchored records as targets for your cursors.
20.7%MajorEfficiency
G-4385: Never use a cursor for loop to check whether a cursor returns data.
20.7%MajorChangeability, Maintainability
G-7110: Try to use named notation when calling program units.
20.7%MajorMaintainability, Testability
G-7430: Try to use no more than one RETURN statement within a function.
20.7%MajorMaintainability, Testability
G-7710: Avoid cascading triggers.
20.7%MajorEfficiency
G-8110: Never use SELECT COUNT(*) if you are only interested in the existence of a row.
10.3%MajorReliability
G-1060: Avoid storing ROWIDs or UROWIDs in database tables.
10.3%MajorMaintainability, Reliability
G-2110: Try to use anchored declarations for variables, constants and types.
10.3%MajorReliability
G-2170: Never overload variables.
10.3%MajorPortability, Reliability
G-2190: Avoid the use of ROWID or UROWID.
10.3%MajorReliability
G-2310: Avoid using CHAR data type.
10.3%MajorPortability
G-2320: Avoid using VARCHAR data type.
10.3%MajorPortability
G-2330: Never use zero-length strings to substitute NULL.
10.3%MajorMaintainability, Reliability
G-3110: Always specify the target columns when coding an insert statement.
10.3%MajorChangeability, Reliability
G-3190: Avoid using NATURAL JOIN.
10.3%MajorEfficiency
G-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement more than 4 times.
10.3%MajorEfficiency, Reliability
G-4130: Always close locally opened cursors.
10.3%MajorReliability
G-4140: Avoid executing any statements between a SQL operation and the usage of an implicit cursor attribute.
10.3%MajorMaintainability, Testability
G-4210: Try to use CASE rather than an IF statement with multiple ELSIF paths.
10.3%MajorMaintainability, Testability
G-4310: Never use GOTO statements in your code.
10.3%MajorReliability
G-4350: Always use 1 as lower and COUNT() as upper bound when looping through a dense array.
10.3%MajorEfficiency
G-4390: Avoid use of unreferenced FOR loop indexes.
10.3%MajorChangeability, Maintainability
G-5050: Avoid use of the RAISE_APPLICATION_ERROR built-in procedure with a hard-coded -20nnn error number or hard-coded message.
10.3%MajorReliability
G-5060: Avoid unhandled exceptions
10.3%MajorMaintainability, Testability
G-6010: Always use a character variable to execute dynamic SQL.
10.3%MajorMaintainability, Reliability
G-7140: Always ensure that locally defined procedures or functions are referenced.
10.3%MajorEfficiency, Maintainability
G-7240: Avoid using an IN OUT parameter as IN or OUT only.
10.3%MajorMaintainability, Testability
G-7320: Avoid using RETURN statements in a PROCEDURE.
10.3%MajorMaintainability
G-7420: Always make the RETURN statement the last statement of your function.
10.3%MajorReusability
G-7440: Never use OUT parameters to return values from a function.
10.3%MajorReliability, Testability
G-7450: Never return a NULL value from a BOOLEAN function.
10.3%MajorSecurity
G-7510: Always prefix ORACLE supplied packages with owner schema name.
10.3%MajorEfficiency, Maintainability
G-7810: Do not use SQL inside PL/SQL to read sequence numbers (or SYSDATE)
10.3%MajorEfficiency, Reliability
G-8120: Never check existence of a row to decide whether to create it or not.
10.3%MajorChangeability, Maintainability
G-8210: Always use synonyms when accessing objects of another application schema.
7024.3%MinorMaintainability, Reliability, Reusability, Testability
G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.
2910.1%MinorChangeability
G-1050: Avoid using literals in your code.
103.5%MinorChangeability
G-2130: Try to use subtypes for constructs used often in your code.
51.7%MinorMaintainability
G-1020: Always have a matching loop or block label.
51.7%MinorMaintainability
G-1040: Avoid dead code.
41.4%MinorMaintainability
G-4320: Always label your loops.
31.0%MinorMaintainability
G-2185: Avoid using overly short names for explicitly or implicitly declared identifiers.
31.0%MinorMaintainability
G-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations.
31.0%MinorMaintainability
G-4380: Try to label your EXIT WHEN statements.
20.7%MinorMaintainability
G-1010: Try to label your sub blocks.
20.7%MinorEfficiency, Maintainability
G-1030: Avoid defining variables that are not used.
20.7%MinorMaintainability
G-1070: Avoid nesting comment blocks.
20.7%MinorMaintainability
G-2140: Never initialize variables with NULL.
20.7%MinorEfficiency
G-2220: Try to use PLS_INTEGER instead of NUMBER for arithmetic operations with integer values.
20.7%MinorEfficiency
G-2230: Try to use SIMPLE_INTEGER datatype when appropriate.
20.7%MinorReliability
G-2340: Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored).
20.7%MinorMaintainability
G-4375: Always use EXIT WHEN instead of an IF statement to exit from a loop.
20.7%MinorMaintainability
G-7120: Always add the name of the program unit to its end keyword.
20.7%MinorChangeability
G-7220: Always use forward declaration for private functions and procedures.
10.3%MinorChangeability
G-2120: Try to have a single location to define your types.
10.3%MinorEfficiency
G-2210: Avoid declaring NUMBER variables or subtypes with no precision.
10.3%MinorMaintainability
G-2410: Try to use boolean data type for values with dual meaning.
10.3%MinorMaintainability, Portability
G-3130: Try to use ANSI SQL-92 join syntax.
10.3%MinorMaintainability, Reliability
G-3150: Try to use identity columns for surrogate keys.
10.3%MinorMaintainability
G-4110: Always use %NOTFOUND instead of NOT %FOUND to check whether a cursor returned data.
10.3%MinorMaintainability, Portability
G-4220: Try to use CASE rather than DECODE.
10.3%MinorMaintainability
G-4340: Always use a NUMERIC FOR loop to process a dense array.
10.3%MinorEfficiency
G-4360: Always use a WHILE loop to process a loose array.
10.3%MinorChangeability, Maintainability
G-4395: Avoid hard-coded upper or lower bound values with FOR loops.
10.3%MinorMaintainability
G-6020: Try to use output bind arguments in the RETURNING INTO clause of dynamic DML statements rather than the USING clause.
10.3%MinorEfficiency, Maintainability
G-7150: Try to remove unused parameters.
10.3%MinorEfficiency, Maintainability
G-7210: Try to keep your packages small. Include only few procedures and functions that are used in the same context.
10.3%MinorMaintainability
G-7310: Avoid standalone procedures – put your procedures in packages.
10.3%MinorMaintainability
G-7410: Avoid standalone functions – put your functions in packages.
10.3%InfoMaintainability
G-0000: Avoid using the NOSONAR marker.




Complex PL/SQL Units

File namePL/SQL UnitLine# Lines# Comment lines# Blank lines# Net lines# StmtsCyclomatic complexityHalstead volumeMaintainability index




File Overview

File name# Warnings# Errors# Bytes# Lines# Net lines# Cmds# StmtsMax. cyclomatic complexity Max. Halstead volume Min. MI Elapsed seconds
guidelines/guideline_7240_68.sql2304,0487966224575 111 0.042
guidelines/guideline_8410_na.sql1202,8339465416318 95 0.028
guidelines/guideline_1040_04.sql1101,5806548219349 95 0.054
guidelines/guideline_7130_62.sql902,6887856214169 99 0.031
guidelines/guideline_7220_66.sql902,0387660416114 103 0.033
guidelines/guideline_7230_67.sql902,80873474668 123 0.022
guidelines/guideline_7430_72.sql801,098453438102 111 0.015
guidelines/guideline_3110_26.sql70618241420221 0.020
guidelines/guideline_6020_59.sql701,78543312241 126 0.024
guidelines/guideline_7420_73.sql701,051403229114 107 0.015
guidelines/guideline_2510_25.sql60525201020221 0.015
guidelines/guideline_3120_27.sql601,508503350221 0.036
guidelines/guideline_4310_39.sql603,66910377322492 86 0.049
guidelines/guideline_7120_61.sql601,18549362869 107 0.020
guidelines/guideline_7150_64.sql601,5194939212108 103 0.023
guidelines/guideline_1020_02.sql501,5268262226306 86 0.068
guidelines/guideline_2210_18.sql50798281622143 0.022
guidelines/guideline_2220_19.sql50916321622143 0.015
guidelines/guideline_2330_22.sql50681261522143 0.017
guidelines/guideline_3180_na.sql50712271420221 0.023
guidelines/guideline_4130_33.sql501,792453127128 117 0.035
guidelines/guideline_4140_34.sql502,3556740211143 123 0.039
guidelines/guideline_4320_40.sql501,4246753218346 87 0.031
guidelines/guideline_5010_na.sql5092132122479 158 0.020
guidelines/guideline_5060_56.sql501,82547292682 109 0.019
guidelines/guideline_7440_74.sql4060924152321 133 0.013
guidelines/guideline_8310_na.sql401,392442926119 126 0.017
guidelines/guideline_2180_15.sql3054530222451 121 0.018
guidelines/guideline_2185_16.sql3069732222451 121 0.019
guidelines/guideline_2230_na.sql301,376351622143 0.017
guidelines/guideline_4110_31.sql301,0394834210138 106 0.030
guidelines/guideline_4370_45.sql301,8877962222411 83 0.027
guidelines/guideline_5050_55.sql301,3302682230 181 0.015
guidelines/guideline_7140_63.sql301,58842242425 136 0.016
guidelines/guideline_7410_71.sql30622221222143 0.014
guidelines/guideline_7450_75.sql30534231422143 0.012
guidelines/guideline_8510_na.sql301,196372725131 119 0.019
guidelines/guideline_0000_00.sql2053229183341 134 1.463
guidelines/guideline_1010_01.sql20392302021222 140 0.025
guidelines/guideline_1030_03.sql201,263443427139 106 0.064
guidelines/guideline_1050_05.sql201,2595238310124 101 0.034
guidelines/guideline_1070_07.sql20451231024221 0.010
guidelines/guideline_3140_29.sql201,2434534210196 128 0.030
guidelines/guideline_4380_47.sql202,0656149217444 92 0.029
guidelines/guideline_5030_52.sql201,844563929259 97 0.024
guidelines/guideline_6010_58.sql2058023142239 134 0.014
guidelines/guideline_7110_60.sql2073625142270 131 0.014
guidelines/guideline_7710_77.sql201,888594734189 95 0.024
guidelines/guideline_8120_na.sql201,15637262591 110 0.016
guidelines/guideline_na_54.sql202,3647151210143 105 0.022
guidelines/guideline_1060_06.sql1098234222257 143 0.030
guidelines/guideline_2110_08.sql101,300403026100 111 0.031
guidelines/guideline_2120_09.sql1087233213239 134 0.020
guidelines/guideline_2130_10.sql101,14939203228 136 0.021
guidelines/guideline_2140_11.sql1030720122241 134 0.018
guidelines/guideline_2150_12.sql1050426162431 127 0.017
guidelines/guideline_2160_13.sql10910322327185 105 0.026
guidelines/guideline_2170_14.sql101,1904234212217 110 0.036
guidelines/guideline_2190_17.sql1098231182245 125 0.022
guidelines/guideline_2310_20.sql10494211020221 0.014
guidelines/guideline_2320_21.sql1059419820221 0.014
guidelines/guideline_2340_23.sql1066320820221 0.012
guidelines/guideline_2410_24.sql10927443237124 114 0.022
guidelines/guideline_3130_28.sql10756271620221 0.033
guidelines/guideline_3150_na.sql101,60142214130 135 0.034
guidelines/guideline_3160_na.sql101,448442846151 113 0.028
guidelines/guideline_3190_na.sql10646261420221 0.018
guidelines/guideline_3210_30.sql101,507432826226 104 0.038
guidelines/guideline_4120_32.sql102,6849569321304 95 0.051
guidelines/guideline_4210_35.sql10588292128125 145 0.020
guidelines/guideline_4220_36.sql1062528182280 146 0.025
guidelines/guideline_4230_37.sql1064017520221 0.020
guidelines/guideline_4240_38.sql10766231020221 0.017
guidelines/guideline_4330_41.sql101,132422828173 103 0.023
guidelines/guideline_4340_42.sql101,467493329337 101 0.029
guidelines/guideline_4350_43.sql101,636533537151 109 0.040
guidelines/guideline_4360_44.sql101,9295739211367 98 0.045
guidelines/guideline_4375_46.sql10925372429132 105 0.019
guidelines/guideline_4385_48.sql10769342626113 117 0.014
guidelines/guideline_4390_49.sql101,669473628332 102 0.024
guidelines/guideline_4395_50.sql1077530192491 116 0.015
guidelines/guideline_5020_51.sql10946332227104 109 0.015
guidelines/guideline_5040_53.sql101,12029142439 155 0.013
guidelines/guideline_5070_57.sql10933251022145 0.015
guidelines/guideline_7210_65.sql1069,5254,2183,3682840221 3.980
guidelines/guideline_7310_69.sql10670271632221 0.015
guidelines/guideline_7320_70.sql101,383432827129 108 0.015
guidelines/guideline_7460_na.sql10805201020221 0.011
guidelines/guideline_7510_76.sql1057823122247 133 0.012
guidelines/guideline_7810_na.sql1050023142233 127 0.011
guidelines/guideline_8110_78.sql101,480463527244 97 0.021
guidelines/guideline_8210_79.sql101,508463136114 107 0.017
guidelines/guideline_3170_na.sql0079620820221 0.007
Total2880183,1728,0155,9072111,4265575837.610




File Issues

guidelines/guideline_7240_68.sql overview

Issue#LineSeverityMessageCode Excerpt
121MajorG-7240: Avoid using an IN OUT parameter as IN or OUT only.in_wait INTEGER
211MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_first_name IN OUT employees.first_name%TYPE
312MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_last_name IN OUT employees.last_name%TYPE
413MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_email IN OUT employees.email%TYPE
514MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_phone_number IN OUT employees.phone_number%TYPE
615MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_hire_date IN OUT employees.hire_date%TYPE
716MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_job_id IN OUT employees.job_id%TYPE
817MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_salary IN OUT employees.salary%TYPE
918MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_commission_pct IN OUT employees.commission_pct%TYPE
1019MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_manager_id IN OUT employees.manager_id%TYPE
1120MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.io_department_id IN OUT employees.department_id%TYPE
1221MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_wait INTEGER
1347MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_first_name OUT employees.first_name%TYPE
1448MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_last_name OUT employees.last_name%TYPE
1549MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_email OUT employees.email%TYPE
1650MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_phone_number OUT employees.phone_number%TYPE
1751MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_hire_date OUT employees.hire_date%TYPE
1852MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_job_id OUT employees.job_id%TYPE
1953MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_salary OUT employees.salary%TYPE
2054MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_commission_pct OUT employees.commission_pct%TYPE
2155MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_manager_id OUT employees.manager_id%TYPE
2256MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.OUT_department_id OUT employees.department_id%TYPE
2357MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_wait IN INTEGER

guidelines/guideline_8410_na.sql overview

Issue#LineSeverityMessageCode Excerpt
138MajorG-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers.WHEN OTHERS THEN -- log error lock_up.release_lock(in_lock_handle => l_handle); RAISE;
289MajorG-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers.WHEN OTHERS THEN -- log error lock_up.release_lock(in_lock_handle => l_handle); RAISE;
348MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION request_lock( in_lock_name IN VARCHAR2, in_release_on_commit IN BOOLEAN := FALSE) RETURN VARCHAR2
432MinorG-2130: Try to use subtypes for constructs used often in your code.co_lock_name CONSTANT VARCHAR2(30 CHAR) := 'APPLICATION_LOCK';
552MinorG-2130: Try to use subtypes for constructs used often in your code.l_lock_handle VARCHAR2(128 CHAR);
682MinorG-2130: Try to use subtypes for constructs used often in your code.l_handle VARCHAR2(128 CHAR);
783MinorG-2130: Try to use subtypes for constructs used often in your code.co_lock_name CONSTANT VARCHAR2(30 CHAR) := 'APPLICATION_LOCK';
817MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_lock_name IN VARCHAR2
923MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_lock_name IN VARCHAR2
1049MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_lock_name IN VARCHAR2
1150MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_release_on_commit IN BOOLEAN := FALSE
1271MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_lock_handle IN VARCHAR2

guidelines/guideline_1040_04.sql overview

Issue#LineSeverityMessageCode Excerpt
111MinorG-1040: Avoid dead code.2=3
219MinorG-1040: Avoid dead code.EXIT my_loop
326MinorG-1040: Avoid dead code.'x' = 'y'
437MinorG-1040: Avoid dead code.5=6
543MinorG-1040: Avoid dead code.RETURN
611MinorG-1050: Avoid using literals in your code.2
711MinorG-1050: Avoid using literals in your code.3
826MinorG-1050: Avoid using literals in your code.'x'
926MinorG-1050: Avoid using literals in your code.'y'
1037MinorG-1050: Avoid using literals in your code.5
1137MinorG-1050: Avoid using literals in your code.6

guidelines/guideline_7130_62.sql overview

Issue#LineSeverityMessageCode Excerpt
122MajorG-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit.r_emp
224MajorG-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit.r_emp
324MajorG-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit.r_emp
419MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION commission RETURN NUMBER
550MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION commission (in_salary IN employees.salary%TYPE, in_comm_pct IN employees.commission_pct%TYPE) RETURN NUMBER
616MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE
747MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE
850MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_salary IN employees.salary%TYPE
951MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_comm_pct IN employees.commission_pct%TYPE

guidelines/guideline_7220_66.sql overview

Issue#LineSeverityMessageCode Excerpt
114MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION does_exist (in_department_id IN departments.department_id%TYPE) RETURN BOOLEAN
248MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION does_exist (in_department_id IN departments.department_id%TYPE) RETURN BOOLEAN
358MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION does_exist (in_department_id IN departments.department_id%TYPE) RETURN BOOLEAN
414MinorG-7220: Always use forward declaration for private functions and procedures.does_exist
514MinorG-7220: Always use forward declaration for private functions and procedures.does_exist
614MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_department_id IN departments.department_id%TYPE
732MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_department_id IN departments.department_id%TYPE
851MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_department_id IN departments.department_id%TYPE
958MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_department_id IN departments.department_id%TYPE

guidelines/guideline_7230_67.sql overview

Issue#LineSeverityMessageCode Excerpt
118MajorG-7230: Avoid declaring global variables public.co_min_increase
219MajorG-7230: Avoid declaring global variables public.co_max_increase
320MajorG-7230: Avoid declaring global variables public.g_salary_increase
423MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION salary_increase RETURN types_up.sal_increase_type
534MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION salary_increase RETURN types_up.sal_increase_type
644MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION salary_increase RETURN types_up.sal_increase_type
760MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION salary_increase RETURN types_up.sal_increase_type
828MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_increase IN types_up.sal_increase_type
953MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_increase IN types_up.sal_increase_type

guidelines/guideline_7430_72.sql overview

Issue#LineSeverityMessageCode Excerpt
112MajorG-7430: Try to use no more than one RETURN statement within a function. RETURN TRUE
214MajorG-7430: Try to use no more than one RETURN statement within a function. RETURN FALSE
38MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function (in_value IN PLS_INTEGER) RETURN BOOLEAN
422MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function (in_value IN PLS_INTEGER) RETURN BOOLEAN
539MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function (in_value IN PLS_INTEGER) RETURN BOOLEAN
68MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_value IN PLS_INTEGER
722MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_value IN PLS_INTEGER
839MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_value IN PLS_INTEGER

guidelines/guideline_3110_26.sql overview

Issue#LineSeverityMessageCode Excerpt
18MajorG-3110: Always specify the target columns when coding an insert statement.INSERT INTO departments VALUES (departments_seq.nextval, 'Support', 100, 10)
210MinorG-1050: Avoid using literals in your code.'Support'
311MinorG-1050: Avoid using literals in your code.100
412MinorG-1050: Avoid using literals in your code.10
520MinorG-1050: Avoid using literals in your code.'Support'
621MinorG-1050: Avoid using literals in your code.100
722MinorG-1050: Avoid using literals in your code.10

guidelines/guideline_6020_59.sql overview

Issue#LineSeverityMessageCode Excerpt
122MinorG-6020: Try to use output bind arguments in the RETURNING INTO clause of dynamic DML statements rather than the USING clause. EXECUTE IMMEDIATE co_sql_stmt USING in_increase_pct, in_employee_id, OUT out_new_salary
212MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE
313MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_increase_pct IN types_up.percentage
414MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.out_new_salary OUT employees.salary%TYPE
529MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE
630MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_increase_pct IN types_up.percentage
731MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.out_new_salary OUT employees.salary%TYPE

guidelines/guideline_7420_73.sql overview

Issue#LineSeverityMessageCode Excerpt
118MajorG-7420: Always make the RETURN statement the last statement of your function.RETURN l_ret
28MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function (in_from IN PLS_INTEGER, in_to IN PLS_INTEGER) RETURN PLS_INTEGER
327MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function (in_from IN PLS_INTEGER, in_to IN PLS_INTEGER) RETURN PLS_INTEGER
48MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_from IN PLS_INTEGER
59MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_to IN PLS_INTEGER
627MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_from IN PLS_INTEGER
728MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_to IN PLS_INTEGER

guidelines/guideline_2510_25.sql overview

Issue#LineSeverityMessageCode Excerpt
110MajorG-2510: Avoid using the LONG and LONG RAW data types.l_long LONG;
211MajorG-2510: Avoid using the LONG and LONG RAW data types.l_raw LONG RAW;
310MajorG-7230: Avoid declaring global variables public.l_long
411MajorG-7230: Avoid declaring global variables public.l_raw
517MajorG-7230: Avoid declaring global variables public.l_long
618MajorG-7230: Avoid declaring global variables public.l_raw

guidelines/guideline_3120_27.sql overview

Issue#LineSeverityMessageCode Excerpt
19MajorG-3120: Always use table aliases when your SQL statement involves more than one source.last_name
210MajorG-3120: Always use table aliases when your SQL statement involves more than one source.first_name
311MajorG-3120: Always use table aliases when your SQL statement involves more than one source.department_name
438MajorG-3120: Always use table aliases when your SQL statement involves more than one source.employee_id
540MinorG-1050: Avoid using literals in your code.'%Manager%'
648MinorG-1050: Avoid using literals in your code.'%Manager%'

guidelines/guideline_4310_39.sql overview

Issue#LineSeverityMessageCode Excerpt
138MajorG-4310: Never use GOTO statements in your code.GOTO check_other_things
275MajorG-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop.EXIT check_digit
375MinorG-4375: Always use EXIT WHEN instead of an IF statement to exit from a loop.EXIT check_digit
418MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_password IN VARCHAR2
555MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_password IN VARCHAR2
692MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_password IN VARCHAR2

guidelines/guideline_7120_61.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION employee_by_id (in_employee_id IN employees.employee_id%TYPE) RETURN employees%rowtype
232MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION employee_by_id (in_employee_id IN employees.employee_id%TYPE) RETURN employees%rowtype
310MinorG-7120: Always add the name of the program unit to its end keyword.employee_api
411MinorG-7120: Always add the name of the program unit to its end keyword.employee_by_id
511MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE
632MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE

guidelines/guideline_7150_64.sql overview

Issue#LineSeverityMessageCode Excerpt
18MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION name_by_id (in_department_id IN departments.department_id%TYPE, in_manager_id IN departments.manager_id%TYPE) RETURN departments.department_name%TYPE
231MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION name_by_id (in_department_id IN departments.department_id%TYPE) RETURN departments.department_name%TYPE
39MinorG-7150: Try to remove unused parameters.in_manager_id IN departments.manager_id%TYPE
48MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_department_id IN departments.department_id%TYPE
59MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_manager_id IN departments.manager_id%TYPE
631MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_department_id IN departments.department_id%TYPE

guidelines/guideline_1020_02.sql overview

Issue#LineSeverityMessageCode Excerpt
117MinorG-1020: Always have a matching loop or block label.<<prepare_data>>
222MinorG-1020: Always have a matching loop or block label.<<process_data>>
328MinorG-1020: Always have a matching loop or block label.<<while_loop>>
434MinorG-1020: Always have a matching loop or block label.<<basic_loop>>
539MinorG-1020: Always have a matching loop or block label.<<for_loop>>

guidelines/guideline_2210_18.sql overview

Issue#LineSeverityMessageCode Excerpt
112MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION small_increase RETURN NUMBER
223MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION small_increase RETURN NUMBER
310MinorG-2130: Try to use subtypes for constructs used often in your code.co_small_increase CONSTANT NUMBER := 0.1;
421MinorG-2130: Try to use subtypes for constructs used often in your code.co_small_increase CONSTANT NUMBER(5,1) := 0.1;
510MinorG-2210: Avoid declaring NUMBER variables or subtypes with no precision. NUMBER

guidelines/guideline_2220_19.sql overview

Issue#LineSeverityMessageCode Excerpt
116MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION big_increase RETURN NUMBER
227MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION big_increase RETURN PLS_INTEGER
314MinorG-2130: Try to use subtypes for constructs used often in your code.co_big_increase CONSTANT NUMBER(5,0) := 1;
414MinorG-2220: Try to use PLS_INTEGER instead of NUMBER for arithmetic operations with integer values. NUMBER(5,0)
514MinorG-2230: Try to use SIMPLE_INTEGER datatype when appropriate. NUMBER(5,0)

guidelines/guideline_2330_22.sql overview

Issue#LineSeverityMessageCode Excerpt
19MajorG-2330: Never use zero-length strings to substitute NULL.:= ''
211MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION null_string RETURN VARCHAR2
321MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION empty_string RETURN VARCHAR2
49MinorG-2130: Try to use subtypes for constructs used often in your code.co_null_string CONSTANT VARCHAR2(1) := '';
59MinorG-2340: Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored).VARCHAR2(1)

guidelines/guideline_3180_na.sql overview

Issue#LineSeverityMessageCode Excerpt
115MajorG-3180: Always specify column names instead of positional references in ORDER BY clauses.4
215MajorG-3180: Always specify column names instead of positional references in ORDER BY clauses.1
315MajorG-3180: Always specify column names instead of positional references in ORDER BY clauses.3
415MinorG-1050: Avoid using literals in your code.4
515MinorG-1050: Avoid using literals in your code.3

guidelines/guideline_4130_33.sql overview

Issue#LineSeverityMessageCode Excerpt
120MajorG-4130: Always close locally opened cursors.OPEN c_department_salary(p_dept_id => in_dept_id)
212MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION department_salary (in_dept_id IN departments.department_id%TYPE) RETURN NUMBER
331MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION department_salary (in_dept_id IN departments.department_id%TYPE) RETURN NUMBER
412MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_dept_id IN departments.department_id%TYPE
531MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_dept_id IN departments.department_id%TYPE

guidelines/guideline_4140_34.sql overview

Issue#LineSeverityMessageCode Excerpt
132MajorG-4140: Avoid executing any statements between a SQL operation and the usage of an implicit cursor attribute.SQL%ROWCOUNT
218MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_dept_id IN departments.department_id%TYPE
323MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE
444MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_dept_id IN departments.department_id%TYPE
549MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_employee_id IN employees.employee_id%TYPE

guidelines/guideline_4320_40.sql overview

Issue#LineSeverityMessageCode Excerpt
114MinorG-4320: Always label your loops.WHILE (i <= co_max_value) LOOP i := i + co_increment; END LOOP
219MinorG-4320: Always label your loops.LOOP EXIT; END LOOP
323MinorG-4320: Always label your loops.FOR i IN co_min_value..co_max_value LOOP sys.dbms_output.put_line(i); END LOOP
428MinorG-4320: Always label your loops.FOR r_employee IN (SELECT last_name FROM employees) LOOP sys.dbms_output.put_line(r_employee.last_name); END LOOP
520MinorG-4380: Try to label your EXIT WHEN statements.EXIT

guidelines/guideline_5010_na.sql overview

Issue#LineSeverityMessageCode Excerpt
117MinorG-1050: Avoid using literals in your code.'START'
219MinorG-1050: Avoid using literals in your code.'END'
326MinorG-1050: Avoid using literals in your code.'DEMO'
428MinorG-1050: Avoid using literals in your code.'START'
530MinorG-1050: Avoid using literals in your code.'END'

guidelines/guideline_5060_56.sql overview

Issue#LineSeverityMessageCode Excerpt
120MajorG-5060: Avoid unhandled exceptionsSELECT department_name INTO l_department_name FROM departments WHERE department_id = in_id
216MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION name_by_id (in_id IN departments.department_id%TYPE) RETURN departments.department_name%TYPE
332MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION name_by_id (in_id IN departments.department_id%TYPE) RETURN departments.department_name%TYPE
416MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_id IN departments.department_id%TYPE
532MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_id IN departments.department_id%TYPE

guidelines/guideline_7440_74.sql overview

Issue#LineSeverityMessageCode Excerpt
19MajorG-7440: Never use OUT parameters to return values from a function.out_date OUT DATE
29MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function (out_date OUT DATE) RETURN BOOLEAN
319MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function RETURN DATE
49MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.out_date OUT DATE

guidelines/guideline_8310_na.sql overview

Issue#LineSeverityMessageCode Excerpt
110MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION dept_by_name (in_dept_name IN departments.department_name%TYPE) RETURN departments%ROWTYPE
231MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION dept_by_name (in_dept_name IN departments.department_name%TYPE) RETURN departments%ROWTYPE
314MinorG-1050: Avoid using literals in your code.20
410MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.in_dept_name IN departments.department_name%TYPE

guidelines/guideline_2180_15.sql overview

Issue#LineSeverityMessageCode Excerpt
18MajorG-2180: Never use quoted identifiers. "sal+comm"
29MajorG-2180: Never use quoted identifiers. "my constant"
310MajorG-2180: Never use quoted identifiers. "my exception"

guidelines/guideline_2185_16.sql overview

Issue#LineSeverityMessageCode Excerpt
110MinorG-2185: Avoid using overly short names for explicitly or implicitly declared identifiers. i INTEGER;
211MinorG-2185: Avoid using overly short names for explicitly or implicitly declared identifiers. c CONSTANT INTEGER := 1;
312MinorG-2185: Avoid using overly short names for explicitly or implicitly declared identifiers. e exception;

guidelines/guideline_2230_na.sql overview

Issue#LineSeverityMessageCode Excerpt
117MinorG-2130: Try to use subtypes for constructs used often in your code.co_big_increase CONSTANT NUMBER(5,0) := 1;
217MinorG-2220: Try to use PLS_INTEGER instead of NUMBER for arithmetic operations with integer values. NUMBER(5,0)
317MinorG-2230: Try to use SIMPLE_INTEGER datatype when appropriate. NUMBER(5,0)

guidelines/guideline_4110_31.sql overview

Issue#LineSeverityMessageCode Excerpt
121MinorG-4110: Always use %NOTFOUND instead of NOT %FOUND to check whether a cursor returned data.NOT c_employees%FOUND
220MinorG-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations.FETCH c_employees INTO r_employee
342MinorG-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations.FETCH c_employees INTO r_employee

guidelines/guideline_4370_45.sql overview

Issue#LineSeverityMessageCode Excerpt
120MajorG-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop.EXIT while_loop WHEN i > co_max_value
232MajorG-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop.EXIT for_loop WHEN i = co_max_value
341MajorG-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop.EXIT process_employees

guidelines/guideline_5050_55.sql overview

Issue#LineSeverityMessageCode Excerpt
118MajorG-5050: Avoid use of the RAISE_APPLICATION_ERROR built-in procedure with a hard-coded -20nnn error number or hard-coded message. raise_application_error(-20501,'Invalid employee_id')
218MinorG-1050: Avoid using literals in your code.20501
318MinorG-1050: Avoid using literals in your code.'Invalid employee_id'

guidelines/guideline_7140_63.sql overview

Issue#LineSeverityMessageCode Excerpt
119MajorG-7140: Always ensure that locally defined procedures or functions are referenced.FUNCTION my_func RETURN NUMBER
219MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_func RETURN NUMBER
333MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_func RETURN NUMBER

guidelines/guideline_7410_71.sql overview

Issue#LineSeverityMessageCode Excerpt
19MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.CREATE OR REPLACE FUNCTION my_function RETURN VARCHAR2 IS BEGIN RETURN NULL; END my_function; /
217MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function RETURN VARCHAR2
39MinorG-7410: Avoid standalone functions – put your functions in packages.my_function

guidelines/guideline_7450_75.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-7450: Never return a NULL value from a BOOLEAN function.RETURN NULL
29MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function RETURN BOOLEAN
318MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION my_function RETURN BOOLEAN

guidelines/guideline_8510_na.sql overview

Issue#LineSeverityMessageCode Excerpt
112MajorG-4385: Never use a cursor for loop to check whether a cursor returns data.FOR emp_rec IN (SELECT employee_id FROM employees ORDER BY employee_id) LOOP NULL; -- some processing END LOOP employees
226MinorG-1050: Avoid using literals in your code.'Init'
332MinorG-1050: Avoid using literals in your code.'Processing '

guidelines/guideline_0000_00.sql overview

Issue#LineSeverityMessageCode Excerpt
117MinorG-2140: Never initialize variables with NULL.l_value PLS_INTEGER := NULL;
29InfoG-0000: Avoid using the NOSONAR marker.:= NULL; -- NOSONAR

guidelines/guideline_1010_01.sql overview

Issue#LineSeverityMessageCode Excerpt
18MinorG-1010: Try to label your sub blocks.BEGIN NULL; END
212MinorG-1010: Try to label your sub blocks.BEGIN NULL; END

guidelines/guideline_1030_03.sql overview

Issue#LineSeverityMessageCode Excerpt
110MinorG-1030: Avoid defining variables that are not used.l_first_name employees.first_name%TYPE;
212MinorG-1030: Avoid defining variables that are not used.e_good EXCEPTION;

guidelines/guideline_1050_05.sql overview

Issue#LineSeverityMessageCode Excerpt
131MajorG-7230: Avoid declaring global variables public.co_president
218MinorG-1050: Avoid using literals in your code.'AD_PRES'

guidelines/guideline_1070_07.sql overview

Issue#LineSeverityMessageCode Excerpt
19MinorG-1070: Avoid nesting comment blocks./* comment one -- nested comment two */
211MinorG-1070: Avoid nesting comment blocks.-- comment three /* nested comment four */

guidelines/guideline_3140_29.sql overview

Issue#LineSeverityMessageCode Excerpt
117MajorG-3140: Try to use anchored records as targets for your cursors.INTO l_employee_id, l_first_name, l_last_name
222MajorG-3140: Try to use anchored records as targets for your cursors.INTO l_employee_id, l_first_name, l_last_name

guidelines/guideline_4380_47.sql overview

Issue#LineSeverityMessageCode Excerpt
128MinorG-4380: Try to label your EXIT WHEN statements.EXIT WHEN l_innerlp = co_exit_value
231MinorG-4380: Try to label your EXIT WHEN statements.EXIT WHEN l_innerlp = co_exit_value

guidelines/guideline_5030_52.sql overview

Issue#LineSeverityMessageCode Excerpt
116BlockerG-5030: Never assign predefined exception names to user defined exceptions.no_data_found EXCEPTION;
226CriticalG-5070: Avoid using Oracle predefined exceptionsRAISE no_data_found

guidelines/guideline_6010_58.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-6010: Always use a character variable to execute dynamic SQL.EXECUTE IMMEDIATE 'select employees_seq.nextval from dual' INTO l_next_val
211MinorG-1050: Avoid using literals in your code.'select employees_seq.nextval from dual'

guidelines/guideline_7110_60.sql overview

Issue#LineSeverityMessageCode Excerpt
114MajorG-7110: Try to use named notation when calling program units.r_employee
214MajorG-7110: Try to use named notation when calling program units.co_id

guidelines/guideline_7710_77.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-7710: Avoid cascading triggers.departments_hist
240MajorG-7710: Avoid cascading triggers.departments_hist

guidelines/guideline_8120_na.sql overview

Issue#LineSeverityMessageCode Excerpt
114MajorG-8110: Never use SELECT COUNT(*) if you are only interested in the existence of a row.count(*)
218MajorG-8120: Never check existence of a row to decide whether to create it or not.l_count = 0 THEN INSERT INTO departments VALUES in_r_department;

guidelines/guideline_na_54.sql overview

Issue#LineSeverityMessageCode Excerpt
118MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.date_in IN DATE
250MinorG-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit.date_in IN DATE

guidelines/guideline_1060_06.sql overview

Issue#LineSeverityMessageCode Excerpt
119MajorG-1060: Avoid storing ROWIDs or UROWIDs in database tables.ROWID

guidelines/guideline_2110_08.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-2110: Try to use anchored declarations for variables, constants and types.l_last_name VARCHAR2(20 CHAR);

guidelines/guideline_2120_09.sql overview

Issue#LineSeverityMessageCode Excerpt
112MinorG-2120: Try to have a single location to define your types.SUBTYPE big_string_type IS VARCHAR2(1000 CHAR);

guidelines/guideline_2130_10.sql overview

Issue#LineSeverityMessageCode Excerpt
119MinorG-2130: Try to use subtypes for constructs used often in your code.l_note VARCHAR2(1000 CHAR);

guidelines/guideline_2140_11.sql overview

Issue#LineSeverityMessageCode Excerpt
18MinorG-2140: Never initialize variables with NULL.l_note big_string := NULL;

guidelines/guideline_2150_12.sql overview

Issue#LineSeverityMessageCode Excerpt
112BlockerG-2150: Avoid comparisons with NULL value, consider using IS [NOT] NULL. l_value = NULL

guidelines/guideline_2160_13.sql overview

Issue#LineSeverityMessageCode Excerpt
19CriticalG-2160: Avoid initializing variables using functions in the declaration section.l_department_name departments.department_name%TYPE := department_api.name_by_id(in_id => co_department_id);

guidelines/guideline_2170_14.sql overview

Issue#LineSeverityMessageCode Excerpt
117MajorG-2170: Never overload variables.l_variable

guidelines/guideline_2190_17.sql overview

Issue#LineSeverityMessageCode Excerpt
118MajorG-2190: Avoid the use of ROWID or UROWID.ROWID

guidelines/guideline_2310_20.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-2310: Avoid using CHAR data type.CHAR(200)

guidelines/guideline_2320_21.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-2320: Avoid using VARCHAR data type.VARCHAR(200)

guidelines/guideline_2340_23.sql overview

Issue#LineSeverityMessageCode Excerpt
112MinorG-2340: Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored).VARCHAR2(200)

guidelines/guideline_2410_24.sql overview

Issue#LineSeverityMessageCode Excerpt
111MinorG-2410: Try to use boolean data type for values with dual meaning. (co_numeric_false, co_numeric_true).l_bigger PLS_INTEGER;

guidelines/guideline_3130_28.sql overview

Issue#LineSeverityMessageCode Excerpt
112MinorG-3130: Try to use ANSI SQL-92 join syntax.employees e, departments d

guidelines/guideline_3150_na.sql overview

Issue#LineSeverityMessageCode Excerpt
123MinorG-3150: Try to use identity columns for surrogate keys.nextval

guidelines/guideline_3160_na.sql overview

Issue#LineSeverityMessageCode Excerpt
119MinorG-1050: Avoid using literals in your code.107

guidelines/guideline_3190_na.sql overview

Issue#LineSeverityMessageCode Excerpt
112MajorG-3190: Avoid using NATURAL JOIN.NATURAL JOIN departments d

guidelines/guideline_3210_30.sql overview

Issue#LineSeverityMessageCode Excerpt
121MajorG-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement more than 4 times.FOR i IN 1..t_employee_ids.COUNT() LOOP UPDATE employees SET salary = salary + (salary * co_increase) WHERE employee_id = t_employee_ids(i); END LOOP process_employees

guidelines/guideline_4120_32.sql overview

Issue#LineSeverityMessageCode Excerpt
126CriticalG-4120: Avoid using %NOTFOUND directly after the FETCH when working with BULK OPERATIONS and LIMIT clause. c_employees%NOTFOUND

guidelines/guideline_4210_35.sql overview

Issue#LineSeverityMessageCode Excerpt
18MajorG-4210: Try to use CASE rather than an IF statement with multiple ELSIF paths.IF l_color = constant_pkg.co_red THEN do_red; ELSIF l_color = constant_pkg.co_blue THEN do_blue; ELSIF l_color = constant_pkg.co_black THEN do_black; END IF

guidelines/guideline_4220_36.sql overview

Issue#LineSeverityMessageCode Excerpt
110MinorG-4220: Try to use CASE rather than DECODE.DECODE(dummy, a, x , b, y , c, z , 0)

guidelines/guideline_4230_37.sql overview

Issue#LineSeverityMessageCode Excerpt
110CriticalG-4230: Always use COALESCE instead of NVL, if parameter 2 of the NVL function is a function call or a SELECT statement.NVL(dummy, my_package.expensive_null(value_in => dummy))

guidelines/guideline_4240_38.sql overview

Issue#LineSeverityMessageCode Excerpt
19CriticalG-4240: Always use CASE instead of NVL2 if parameter 2 or 3 of NVL2 is either a function call or a SELECT statement.NVL2(dummy, my_package.expensive_nn(value_in => dummy), my_package.expensive_null(value_in => dummy))

guidelines/guideline_4330_41.sql overview

Issue#LineSeverityMessageCode Excerpt
121MinorG-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations.FETCH c_employees INTO r_employee

guidelines/guideline_4340_42.sql overview

Issue#LineSeverityMessageCode Excerpt
127MinorG-4340: Always use a NUMERIC FOR loop to process a dense array.i > t_employees.COUNT()

guidelines/guideline_4350_43.sql overview

Issue#LineSeverityMessageCode Excerpt
119MajorG-4350: Always use 1 as lower and COUNT() as upper bound when looping through a dense array. t_employees.FIRST()..t_employees.LAST()

guidelines/guideline_4360_44.sql overview

Issue#LineSeverityMessageCode Excerpt
127MinorG-4360: Always use a WHILE loop to process a loose array.1 .. t_employees.COUNT()

guidelines/guideline_4375_46.sql overview

Issue#LineSeverityMessageCode Excerpt
116MinorG-4375: Always use EXIT WHEN instead of an IF statement to exit from a loop.EXIT process_employees

guidelines/guideline_4385_48.sql overview

Issue#LineSeverityMessageCode Excerpt
114MajorG-4385: Never use a cursor for loop to check whether a cursor returns data.FOR r_employee IN c_employees LOOP l_employee_found := TRUE; END LOOP check_employees

guidelines/guideline_4390_49.sql overview

Issue#LineSeverityMessageCode Excerpt
123MajorG-4390: Avoid use of unreferenced FOR loop indexes.FOR i IN co_lower_bound .. co_upper_bound LOOP sys.dbms_output.put_line(l_row || co_delimiter || l_value); l_row := l_row + co_row_incr; l_value := l_value + co_value_incr; END LOOP for_loop

guidelines/guideline_4395_50.sql overview

Issue#LineSeverityMessageCode Excerpt
112MinorG-4395: Avoid hard-coded upper or lower bound values with FOR loops. 1..5

guidelines/guideline_5020_51.sql overview

Issue#LineSeverityMessageCode Excerpt
118CriticalG-5020: Never handle unnamed exceptions using the error number.WHEN OTHERS THEN IF SQLCODE = co_no_data_found THEN NULL; END IF;

guidelines/guideline_5040_53.sql overview

Issue#LineSeverityMessageCode Excerpt
117MajorG-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers.WHEN OTHERS THEN my_package.some_further_processing();

guidelines/guideline_5070_57.sql overview

Issue#LineSeverityMessageCode Excerpt
115CriticalG-5070: Avoid using Oracle predefined exceptionsRAISE NO_DATA_FOUND

guidelines/guideline_7210_65.sql overview

Issue#LineSeverityMessageCode Excerpt
110MinorG-7210: Try to keep your packages small. Include only few procedures and functions that are used in the same context.example_pkg

guidelines/guideline_7310_69.sql overview

Issue#LineSeverityMessageCode Excerpt
19MinorG-7310: Avoid standalone procedures – put your procedures in packages.my_procedure

guidelines/guideline_7320_70.sql overview

Issue#LineSeverityMessageCode Excerpt
120MajorG-7320: Avoid using RETURN statements in a PROCEDURE.RETURN

guidelines/guideline_7460_na.sql overview

Issue#LineSeverityMessageCode Excerpt
110MajorG-7460: Try to define your packaged/standalone function to be deterministic if appropriate.FUNCTION name_by_id (in_department_id IN departments.department_id%TYPE) RETURN departments.department_name%TYPE

guidelines/guideline_7510_76.sql overview

Issue#LineSeverityMessageCode Excerpt
112MajorG-7510: Always prefix ORACLE supplied packages with owner schema name.dbms_output.put_line(co_hello_world)

guidelines/guideline_7810_na.sql overview

Issue#LineSeverityMessageCode Excerpt
111MajorG-7810: Do not use SQL inside PL/SQL to read sequence numbers (or SYSDATE)employees_seq.NEXTVAL

guidelines/guideline_8110_78.sql overview

Issue#LineSeverityMessageCode Excerpt
115MajorG-8110: Never use SELECT COUNT(*) if you are only interested in the existence of a row.count(*)

guidelines/guideline_8210_79.sql overview

Issue#LineSeverityMessageCode Excerpt
119MajorG-8210: Always use synonyms when accessing objects of another application schema.oe.products