Skip to content

Commit 1392420

Browse files
Merge pull request #72 from Trivadis/feature/minor-changes
Feature/minor changes
2 parents 41b1000 + bc4088d commit 1392420

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed
5.65 KB
Binary file not shown.

docs/2-naming-conventions/naming-conventions.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ Singular name of what is stored in the column (unless the column data type is a
6060

6161
Add a comment to the database dictionary for every column.
6262

63+
### Check Constraint
64+
65+
Table name or table abbreviation followed by the column and/or role of the check constraint, a `_ck` and an optional number suffix.
66+
67+
Examples:
68+
69+
* `employees_salary_min_ck`
70+
* `orders_mode_ck`
71+
6372
### DML / Instead of Trigger
6473

6574
Choose a naming convention that includes:
@@ -182,7 +191,9 @@ Examples:
182191

183192
### Table
184193

185-
Plural[^1] name of what is contained in the table (unless the table is designed to always hold one row only – then you should use a singular name)
194+
Plural[^1] name of what is contained in the table (unless the table is designed to always hold one row only – then you should use a singular name).
195+
196+
Suffixed by `_eb` when protected by an editioning view.
186197

187198
Add a comment to the database dictionary for every table and every column in the table.
188199

@@ -192,6 +203,7 @@ Examples:
192203

193204
* `employees`
194205
* `departments`
206+
* `countries_eb` - table interfaced by an editioning view named `countries`
195207
* `sct_contracts`
196208
* `sct_contract_lines`
197209
* `sct_incentive_modules`
@@ -226,6 +238,8 @@ Examples:
226238
Plural[^1] name of what is contained in the view.
227239
Optionally suffixed by an indicator identifying the object as a view (mostly used, when a 1:1 view layer lies above the table layer)
228240

241+
Editioning views are named like the original underlying table to avoid changing the existing application code when introducing edition based redefinition (EBR).
242+
229243
Add a comment to the database dictionary for every view and every column.
230244

231245
Optionally prefixed by a project abbreviation.
@@ -234,6 +248,7 @@ Examples:
234248

235249
* `active_orders`
236250
* `orders_v` - a view to the orders table
251+
* `countries` - an editioning view for table `countries_eb`
237252

238253
[^1]:
239254
We see a table and a view as a collection. A jar containing beans is labeled "beans".

docs/4-language-usage/3-dml-and-sql/1-general/g-3150.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ CREATE TABLE locations (
4343
,city VARCHAR2(30 CHAR) NOT NULL
4444
,CONSTRAINT locations_pk PRIMARY KEY (location_id))
4545
/
46-
```
46+
```
47+
48+
`GENERATED ALWAYS AS IDENTITY` ensures that the `location_id` is populated by a sequence. It is not possible to override the behavior in the application.
49+
50+
However, if you use a framework that produces an `INSERT` statement including the surrogate key column, and you cannot change this behavior, then you have to use the `GENERATED BY DEFAULT ON NULL AS IDENTITY` option. This has the downside that the application may pass a value, which might lead to an immediate or delayed `ORA-00001: unique constraint violated` error.

docs/4-language-usage/3-dml-and-sql/1-general/g-3170.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Default values have been nullifiable until ORACLE 12c. Meaning any tool sending
1616
```
1717
CREATE TABLE null_test (
1818
test_case NUMBER(2) NOT NULL
19-
,column_defaulted VARCHAR2(10) DEFAULT 'Default')
19+
,column_defaulted VARCHAR2(10 CHAR) DEFAULT 'Default')
2020
/
2121
INSERT INTO null_test(test_case, column_defaulted) VALUES (1,'Value');
2222
INSERT INTO null_test(test_case, column_defaulted) VALUES (2,DEFAULT);
@@ -36,7 +36,7 @@ TEST_CASE COLUMN_DEF
3636
```
3737
CREATE TABLE null_test (
3838
test_case NUMBER(2) NOT NULL
39-
,column_defaulted VARCHAR2(10) DEFAULT ON NULL 'Default')
39+
,column_defaulted VARCHAR2(10 CHAR) DEFAULT ON NULL 'Default')
4040
/
4141
INSERT INTO null_test(test_case, column_defaulted) VALUES (1,'Value');
4242
INSERT INTO null_test(test_case, column_defaulted) VALUES (2,DEFAULT);

docs/stylesheets/extra.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@
7777

7878
[id="we-do-not-agree-with-all-your-standards"],
7979
[id="column"],
80-
[id="sequence"],
81-
[id="temporary-table-global-temporary-table"],
80+
[id="function"],
81+
[id="procedure"],
82+
[id="table"],
83+
[id="view"],
8284
[id="code-commenting"],
8385
[id="variables-types"],
8486
[id="numeric-data-types"],

0 commit comments

Comments
 (0)