diff --git a/PLSQL-and-SQL-Coding-Guidelines.pdf b/PLSQL-and-SQL-Coding-Guidelines.pdf index 32831957..a1e15c45 100644 Binary files a/PLSQL-and-SQL-Coding-Guidelines.pdf and b/PLSQL-and-SQL-Coding-Guidelines.pdf differ diff --git a/docs/2-naming-conventions/naming-conventions.md b/docs/2-naming-conventions/naming-conventions.md index 241979ef..1c904f6a 100644 --- a/docs/2-naming-conventions/naming-conventions.md +++ b/docs/2-naming-conventions/naming-conventions.md @@ -236,9 +236,9 @@ Examples: * `orders_v` - a view to the orders table [^1]: - We see a table and a views as a collection. A jar containing beans is labeled with "beans". - In Java we call such collection also beans (`List beans`) and name an entry bean + We see a table and a view as a collection. A jar containing beans is labeled "beans". + In Java we call such a collection also "beans" (`List beans`) and name an entry "bean" (`for (Bean bean : beans) {...}`). An entry of a table is a row (singular) and a table can contain an unbounded number of rows (plural). This and the fact that the Oracle database uses the same concept for their tables and views lead to the decision to use the plural - to name a table or view. + to name a table or a view. diff --git a/docs/4-language-usage/3-dml-and-sql/1-general/g-3160.md b/docs/4-language-usage/3-dml-and-sql/1-general/g-3160.md index b2de2e09..9ef90043 100644 --- a/docs/4-language-usage/3-dml-and-sql/1-general/g-3160.md +++ b/docs/4-language-usage/3-dml-and-sql/1-general/g-3160.md @@ -1,4 +1,4 @@ -# G-3160: Avoid virtual columns to be visible. +# G-3160: Avoid visible virtual columns. !!! warning "Major" Maintainability, Reliability diff --git a/docs/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4220.md b/docs/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4220.md index 453d9dc9..b8af0619 100644 --- a/docs/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4220.md +++ b/docs/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4220.md @@ -11,9 +11,9 @@ ``` SELECT DECODE(dummy, 'X', 1 - , 'Y', 2 - , 'Z', 3 - , 0) + , 'Y', 2 + , 'Z', 3 + , 0) FROM dual; ``` diff --git a/docs/4-language-usage/4-control-structures/3-flow-control/g-4310.md b/docs/4-language-usage/4-control-structures/3-flow-control/g-4310.md index 7e7efb5f..c9ce3d2a 100644 --- a/docs/4-language-usage/4-control-structures/3-flow-control/g-4310.md +++ b/docs/4-language-usage/4-control-structures/3-flow-control/g-4310.md @@ -5,12 +5,11 @@ ## Reason -Code containing gotos is hard to format. Indentation should be used to show logical structure and gotos have an effect on logical structure. Trying to use indentation to show the logical structure of a goto, however, is difficult or impossible. +>Code containing gotos is hard to format. Indentation should be used to show logical structure, and gotos have an effect on logical structure. Using indentation to show the logical structure of a goto and its target, however, is difficult or impossible. (...) -Use of gotos is a matter of religion. In modern languages, you can easily replace nine out of ten gotos with equivalent structured constructs. In these simple cases, you should replace gotos out of habit. In the hard cases, -you can break the code into smaller routines; use nested ifs; test and retest a status variable; or restructure a conditional. Eliminating the goto is harder in these cases, but it's good mental exercise. +> Use of gotos is a matter of religion. My dogma is that in modern languages, you can easily replace nine out of ten gotos with equivalent sequential constructs. In these simple cases, you should replace gotos out of habit. In the hard cases, you can still exorcise the goto in nine out of ten cases: You can break the code into smaller routines, use tryfinally, use nested ifs, test and retest a status variable, or restructure a conditional. Eliminating the goto is harder in these cases, but it’s good mental exercise (...). -Excerpt of [Using gotos by Steven C. McConnell](http://logos.cs.uic.edu/476/notes/GoTo/GoToMcConnel.html). +>-- McConnell, Steve C. (2004). _Code Complete. Second Edition_. Microsoft Press. ## Example (bad) diff --git a/docs/4-language-usage/5-exception-handling/g-5030.md b/docs/4-language-usage/5-exception-handling/g-5030.md index 86f291c7..7a57ca76 100644 --- a/docs/4-language-usage/5-exception-handling/g-5030.md +++ b/docs/4-language-usage/5-exception-handling/g-5030.md @@ -9,7 +9,7 @@ This is error-prone because your local declaration overrides the global declarat ## Example (bad) -Using the code below, we are not able to handle the no_data_found exception raised by the `SELECT` statement as we have overwritten that exception handler. In addition, our exception handler has not the exception number assigned, which is raise when the SELECT statement does not find any rows. +Using the code below, we are not able to handle the no_data_found exception raised by the `SELECT` statement as we have overwritten that exception handler. In addition, our exception handler doesn't have an exception number assigned, which should be raised when the SELECT statement does not find any rows. ``` DECLARE diff --git a/docs/4-language-usage/8-patterns/4-ensure-single-execution-at-a-time-of-a-program-unit/g-8410.md b/docs/4-language-usage/8-patterns/4-ensure-single-execution-at-a-time-of-a-program-unit/g-8410.md index 00674630..4f2cf5ec 100644 --- a/docs/4-language-usage/8-patterns/4-ensure-single-execution-at-a-time-of-a-program-unit/g-8410.md +++ b/docs/4-language-usage/8-patterns/4-ensure-single-execution-at-a-time-of-a-program-unit/g-8410.md @@ -1,4 +1,4 @@ -# G-8410: Always use application locks to ensure a program unit only running once at a given time. +# G-8410: Always use application locks to ensure a program unit is only running once at a given time. !!! tip "Minor" Efficiency, Reliability @@ -39,11 +39,11 @@ DECLARE BEGIN lock_up.request_lock(in_lock_name => co_lock_name); -- processing - lock_up.release_lock(in_lock_handle => l_handle); + lock_up.release_lock(in_lock_name => co_lock_name); EXCEPTION WHEN OTHERS THEN -- log error - lock_up.release_lock(in_lock_handle => l_handle); + lock_up.release_lock(in_lock_name => co_lock_name); RAISE; END; / diff --git a/docs/4-language-usage/8-patterns/5-use-dbms-application-info-package-to-follow-progress-of-a-process/g-8510.md b/docs/4-language-usage/8-patterns/5-use-dbms-application-info-package-to-follow-progress-of-a-process/g-8510.md index b7e94e51..d1b0a4a2 100644 --- a/docs/4-language-usage/8-patterns/5-use-dbms-application-info-package-to-follow-progress-of-a-process/g-8510.md +++ b/docs/4-language-usage/8-patterns/5-use-dbms-application-info-package-to-follow-progress-of-a-process/g-8510.md @@ -5,7 +5,7 @@ ## Reason -This technique allows us to view progress of a process without having to persistently write log data in either a table or a file. The information is accessible trough `V$SESSION` view. +This technique allows us to view progress of a process without having to persistently write log data in either a table or a file. The information is accessible through the `V$SESSION` view. ## Example (bad)