Skip to content

Commit

Permalink
Grammatical edits to DBMS_ASSERT
Browse files Browse the repository at this point in the history
  • Loading branch information
dwicinas committed Aug 14, 2024
1 parent 441073b commit ed074df
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "ENQUOTE_LITERAL"
---

The `ENQUOTE_LITERAL` procedure procedure wraps single quotes around a string literal unless it is already enclosed in single quotes.
The `ENQUOTE_LITERAL` procedure wraps single quotes around a string unless the string is already enclosed in single quotes.

Only an even number of single quotes are allowed in the string, excluding the enclosing quotes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "ENQUOTE_NAME"
---

The `ENQUOTE_NAME` procedure procedure wraps quotation marks around a string literal, even if the input is already enclosed in quotataion marks. The string can include a quotation mark but output for the string is puts quotation marks around the input quotation mark. By default output not included in quotation marks is converted to lower case, but setting a parameter to false means the input string is not converted.
The `ENQUOTE_NAME` procedure wraps quotation marks around a string, even if the input is already enclosed in quotataion marks. The string can include a quotation mark but output for the string puts quotation marks around the input quotation mark. By default output not included in quotation marks is converted to lower case, but setting a parameter to false means the case of input string is not converted.

The following table shows examples of how quotes are handled.

Expand All @@ -12,10 +12,10 @@ The following table shows examples of how quotes are handled.
| "abc" | TRUE | """abc""" |
| "a"bc" | TRUE | """a""bc""" |
| ABC | TRUE | "abc" |
| A | | |
| | | |
| | | |
| BC | FALSE | "ABC" |
| A


BC | FALSE | "ABC" |
| abc | TRUE | "abc" |
| abc | FALSE | "abc" |

Expand All @@ -35,6 +35,6 @@ RETURN VARCHAR2;

`capitalize`

If TRUE, alphabetic characters that are not wrapped in quotation marks are converted to lower case. If FALSE, input strings are not converted to lower case.
If TRUE, alphabetic characters in the input string that are not wrapped in quotation marks are converted to lower case. If FALSE, input strings are not converted to lower case.


Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ navigation:

---

The `DBMS_ASSERT` package helps you sanitize user input to help prevent SQL injections into applications. The following table lists the supported procedures:
The `DBMS_ASSERT` package lets you check user input to help prevent SQL injections into applications. The following table lists the supported procedures:

| Function/procedure | Return type | Description |
| ---------------------| ---------------- | --------------------------------------------- |
| `ENQUOTE_LITERAL` | n/a | Wraps a string in single quotes |
| `ENQUOTE_NAME` | n/a | Wraps quotation marks around a string |
| `NOOP` | `VARCHAR2, CLOB` | Returns a string without any checking |
| `QUALIFIED_SQL_NAME` | `VARCHAR2 | Checks if a string is a qualified SQL name |
| `SCHEMA_NAME` | `VARCHAR2 | Checks if a string is an existing schema name |
| `SIMPLE_SQL_NAME` | `VARCHAR2` | Checks if a string is a simple SQL name |
| `SQL_OBJECT_NAME` | `VARCHAR2` | Checks if a string is a valid SQL identifier |
| Function/procedure | Return type | Description |
| ---------------------| ------------------ | --------------------------------------------- |
| `ENQUOTE_LITERAL` | n/a | Wraps a string in single quotes |
| `ENQUOTE_NAME` | n/a | Wraps quotation marks around a string |
| `NOOP` | `VARCHAR2`, `CLOB` | Returns a string without any checking |
| `QUALIFIED_SQL_NAME` | `VARCHAR2` | Checks if a string is a qualified SQL name |
| `SCHEMA_NAME` | `VARCHAR2` | Checks if a string is an existing schema name |
| `SIMPLE_SQL_NAME` | `VARCHAR2` | Checks if a string is a simple SQL name |
| `SQL_OBJECT_NAME` | `VARCHAR2` | Checks if a string is a valid SQL identifier |
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "QUALIFIED_SQL_NAME"
---

The `QUALIFIED_SQL_NAME` procedure checks to determine if the input string is a valid qualified name.
The `QUALIFIED_SQL_NAME` procedure determines whether the input string is a valid qualified SQL name.


```sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "SCHEMA_NAME"
---

The `SCHEMA_NAME` procedure checks to determine if the input string is an existing schema name. An error occurs if the name is not a valid schema name.
The `SCHEMA_NAME` procedure determines whether the input string is an existing schema name. An error occurs if the name is not a valid schema name.


```sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: "SQL_OBJECT_NAME"
---

The `SQL_OBJECT_NAME` procedure determines whether a string is a valid SQL identifier for a SQL object. An error occurs if a SQL object does not exist.
The `SQL_OBJECT_NAME` procedure determines whether a string is a valid SQL identifier for a SQL object. An error occurs if the SQL object does not exist.

The object can be a partition or subpartition or a database name. Here is the sequence used to validate an object:
The object can be a partition or subpartition or a database name. The following list describes the sequence used to validate an object:

1. Table, view, materialized view, index, sequence, foreign table, partition-table, type, object type
1. Function, procedure, aggregate, routine
Expand All @@ -14,9 +14,9 @@ The object can be a partition or subpartition or a database name. Here is the se
1. Queue, queue table
1. Event trigger

The procedure does not validate sub-objects such as columns or package members.
For example, if the name is `table_name.column_name`, the procedure validates the `table_name` by searching through table names in the search path. After finding the table name, the procedure validates the basic syntax of `column_name`. Similarly, in the case of `package_name.member_name`, after the procedure finds the package name in the search path, it validates only the basic syntax of `member_name`.

For example, if the name is `table_name.column_name`, the procedure validates the `table_name` by searching through table names in the search path. After finding the table name, the procedure validates the basic syntax of `column_name`. Similarly, in the case of `package_name.member_name`, after the procedure finds the package name in the search path, it only validates the basic syntax of `member_name`.
The procedure does not validate sub-objects such as columns or package members.

```sql
SQL_OBJECT_NAME(
Expand Down

0 comments on commit ed074df

Please sign in to comment.