Skip to content

Commit 6d9395f

Browse files
authored
Add guidance for auto formatting in TOAD (#26)
This stems from an agreed refactoring of PR #8 (PL/SQL coding standards). It was highlighted in that PR some of the content would be more appropriate as guidance, rather than being a standard we must all follow. So it was suggested to extract and move it into the `/guidance` section of the project. SO the content of this PR comes from @nigejohnson, structure and how the changes were made, was me @Cruikshanks I had to do a certain amount of editing to the format and content of the pre-amble as part of this. The original PR also brought in the idea of all standards needing to be versioned, and these versions having to be referred to, which is something we've also extracted out as a new PR (see #25). As that has yet to be decided I've omitted that content. Also the original contribution marked the content up as headings. That's where I have re-formatted things so we have actual headings, and the extracted text then forms the section content.
1 parent c5c899e commit 6d9395f

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This is the temporary home for standards and guidance relating to software devel
77
- [Guides](/guides)
88
- [Choosing packages](/guides/choosing_packages.md)
99
- [Developer workflows](/guides/developer_workflows.md)
10+
- [PL/SQL auto-format with TOAD](/guides/plsql_auto_format_toad.md)
1011
- [SQL Prompt](/guides/version_control_guidance.md)
1112
- [Version control guidance](/guides/version_control_guidance.md)
1213
- [Principles](/principles)

guides/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ This folder contains various guides to help those working in software developmen
66

77
- [Choosing packages](choosing_packages.md)
88
- [Developer workflows](developer_workflows.md)
9+
- [PL/SQL auto-format with TOAD](plsql_auto_format_toad.md)
910
- [SQL Prompt](sql_prompt.md)
1011
- [Version control guidance](version_control_guidance.md)

guides/defra_plsql_toad_fmt.opt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
[Qp5FormatterOptions]
3+
Version=145
4+
CommaStyle=2
5+
Tagline=0

guides/plsql_auto_format_toad.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PL/SQL Auto-format with TOAD
2+
3+
[Toad](https://en.wikipedia.org/wiki/Toad_(software)) is a
4+
5+
> [..] database management toolset from Quest Software that database developers, database administrators, and data analysts use to manage both relational and non-relational databases using SQL.
6+
7+
Some teams in Defra have licenses for Toad, and use it when working with our Oracle databases.
8+
9+
We have a [standard for PL/SQL](/standards/plsql_coding_standards.md) which can be applied automatically using the auto-format tool in Toad.
10+
11+
## The format file
12+
13+
In these guides is an auto-format `.opt` file that can be used called [defra_plsql_toad_fmt.opt](defra_plsql_toad_fmt.opt).
14+
15+
## Importing the file
16+
17+
In Toad, open an Editor window. Right click on the editor pane and select `Formatting Tools > Formatting Options`.
18+
19+
Select the file open icon at the top left of the screen ("Load options from file" is the tool tip) and then browse to where you have located a copy of the file. Select the file then hit "Apply". Then hit "OK" to close the formatter options window.
20+
21+
## Applying the format
22+
23+
To apply the formatter options to any SQL or PL/SQL code open the code in the Editor Window, right click and then select `Formatting Tools > Format`.

0 commit comments

Comments
 (0)