Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified PLSQL-and-SQL-Coding-Guidelines.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/2-naming-conventions/naming-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Bean> 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<Bean> 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.
2 changes: 1 addition & 1 deletion docs/4-language-usage/3-dml-and-sql/1-general/g-3160.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# G-3160: Avoid virtual columns to be visible.
# G-3160: Avoid visible virtual columns.

!!! warning "Major"
Maintainability, Reliability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

```
SELECT DECODE(dummy, 'X', 1
, 'Y', 2
, 'Z', 3
, 0)
, 'Y', 2
, 'Z', 3
, 0)
FROM dual;
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion docs/4-language-usage/5-exception-handling/g-5030.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down