Skip to content

Commit d9f6f31

Browse files
authored
Merge pull request #7 from demasy/issue#5
Issue#5
2 parents 8c7bb2e + c18b1a6 commit d9f6f31

File tree

10 files changed

+346
-1
lines changed

10 files changed

+346
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/customization-standards-guidelines">**Customization Standards Guidelines**</a>
66
- Oracle AOL Standards Guidelines
7-
- Database Standards Guidelines
7+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines">**Database Standards Guidelines**</a>
88
- OA Framework Standards Guidelines
99
- Report Standards Guidelines
1010
- Workflow Standards Guidelines
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Database Standards Guidelines
2+
3+
- <a href="#general-syntax">**General Syntax**</a>
4+
- <a href="#general-standards">**General Standards**</a>
5+
- <a href="#specific-database-object-types-standards">**Specific Database Object Types Standards**</a>
6+
- Oracle PL/SQL Coding Standards
7+
8+
<br>
9+
10+
## General Syntax
11+
12+
> {custom_schema}{separator}{app_short_name}{separator}[Optional {prefix}{separator}]{object_name}[Optional {separator}{suffix}]
13+
14+
<br>
15+
16+
#### Syntax Elements
17+
18+
| SEQ | Element Syntax | Element Name | Description |
19+
| :-: | :--- | :-- | :-------- |
20+
| 1 | *{custom_schema}* | Custom Database Schema | Database custom ORACLE schema name |
21+
| 2 | *{separator}* | Separator | Must use underscore “_” in database objects|
22+
| 3 | *{app_short_name}* | Application/Product Short Name| This is the application/product short name |
23+
| 4 | *{prefix}* | Prefix | |
24+
| 5 | *{object_name}* | Database Object Name | |
25+
| 6 | *{suffix}* | Suffix | |
26+
27+
28+
<br>
29+
30+
31+
32+
## General Standards
33+
34+
- NEVER modify Oracle standard database objects.
35+
- You must follow standard naming conventions and syntax for creating new database objects.
36+
- The database object name `{object_name}` must be meaningful and brief.
37+
- Do not use generic, all-purpose phrases like ”COMMON”, ”MISC”, ”OTHER”, or ”UTILITY” in the database object name `{object_name}`.
38+
- You must use the underscore “\_” as a separator `{separator}` between each word in the database object name.
39+
- The custom database objects must start with a custom database schema name for example "**XXD**". [^1]
40+
- The application/product short name `{app_short_name}` is a foreign key from Oracle standard table called "FND_APPLICATIONS".
41+
- You must create new database tables, sequences, and types, in the custom schema for example "**XXD**". [^1]
42+
- You must create new database views and packages in the "**APPS**" schema.
43+
- Never create new stand-alone functions and procedures. Should be implemented as part of a package.
44+
- You must use grants and synonyms to allow other ORACLE schemas to access your custom objects and to enable your custom ORACLE ID access to Oracle Applications objects.
45+
- Include header information when you create your objects.
46+
47+
<br>
48+
49+
###### Header Information
50+
51+
```SQL
52+
/*
53+
Name: Create & Post GL Journals
54+
Purpose: This is the main package to create & post GL journals
55+
Arguments
56+
Arg1 Describe arg1
57+
Arg2 Describe arg2
58+
Notes
59+
1. Special usage notes
60+
2. Special usage notes
61+
History
62+
13–NOV–1986 Ahmed El-Demasy Created
63+
*/
64+
```
65+
<br>
66+
67+
## Specific Database Object Types Standards
68+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines/tables-standards">**Tables Standards**</a>
69+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines/sequences-standards">**Sequences Standards**</a>
70+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines/views-standards">**Views Standards**</a>
71+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines/packages-standards">**Packages Standards**</a>
72+
73+
74+
<br>
75+
76+
##### References
77+
[^1]: "**XXD**" is the custom database ORACLE schema association to my custom application called "Demasy Custom Applications".
78+
[^2]: This is a custom table for data upload and migrations **ONLY** and should drop these tables after the upload data process finish.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Appendix
2+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/blob/main/database-standards-guidelines/appendix/database-objects-naming-conventions.md">**Naming Conventions Syntax Elements**</a>
3+
- <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/blob/main/database-standards-guidelines/appendix/syntax-elements-description.md">**Database Custom Objects Naming Conventions**</a>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Database Custom Objects Naming Conventions
2+
3+
<br>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Naming Conventions Syntax Elements
2+
3+
This appendix presents naming conventions and database syntax elements and describes them.
4+
5+
<br>
6+
7+
## Syntax Elements
8+
9+
| SEQ | Element Syntax | Element Name | Description |
10+
| :-: | :--- | :-- | :-------- |
11+
| 1 | *{custom_schema}* | Custom Database Schema | Database custom ORACLE schema name |
12+
| 2 | *{separator}* | Separator | Must use underscore “_” in database objects|
13+
| 3 | *{app_short_name}* | Application/Product Short Name| This is the application/product short name |
14+
| 4 | *{prefix}* | Prefix | |
15+
| 5 | *{object_name}* | Database Object Name | |
16+
| 6 | *{suffix}* | Suffix | |
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Packages Standards
2+
3+
<br>
4+
5+
- Naming Syntax
6+
- <a href="#naming-convention">**Naming Convention**</a>
7+
- <a href="#standards">**Standards**</a>
8+
- Examples
9+
10+
<br>
11+
12+
13+
## Naming Convention
14+
15+
16+
| SEQ | Object Name | Length | Prefix | Suffix | Example |
17+
| :-: | :---- | :-: | :---: | :--- | :---- |
18+
| 1 | Table Handlers Packages | 27 | - | PKG | |
19+
| 1.1 | Insert Procedures | | INS | - | |
20+
| 1.2 | Update Procedures | | UPD | - | |
21+
| 1.3 | Delete Procedures | | DEL | - | |
22+
| 1.4 | Lock Procedures | | LOCK | - | |
23+
| 3 | Public Packages | 27 | - | API | |
24+
| 4 | Private Packages | 27 | - | PVT | |
25+
| 5 | Unit Testing Packages | 30 | UT | - | |
26+
27+
<br>
28+
29+
## Standards
30+
31+
- You MUST follow database custom objects <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines">**general standards**</a>.
32+
- You MUST place the new packages in the "**APPS**" schema.
33+
- The packages name `{object_name}` must be 27 characters or less for table handlers packages, and end with `PKG`.
34+
- The packages name `{object_name}` must be 27 characters or less for public packages, and end with `API`.
35+
- The packages name `{object_name}` must be 27 characters or less for private packages, and end with `PVT`.
36+
- The packages name `{object_name}` must be 30 characters or less for unit testing packages, and start with `UT`.
37+
38+
<br>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Oracle PL/SQL Coding Standards
2+
3+
4+
<br>
5+
6+
- <a href="#syntax">**Syntax**</a>
7+
- <a href="#plsql-objects-naming-convention">**PL/SQL Objects Naming Convention**</a>
8+
- PL/SQL Objects Naming Standards
9+
10+
<br>
11+
12+
13+
## Syntax
14+
15+
> {scope}{separator}[Optional {prefix}{separator}]{identifier_name}[Optional {separator}{suffix}]
16+
17+
<br>
18+
19+
## PL/SQL Objects Naming Convention
20+
21+
| SEQ | Object Name | Length | scope | Prefix | Suffix | Example |
22+
| :- | :---- | :-: | :-- | :--- | :-- | :---- |
23+
| 1 | **Variables** | - | - | - | - | - |
24+
| 1.1 | Global Variable | | g | | | g_enterprise_id |
25+
| 1.2 | Local Variable | | l | | | l_customer_id |
26+
| 2 | **Constants** | - | - | - | - | - |
27+
| 2.1 | Global Constants | | g | c | | gc_max_discount |
28+
| 2.2 | Local Constants | | l | c | | lc_max_discount |
29+
| 3 | **Parameters** | - | | - | - | - |
30+
| 3.1 | Cursor Parameters | | | p | | p_customer |
31+
| 3.2 | In Parameters | | | p | | p_customer_id |
32+
| 3.3 | Out Parameters | | | x | | x_customer_id |
33+
| 3.4 | In/Out Parameters | | | px | | px_customer_id |
34+
| 4 | **Other Objects** | - | | - | - | - |
35+
| 4.1 | Cursors | | | cur | | cur_customers |
36+
| 4.2 | Record | | | r | type | r_customer_type |
37+
| 4.3 | Array / Table | | | t | type | t_customers_type |
38+
| 4.4 | Objects | | | o | type | o_customers_type |
39+
| 4.5 | Exceptions | | | e | | e_customer_exists |
40+
| 4.6 | Exception Number | | | en | | en_customer_exists|
41+
42+
43+
<br>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Sequences Standards
2+
3+
<br>
4+
5+
- Naming Syntax
6+
- <a href="#naming-convention">**Naming Convention**</a>
7+
- <a href="#standards">**Standards**</a>
8+
- Examples
9+
10+
<br>
11+
12+
## Naming Convention
13+
14+
<br>
15+
16+
| SEQ | Object Name | Length | Prefix | Suffix | Example |
17+
| :-: | :---- | :-: | :--- | :--- | :---- |
18+
| 1 | Sequence | 30 | - | SEQ | `XXD_DOCUMENT_ID_SEQ` |
19+
20+
21+
<br>
22+
23+
24+
## Standards
25+
- You MUST follow database custom objects <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines">**general standards**</a>.
26+
- The sequence name `{object_name}` should be 30 characters or less and end with `_SEQ`.
27+
- You must place the new sequence in the custom ORACLE schema, for example, "**XXD**", and grant privileges to the "**APPS**" schema.
28+
- Use each sequence to supply unique ID values for one column of one table.
29+
- Do not design sequences that wrap using the CYCLE option or have limited ranges using MAXVALUE.
30+
- Use a NUMBER datatype to store sequence values within PL/SQL.
31+
- Do Not Use the FND_UNIQUE_IDENTIFIER_CONTROL Table.
32+
33+
<br>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Tables Standards
2+
3+
<br>
4+
5+
- <a href="#naming-syntax">**Naming Syntax**</a>
6+
- <a href="#naming-convention">**Naming Convention**</a>
7+
- <a href="#standards">**Standards**</a>
8+
- <a href="#examples">**Examples**</a>
9+
10+
<br>
11+
12+
## Naming Syntax
13+
14+
##### Syntax
15+
16+
> {custom_schema}{separator}{app_short_name}{separator}[Optional {prefix}{separator}]{object_name}[Optional {separator}{suffix}]
17+
18+
<br>
19+
20+
##### Syntax for data upload tables ONLY
21+
22+
> {prefix}{separator}{app_short_name}{separator}{object_name}
23+
24+
<br>
25+
26+
## Naming Convention
27+
28+
| SEQ | Object Name | Length | Prefix | Suffix | Example |
29+
| :-: | :---- | :-: | :--- | :--- | :---- |
30+
| 1 | Table | 20 | - | - | XXD_PO_LC_DOCUMENTS |
31+
| 2 | Temporary Table | 20 | - | TMP | XXD_PO_LC_DOCS_TMP |
32+
| 3 | Data Upload Table [^1] | 20 | TMP | - | TMP_PO_LC_DOCS |
33+
34+
<br>
35+
36+
## Standards
37+
38+
- You MUST follow database custom objects <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines">**general standards**</a>.
39+
- The table name `{object_name}` should be plural.
40+
- The table name `{object_name}` should be 20 characters or less. It can be longer, but you need to abbreviate it for the table handler package name, which must be 27 characters or less.
41+
- You must place the new tables in the custom ORACLE schema, for example, "**XXD**", and grant privileges to the "**APPS**" schema.
42+
- You must create private synonyms for custom tables in "**APPS**" schema.
43+
- The table MUST include a primary key (PK) column and supply value from a specific sequence.
44+
- You should add special WHO columns to your tables.
45+
- You should add concurrent program WHO columns to your table.
46+
- You should add descriptive flexfield (DFF) attribute columns to your table.
47+
- New tables containing flexfield or Oracle Alert columns must be registered with Oracle Application Object Library (AOL).
48+
- You should register your custom tables with Oracle AOL using the table registration API called "**AD_DD**".
49+
- `AD_DD.REGISTER_TABLE`
50+
- `AD_DD.REGISTER_COLUMN`
51+
52+
<br>
53+
54+
##### WHO columns
55+
56+
| Column Name | Type | Null? | Foreign Key? | Value |
57+
| :-- | :---- | :-: | :-- | :--- |
58+
| CREATED_BY | NUMBER(15) | NOT NULL | FND_USER | TO_NUMBER (FND_ PROFILE.VALUE (’USER_ID’)) |
59+
| CREATION_DATE | DATE | NOT NULL | | SYSDATE |
60+
| LAST_UPDATED_BY | NUMBER(15) | NOT NULL | FND_USER | TO_NUMBER (FND_ PROFILE.VALUE (’USER_ID’)) |
61+
| LAST_UPDATE_DATE | DATE | NOT NULL | | SYSDATE |
62+
| LAST_UPDATE_LOGIN | NUMBER(15) | | | TO_NUMBER (FND_ PROFILE.VALUE (’LOGIN_ ID’)) |
63+
64+
<br>
65+
66+
##### Concurrent Program WHO Columns
67+
68+
| Column Name | Type | Null? | Foreign Key to Table? |
69+
| :-- | :---- | :-: | :-- |
70+
| REQUEST_ID | NUMBER(15) | | FND_CONCURRENT_REQUESTS |
71+
| PROGRAM_APPLICATION_ID | NUMBER(15) | | FND_CONCURRENT_PROGRAMS |
72+
| PROGRAM_ID | NUMBER(15) | | FND_CONCURRENT_PROGRAMS |
73+
| PROGRAM_UPDATE_DATE | DATE | | ROGRAM_UPDATE_DATE |
74+
75+
<br>
76+
77+
## Examples
78+
79+
| Better | Bad |
80+
| :--- | :--- |
81+
| - `XXD_PO_LC_DOCUMENTS` | - `XXD_PO_LC_DOCUMENT` <br> - `PO_LC_DOCUMENTS` |
82+
83+
<br>
84+
85+
##### References
86+
[^1]: This is a custom table for data upload and migrations **ONLY** and should drop these tables after the upload data process finish.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Views Standards
2+
3+
<br>
4+
5+
- <a href="#naming-syntax">**Naming Syntax**</a>
6+
- <a href="#naming-convention">**Naming Convention**</a>
7+
- <a href="#standards">**Standards**</a>
8+
- <a href="#examples">**Examples**</a>
9+
10+
<br>
11+
12+
## Naming Syntax
13+
14+
> {custom_schema}{separator}{app_short_name}{separator}[Optional {prefix}{separator}]{object_name}[Optional {separator}{criteria}][Optional {separator}{suffix}]
15+
16+
17+
<br>
18+
19+
## Naming Convention
20+
21+
| SEQ | Object Name | Length | Prefix | Suffix | Example |
22+
| :-: | :---- | :-: | :---: | :--- | :---- |
23+
| 1 | Views | 30 | - | V | `XXD_PO_LC_DOCUMENTS_V` |
24+
| 2 | Materialized Views | 30 | - | MV | `XXD_PO_LC_DOCUMENTS_MV` |
25+
26+
<br>
27+
28+
## Standards
29+
- You MUST follow database custom objects <a href="https://github.com/demasy/Oracle-EBS-Development-Guidelines/tree/main/database-standards-guidelines">**general standards**</a>.
30+
- The view name `{object_name}` should be 30 characters or less and end with "**V**" for view and "**VM**" for materialized views.
31+
- The first column your view should select is the ROWID for the root table, and the view should alias it to "**ROW_ID**".
32+
- You only need to include the ROWID column if an Oracle Forms block is based on this view.
33+
34+
<br>
35+
36+
## Examples
37+
38+
<br>
39+
40+
| Better | Bad |
41+
| :--- | :--- |
42+
| - `XXD_PER_EMPLOYEE_INFO_V` <br> - `XXD_PO_ORDERS_APPROVED_V` <br> - `XXD_PO_ORDERS_REJECTED_V` <br> - `XXD_INV_ALL_ITEMS_MV` | - `PER_EMPLOYEE_INFO_V` <br> - `XXD_HR_EMPLOYEE_INFO_V` <br> - `XXD_PO_ORDERS_REJECTED`|
43+
44+
<br>
45+

0 commit comments

Comments
 (0)