# ExecuteProcedure

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Oracle/tree/main/Frends.Oracle.ExecuteProcedure>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Command : `String`                | <p>Query to be executed in string format.</p><p><br>Default: <code>-</code><br>Example: <code>"SpGetResultsByAge"</code></p>                                                                                                                                                                                                                                                                                                |
| CommandType : `OracleCommandType` | <p>Type of the command: Command or Stored Procedure.</p><p>Possible values:</p><ul><li><code>Command</code>:</li></ul><p>Type of the command: Command or Stored Procedure.</p><ul><li><code>StoredProcedure</code>:</li></ul><p>Type of the command: Command or Stored Procedure.</p><p><br>Default: <code>1</code><br>Example: <code>Type.StoredProcedure</code></p>                                                       |
| Parameters : `InputParameter[]`   | <p>Parameters for the database query.</p><p><br>Default: <code>-</code><br>Example: <code>{ Name = "ParamName", Value = "1", DataType = QueryParameterType.NVarchar2 }</code></p>                                                                                                                                                                                                                                           |
| 🗝ConnectionString : `String`     | <p>Oracle connection string.</p><p><br>Default: <code>Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT\_DATA=(SERVICE\_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;</code><br>Example: <code>"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT\_DATA=(SERVICE\_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;"</code></p> |
| {% endtab %}                      |                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tab title="Parameter: Output" %}

| Name                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DataReturnType : `OracleCommandReturnType` | <p>Data type for the Result of the procedure.</p><p>Possible values:</p><ul><li><code>XmlString</code>:</li></ul><p>Data type for the Result of the procedure.</p><ul><li><code>XDocument</code>:</li></ul><p>Data type for the Result of the procedure.</p><ul><li><code>AffectedRows</code>:</li></ul><p>Data type for the Result of the procedure.</p><ul><li><code>JSONString</code>:</li></ul><p>Data type for the Result of the procedure.</p><ul><li><code>Parameters</code>:</li></ul><p>Data type for the Result of the procedure.</p><p><br>Default: <code>1</code><br>Example: <code>"SpGetResultsByAge"</code></p> |
| OutputParameters : `OutputParameter[]`     | <p>Parameters for the output of the procedure or command.</p><p><br>Default: <code>-</code><br>Example: <code>{ Name = "name", DataType = QueryParameterType.Varchar2 }</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                                                                                                                                                                                             |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`  | <p>Choose if error should be thrown if Task failes.</p><p>Otherwise returns Object { Success = false }</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                           |
| TimeoutSeconds : `Int32`         | <p>Timeout value in seconds.</p><p><br>Default: <code>30</code><br>Example: <code>30</code></p>                                                                                                                                                                                                         |
| BindParameterByName : `Boolean`  | <p>Choose to bind the parameter by name.</p><p>If set to false parameter order is crucial.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                       |
| ClearConnectionPools : `Boolean` | <p>Choose to clear connection pools after execution.</p><p>This is an internal Oracle setting to clear cached connections.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                       |
| CloseConnection : `Boolean`      | <p>Choose to close the created connection after execution.</p><p>Setting this to false will allow the connection to be reused</p><p>but can cause issues with left open connections or concurrent usage if not handled properly.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| {% endtab %}                     |                                                                                                                                                                                                                                                                                                         |

{% tab title="Result: Result" %}

| Name                | Description                                                                                                                                                                  |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean` | <p>Boolean value of success of the query.<br>Example: <code>true</code></p>                                                                                                  |
| Output : `Object`   | <p>Content and data type depends on task output properties.<br>Example: <code>\[{"ID": "1","FIRST\_NAME": "Saija","LAST\_NAME": "Saijalainen","START\_DATE": ""}]</code></p> |
| Error : `String`    | <p>String value of the Error message that comes from Oracle.<br>Example: <code>"ORA-01722: invalid number"</code></p>                                                        |
| {% endtab %}        |                                                                                                                                                                              |

{% tab title="Changelog" %}

## Changelog

### \[2.4.0] - 2026-03-20

#### Fixed

* Resolve issue with long time execution

#### Added

* Add new options ( `CloseConnection`, `ClearConnectionPools`) to control connection behavior.

### \[2.3.0] - 2025-12-29

#### Fixed

* Improved Oracle parameter handling for NULL values and BLOBs.

### \[2.2.0] - 2025-12-02

#### Fixed

* Fix missing output parameter values

### \[2.1.0] - 2025-03-25

#### Changed

* Update packages: Microsoft.Extensions.DependencyInjection 6.0.0 -> 9.0.3 Newtonsoft.Json 12.0.1 -> 13.0.3 Oracle.ManagedDataAccess.Core 3.21.70 -> 23.7.0 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 coverlet.collector 3.1.0 -> 6.0.4 Microsoft.NET.Test.Sdk 16.6.1 -> 17.13.0 MSTest.TestFramework 2.2.8 -> 3.8.3 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0

### \[2.0.0] - 2022-11-04

#### Fixed

* \[Breaking] change the parameter implementation to resemble other database related Tasks.
* Fixed issue that task was not able to close connection.

### \[1.0.0] - 2022-10-12

#### Added

* Initial implementation.
  {% endtab %}
  {% endtabs %}
