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

Feature/2023.11/feature-14075-OracleConnectionDetails #84

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,12 @@ The exceptions thrown by the block can be found below:
| [CommandException][] | Thrown when the data source was not found or was not accessible. |
| | Thrown when an error occurs whilst trying to open a new connection. |
| | Thrown when a connection is successfully established but an error occurred during the login process. |
| | Thrown when the [Command][Command Property] contains syntax errors. The error will contain a nested [SqlException][] with a corresponding [SqlException Error Code][SqlException Error Codes]. |
| | Thrown when the [Command][Command Property] contains syntax errors. The error will contain either a nested [SqlException][] with a corresponding [SqlException Error Code][SqlException Error Codes], or a nested [ParserException][] (Oracle Only). |
| | Thrown when the [Command][Command Property] is invalid for the table specified. |
| | Thrown when the [Command][Command Property] references a non-existent stored procedure. |
| | Thrown when parameters derives from [Array][] or [IEnumerable][] when a [Query Statement][Query Statements] is executed. |
| | Thrown when an [Command][] contains multiple statements. |
| | Thrown when a [Command][] or [Commands][] contains an [OracleBlockStatement][] statements. (Oracle Only)|

## Remarks

Expand Down Expand Up @@ -585,7 +586,7 @@ For a [Non Query Statement][Non Query Statements] (e.g. insert, update, delete,

| [Result][Result Property] will be set to                                                                                        | when |
|-|-|
| `null` | always, as [Non Query Statements][] do not return data |
| `[]` | always, as [Non Query Statements][] do not return data |

Note use a [QueryCommand][] for commands that have dependency between their statements (e.g. Cursors and Variables) and return data from the data source. Please see [Complex Commands][] for more information.

Expand Down Expand Up @@ -742,6 +743,7 @@ When using a [Parameterised Command][Parameterised Commands] to execute a stored

[ConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.ConnectionDetails.MainDoc" >}}
[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" >}}
[Boolean]: {{< url path="Cortex.Reference.DataTypes.ConditionalLogic.Boolean.MainDoc" >}}
[dynamic]: {{< url path="Cortex.Reference.DataTypes.All.dynamic.MainDoc" >}}
Expand Down Expand Up @@ -783,4 +785,5 @@ When using a [Parameterised Command][Parameterised Commands] to execute a stored

[Advanced]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.AdvancedProperties.MainDoc" >}}

[OracleBlockStatement]: {{< url path="Oracle.PL-SQL.BlockStatement" >}}
[SQL Injection]: {{< url path="W3.SqlInjection" >}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Oracle"
linkTitle: "Oracle"
description: "Information regarding Oracle as a data source."
---

# {{% param title %}}

{{< workinprogress >}}

## Summary

TODO:

- Summary
- Table or other format to display verified data sources (e.g. postgres, mysql, access, excel, oracle) and examples (link to connection strings)

## Remarks

### Known Limitations

TODO

## See Also

### Related Concepts

TODO

### Related Data Types

TODO

### Related Blocks

TODO

### External Documentation

TODO
260 changes: 218 additions & 42 deletions content/en/docs/2023.11/Reference/Exceptions/data/command-exception.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,239 @@ description: "Exception thrown when any command execution has resulted in an exc

<p class="namespace">(Cortex.Exceptions.Data.CommandException)</p>

## Description

Exception thrown when any command execution has resulted in an exception being thrown.

The format of the exception message is as follows:
## Reasons

### Connection Failed {#connection}

The connection to the data source failed.

#### Message Format

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

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

TODO: This is an example of how we can do exceptions with categories and error codes

| Category | Error Code | Notes |
|--------------------|--------------|------------------------------------------|
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |
| BasicCredentials | 300 | Some notes |
| | 301 | Some notes |
| | 302 | Some notes |

## BasicCredentials.AccessTokenUri

### 300
where:

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

#### How to fix

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

### 301
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}

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

#### Message Format

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

```json
"'CommandText' contains a block statement; it must be provided with a non-block statement.
Please click the HelpLink for more information on how to fix this."
```

#### How to fix

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

### Multiple Statements {#multiplestatements}

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

### 302
#### Message Format

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

```json
"'CommandText' contains multiple statements; it must be provided with a single statement.
Please click the HelpLink for more information on how to fix this."
```

#### How to fix

TODO:
Use a [Commands][] data type.

### Runtime {#runtime}

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

#### 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

Try to make sure that the statement(s) are valid.

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

## Properties

### Exception Type

The type of the exception (i.e. `CommandException`).

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

### Message

The exception message, providing information about the exception that occurred.

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

### Category

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

For `CommandException` there are the following categories:

- `Connection`
- `IncompatibleStatementType`
- `MultipleStatements`
- `Runtime`

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

### InnerException

An optional property that may contain the exception that caused the current exception.

| | |
|-----------|---------------|
| Data Type | [Exception][] |

### StatementExceptions

An optional property that may contain a list of exception(s) relating to the execution of one or more of the statements specified in the [Command Property][CommandProperty].

| | |
|-----------|---------------|
| Data Type | [List][]&lt;[Exception][]&gt; |

### Help Link

The URL for the relevant section of this exception's help page.

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

## Remarks

### Known Limitations

None

## See Also

### Related Data Types

- [Command][]
- [Commands][]
- [ConnectionDetails][]
- [Exception][]
- [NonQueryCommand][]
- [OdbcConnectionDetails][]
- [OracleConnectionDetails][]
- [QueryCommand][]
- [SqlServerConnectionDetails][]
- [String][]

### Related Concepts

- [Exceptions][]
- [Working With Data Sources][]

### Related Blocks

- Data
- [Execute Data Command][]

### External Documentation

[OracleBlockStatement][]

[Message]: {{< ref "#message" >}}
[InnerException]: {{< ref "#innerexception" >}}
[StatementExceptions]: {{< ref "#statementexceptions" >}}

[Input]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Input" >}}
[Output]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.WhatIsABlockProperty.Output" >}}

[PropertyNullException]: {{< url path="Cortex.Reference.Exceptions.Common.Property.PropertyNullException.MainDoc" >}}
[PropertyEmptyException]: {{< url path="Cortex.Reference.Exceptions.Common.Property.PropertyEmptyException.MainDoc" >}}
[ArgumentException]: {{< url path="MSDocs.DotNet.Api.System.ArgumentException" >}}
[InvalidConnectionStringException]: {{< url path="Cortex.Reference.Exceptions.Data.InvalidConnectionStringException.MainDoc" >}}
[CommandException]: {{< url path="Cortex.Reference.Exceptions.Data.CommandException.MainDoc" >}}

[ConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.ConnectionDetails.MainDoc" >}}
[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" >}}
[Boolean]: {{< url path="Cortex.Reference.DataTypes.ConditionalLogic.Boolean.MainDoc" >}}
[dynamic]: {{< url path="Cortex.Reference.DataTypes.All.dynamic.MainDoc" >}}

[Execute Data Command]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.MainDoc" >}}

[TConnectionDetails]: {{< url path="Cortex.Reference.Concepts.Fundamentals.DataTypes.Generics.MainDoc" >}}

[List]: {{< url path="Cortex.Reference.DataTypes.Collections.List.MainDoc" >}}
[Structure]: {{< url path="Cortex.Reference.DataTypes.Collections.Structure.MainDoc" >}}
[Int32]: {{< url path="Cortex.Reference.DataTypes.Numbers.Int32.MainDoc" >}}
[Array]: {{< url path="Cortex.Reference.DataTypes.Collections.Array.MainDoc" >}}
[IEnumerable]: {{< url path="Cortex.Reference.DataTypes.Collections.IEnumerable_TItem.MainDoc" >}}
[String]: {{< url path="Cortex.Reference.DataTypes.Text.String.MainDoc" >}}
[Exception]: {{< url path="Cortex.Reference.DataTypes.Exceptions.Exception.MainDoc" >}}

[CommandProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.CommandProperty" >}}
[ConnectionDetailsProperty]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.ConnectionDetailsProperty" >}}
[DataCommand]: {{< url path="Cortex.Reference.DataTypes.Data.DataCommand.MainDoc" >}}
[DataCommand.CommandText]: {{< url path="Cortex.Reference.DataTypes.Data.DataCommand.CommandText" >}}

[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" >}}

[Expression]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.ExpressionEditor.MainDoc" >}}
[Variable Editor]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.VariableEditor.MainDoc" >}}
[Variable]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.VariableEditor.MainDoc" >}}
[Literal]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Blocks.BlockProperties.PropertyEditors.LiteralEditor.MainDoc" >}}
[String Interpolation]: {{< url path="Cortex.Reference.Concepts.WorkingWith.Text.ConvertingObjectsToText.StringInterpolation" >}}
[Working with Data Sources]: {{< url path="Cortex.Reference.Concepts.WorkingWith.DataSources.MainDoc" >}}
[Connection String Formats]: {{< url path="ConnectionStrings.MainDoc" >}}
[Variables]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Variables.MainDoc" >}}
[Object Casting]: {{< url path="Cortex.Reference.Concepts.WorkingWith.Objects.ObjectCasting.MainDoc" >}}

[Exceptions]: {{< url path="Cortex.Reference.Concepts.Fundamentals.Exceptions.MainDoc" >}}

[OracleBlockStatement]: {{< url path="Oracle.PL-SQL.BlockStatement" >}}
12 changes: 12 additions & 0 deletions content/en/docs/2023.11/Reference/data-types/data/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ Currently, if the `ToString()` method is used on a `Command`, then its Full Name

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.

## See Also

### Related Data Types
Expand All @@ -114,6 +118,7 @@ In future this limitation may be removed.

### External Documentation

* [OracleBlockStatement][]
* [SQL Injection][]

[CommandText]: {{< ref "#command-text" >}}
Expand All @@ -128,6 +133,7 @@ In future this limitation may be removed.
[Executing Multiple Commands (Unsafe)]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.ExecutingMultipleCommandsUnsafe" >}}
[Block: Parameterised Commands]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.ParameterisedCommands" >}}
[Statements]: {{< url path="Cortex.Reference.Blocks.Data.ExecuteDataCommand.ExecuteDataCommand.Statements" >}}
[OracleConnectionDetails]: {{< url path="Cortex.Reference.DataTypes.Data.OracleConnectionDetails.MainDoc" >}}

[Convert Object To Text]: {{< url path="Cortex.Reference.Blocks.Objects.ConvertObject.ConvertObjectToText.MainDoc" >}}
[Convert Object To Json]: {{< url path="Cortex.Reference.Blocks.Json.ConvertJson.ConvertObjectToJson.MainDoc" >}}
Expand All @@ -140,5 +146,11 @@ In future this limitation may be removed.
[Commands]: {{< url path="Cortex.Reference.DataTypes.Data.Commands.MainDoc" >}}
[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" >}}
[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" >}}

[OracleBlockStatement]: {{< url path="Oracle.PL-SQL.BlockStatement" >}}
[SQL Injection]: {{< url path="W3.SqlInjection" >}}
Loading
Loading