Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DataCommandErrorCode,CommandException change #93

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
4 changes: 2 additions & 2 deletions content/en/docs/2023.11/Reference/data-types/data/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In future this limitation may be removed.

#### Block Statements Incompatible (Oracle Only)

Using an [OracleBlockStatement][] in the [CommandText][] will throw a [Command Exception][CommandExceptionIncompatibleStatementType]. You must use either a [QueryCommand][] or [NonQueryCommand][] instead.
Using an [OracleBlockStatement][] in the [CommandText][] will throw a [Command Exception][CommandExceptionIncompatibleStatementTypeOld]. You must use either a [QueryCommand][] or [NonQueryCommand][] instead.

## See Also

Expand Down Expand Up @@ -147,7 +147,7 @@ Using an [OracleBlockStatement][] in the [CommandText][] will throw a [Command E
[QueryCommand]: {{< url path="Cortex.Reference.DataTypes.Data.QueryCommand.MainDoc" >}}
[NonQueryCommand]: {{< url path="Cortex.Reference.DataTypes.Data.NonQueryCommand.MainDoc" >}}
[CommandException]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.MainDoc" >}}
[CommandExceptionIncompatibleStatementType]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.IncompatibleStatementType" >}}
[CommandExceptionIncompatibleStatementTypeOld]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.IncompatibleStatementTypeOld" >}}
[ConnectionDetailsProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.ConnectionDetailsProperty" >}}
[CommandProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.CommandProperty" >}}
[Command]: {{< url path="Cortex.Reference.DataTypes.Data.Command.MainDoc" >}}
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/2023.11/Reference/data-types/data/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In future this limitation may be removed.

#### Block Statements Incompatible (Oracle Only)

Using an [OracleBlockStatement][] in the [CommandText][] will throw a [Command Exception][CommandExceptionIncompatibleStatementType]. You must use either a [QueryCommand][] or [NonQueryCommand][] instead.
Using an [OracleBlockStatement][] in the [CommandText][] will throw a [Command Exception][CommandExceptionIncompatibleStatementTypeOld]. You must use either a [QueryCommand][] or [NonQueryCommand][] instead.

## See Also

Expand Down Expand Up @@ -150,7 +150,7 @@ Using an [OracleBlockStatement][] in the [CommandText][] will throw a [Command E
[CommandProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.CommandProperty" >}}
[OracleConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.OracleConnectionDetails.MainDoc" >}}
[CommandException]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.MainDoc" >}}
[CommandExceptionIncompatibleStatementType]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.IncompatibleStatementType" >}}
[CommandExceptionIncompatibleStatementTypeOld]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.IncompatibleStatementTypeOld" >}}

[OracleBlockStatement]: {{< url path="Oracle.PL-SQL.BlockStatement" >}}
[SQL Injection]: {{< url path="W3.SqlInjection" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In future this limitation may be removed.

#### Multiple SQL Commands (Oracle Only)

For Oracle you must use [block statement syntax][OracleBlockStatement] to execute multiple commands, otherwise a [CommandException][CommandExceptionRuntime] will be thrown.
For Oracle you must use [block statement syntax][OracleBlockStatement] to execute multiple commands, otherwise a [CommandException][CommandExceptionRuntimeOld] will be thrown.

## See Also

Expand Down Expand Up @@ -146,7 +146,7 @@ For Oracle you must use [block statement syntax][OracleBlockStatement] to execut
[Commands]: {{< url path="Cortex.Reference.DataTypes.Data.Commands.MainDoc" >}}
[QueryCommand]: {{< url path="Cortex.Reference.DataTypes.Data.QueryCommand.MainDoc" >}}
[CommandProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.CommandProperty" >}}
[CommandExceptionRuntime]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.Runtime" >}}
[CommandExceptionRuntimeOld]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.RuntimeOld" >}}

[OracleBlockStatement]: {{< url path="Oracle.PL-SQL.BlockStatement" >}}
[SQL Injection]: {{< url path="W3.SqlInjection" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In future this limitation may be removed.

#### Multiple SQL Commands (Oracle Only)

For Oracle you must use [block statement syntax][OracleBlockStatement] to execute multiple commands, otherwise a [CommandException][CommandExceptionRuntime] will be thrown.
For Oracle you must use [block statement syntax][OracleBlockStatement] to execute multiple commands, otherwise a [CommandException][CommandExceptionRuntimeOld] will be thrown.

## See Also

Expand Down Expand Up @@ -146,7 +146,7 @@ For Oracle you must use [block statement syntax][OracleBlockStatement] to execut
[Commands]: {{< url path="Cortex.Reference.DataTypes.Data.Commands.MainDoc" >}}
[NonQueryCommand]: {{< url path="Cortex.Reference.DataTypes.Data.NonQueryCommand.MainDoc" >}}
[CommandProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.CommandProperty" >}}
[CommandExceptionRuntime]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.Runtime" >}}
[CommandExceptionRuntimeOld]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.RuntimeOld" >}}

[OracleBlockStatement]: {{< url path="Oracle.PL-SQL.BlockStatement" >}}
[SQL Injection]: {{< url path="W3.SqlInjection" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Exception thrown when any command execution has resulted in an exception being t

## Reasons

### Connection Failed {#connection}
### Connection Failed {#1000}

The connection to the data source failed.

Expand All @@ -23,21 +23,40 @@ The connection to the data source failed.
The format of the [Message][] is as follows:

```json
"Failed to open the '<database-type>' connection.
"Failed to open the '<data-source-type>' connection.
Please click the HelpLink for more information on how to fix this."
```

where:

- `<database-type>` is the type of the database (e.g. SqlServer, Oracle).
- `<data-source-type>` is the type of the data source (e.g. SqlServer, Oracle).

#### How to fix

Make sure that the [Connection Details Property][ConnectionDetailsProperty] has been given a valid connection string, and that the data source is active.

More information on why the value is invalid, or instruction on how to provide a valid value, may be present in the [InnerException][].

### Incompatible Statement Type (Oracle Only) {#incompatiblestatementtype}
### Statement {#2000}

The statement(s) used could not be parsed.

#### Message Format

The format of the [Message][] is as follows:

```json
"An error occurred whilst trying to execute the command provided. Please see the 'StatementExceptions' property for more details.
Please click the HelpLink for more information on how to fix this."
```

#### How to fix

Make sure that the statement(s) inputted into the [Command Property][CommandProperty] have the correct syntax.

More information on why the value is invalid, or instruction on how to provide a valid value, may be present in the [StatementExceptions][].

### Incompatible Statement Type (Oracle Only) {#2001}

An [OracleBlockStatement][] has been used in the [Command Property][CommandProperty] when using a [Command][] or [Commands][] data type.

Expand All @@ -54,7 +73,7 @@ Please click the HelpLink for more information on how to fix this."

Use a [QueryCommand][] or [NonQueryCommand][] data type.

### Multiple Statements {#multiplestatements}
### Multiple Statements {#2002}

Multiple statements have been passed into the [Command Property][CommandProperty] when using a [Command][] data type.

Expand All @@ -71,7 +90,7 @@ Please click the HelpLink for more information on how to fix this."

Use a [Commands][] data type.

### Runtime {#runtime}
### Runtime {#3000}

An error has occurred during either parsing or execution of the statement(s).

Expand Down Expand Up @@ -110,19 +129,34 @@ The exception message, providing information about the exception that occurred.

### Category

The category of the exception, which is used to categorise an exception if there are multiple reasons that the exception can occur.
The category of the exception, which is used to categorise an exception based on the type of data source used.

For `CommandException` there are the following categories:

- `Connection`
- `IncompatibleStatementType`
- `MultipleStatements`
- `Runtime`
- `ODBC`
- `Oracle`
- `SQL`

| | |
|-----------|------------|
| Data Type | [String][] |

### Error Code

The error code for the exception, which is used to indicate the reason that the exception occurred, if there are multiple reasons that the exception can occur.

For `CommandException` there are the following error codes:

- [1000][Connection] - indicates that a [Connection][] error has occurred during the connection process (All Categories)
- [2000][Statement] - indicates that a [Statement][] error has occurred during the parsing process (Oracle Category Only)
- [2001][IncompatibleStatementType] - indicates that a [IncompatibleStatementType][] error has occured due to an [OracleBlockStatement][] being used in the [Command Property][CommandProperty] when using a [Command][] or [Commands][] data type (Oracle Category Only)
- [2002][MultipleStatements] - indicates that a [MultipleStatements][] error has occured because multiple statements have been inputted into the [Command Property][CommandProperty] when using the [Command][] datatype (All Categories)
- [3000][Runtime] - indicates that a [Runtime][] error has occurred during the runtime process (All Categories)

| | |
|-----------|---------------------------|
| Data Type | [DataCommandErrorCode][] |

### InnerException

An optional property that may contain the exception that caused the current exception.
Expand Down Expand Up @@ -160,6 +194,7 @@ None
- [Command][]
- [Commands][]
- [ConnectionDetails][]
- [DataCommandErrorCode][]
- [Exception][]
- [NonQueryCommand][]
- [OdbcConnectionDetails][]
Expand All @@ -180,8 +215,13 @@ None

### External Documentation

[OracleBlockStatement][]
- [OracleBlockStatement][]

[Connection]: {{< ref "#1000">}}
[Statement]: {{< ref "#2000">}}
[IncompatibleStatementType]: {{< ref "#2001">}}
[MultipleStatements]: {{< ref "#2002">}}
[Runtime]: {{< ref "#3000">}}
[Message]: {{< ref "#message" >}}
[InnerException]: {{< ref "#innerexception" >}}
[StatementExceptions]: {{< ref "#statementexceptions" >}}
Expand All @@ -199,6 +239,7 @@ None
[SqlServerConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.SqlServerConnectionDetails.MainDoc" >}}
[OracleConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.OracleConnectionDetails.MainDoc" >}}
[OdbcConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.OdbcConnectionDetails.MainDoc" >}}
[DataCommandErrorCode]: {{< url path="Cortex.Reference.DataTypes.Data.DataCommandErrorCode.MainDoc" >}}
[Boolean]: {{< url path="Cortex.Reference.DataTypes.ConditionalLogic.Boolean.MainDoc" >}}
[dynamic]: {{< url path="Cortex.Reference.DataTypes.All.dynamic.MainDoc" >}}

Expand All @@ -221,13 +262,10 @@ None

[Command]: {{< url path="Cortex.Reference.DataTypes.Data.Command.MainDoc" >}}
[Command.CommandText]: {{< url path="Cortex.Reference.DataTypes.Data.Command.CommandText" >}}

[Commands]: {{< url path="Cortex.Reference.DataTypes.Data.Commands.MainDoc" >}}
[Commands.CommandText]: {{< url path="Cortex.Reference.DataTypes.Data.Commands.CommandText" >}}

[QueryCommand]: {{< url path="Cortex.Reference.DataTypes.Data.QueryCommand.MainDoc" >}}
[QueryCommand.CommandText]: {{< url path="Cortex.Reference.DataTypes.Data.QueryCommand.CommandText" >}}

[NonQueryCommand]: {{< url path="Cortex.Reference.DataTypes.Data.NonQueryCommand.MainDoc" >}}
[NonQueryCommand.CommandText]: {{< url path="Cortex.Reference.DataTypes.Data.NonQueryCommand.CommandText" >}}

Expand Down
Loading
Loading