ExecuteQuery
Task for performing queries in an Oracle database.
Task version: 4.0.0
Required Frends version: 5.5+
Required .NET version: 6.0
Compatible Agents: Crossplatform
Task Parameters
Query : String
Query to be executed in string format.
Default: INSERT INTO MyTable (id, first_name, last_name) VALUES (:id, :first_name, :last_name)
Example: "INSERT INTO MyTable (id, first_name, last_name) VALUES (:id, :first_name, :last_name)"
Parameters : QueryParameter[]
Parameters for the database query.
Default: -
Example: [ { Name = "id", Value = 1, DataType = QueryParameterType.Int32 }, { Name = "first_name", Value = "John", DataType = QueryParameterType.Varchar2 }, { Name = "last_name", Value = "Doe", DataType = QueryParameterType.Varchar2 } ]
🗝ConnectionString : String
Oracle connection string.
Default: Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;
Example: Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;
ExecuteType : ExecuteTypes
Specifies how a command string is interpreted.
Auto: ExecuteReader for SELECT-query and NonQuery for UPDATE, INSERT, or DELETE statements.
ExecuteReader: Use this operation to execute any arbitrary SQL statements in Oracle if you want the result set to be returned.
NonQuery: Use this operation to execute any arbitrary SQL statements in Oracle if you do not want any result set to be returned. You can use this operation to create database objects or change data in a database by executing UPDATE, INSERT, or DELETE statements. The return value of this operation is of Int32 data type, and For the UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the SQL statement. For all other types of statements, the return value is -1.
Scalar: Use this operation to execute any arbitrary SQL statements in Oracle to return a single value. This operation returns the value only in the first column of the first row in the result set returned by the SQL statement.
Possible values:
Auto: Specifies how a command string is interpreted.
Auto: ExecuteReader for SELECT-query and NonQuery for UPDATE, INSERT, or DELETE statements.
ExecuteReader: Use this operation to execute any arbitrary SQL statements in Oracle if you want the result set to be returned.
NonQuery: Use this operation to execute any arbitrary SQL statements in Oracle if you do not want any result set to be returned. You can use this operation to create database objects or change data in a database by executing UPDATE, INSERT, or DELETE statements. The return value of this operation is of Int32 data type, and For the UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the SQL statement. For all other types of statements, the return value is -1.
Scalar: Use this operation to execute any arbitrary SQL statements in Oracle to return a single value. This operation returns the value only in the first column of the first row in the result set returned by the SQL statement.
NonQuery: Specifies how a command string is interpreted.
Auto: ExecuteReader for SELECT-query and NonQuery for UPDATE, INSERT, or DELETE statements.
ExecuteReader: Use this operation to execute any arbitrary SQL statements in Oracle if you want the result set to be returned.
NonQuery: Use this operation to execute any arbitrary SQL statements in Oracle if you do not want any result set to be returned. You can use this operation to create database objects or change data in a database by executing UPDATE, INSERT, or DELETE statements. The return value of this operation is of Int32 data type, and For the UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the SQL statement. For all other types of statements, the return value is -1.
Scalar: Use this operation to execute any arbitrary SQL statements in Oracle to return a single value. This operation returns the value only in the first column of the first row in the result set returned by the SQL statement.
Scalar: Specifies how a command string is interpreted.
Auto: ExecuteReader for SELECT-query and NonQuery for UPDATE, INSERT, or DELETE statements.
ExecuteReader: Use this operation to execute any arbitrary SQL statements in Oracle if you want the result set to be returned.
NonQuery: Use this operation to execute any arbitrary SQL statements in Oracle if you do not want any result set to be returned. You can use this operation to create database objects or change data in a database by executing UPDATE, INSERT, or DELETE statements. The return value of this operation is of Int32 data type, and For the UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the SQL statement. For all other types of statements, the return value is -1.
Scalar: Use this operation to execute any arbitrary SQL statements in Oracle to return a single value. This operation returns the value only in the first column of the first row in the result set returned by the SQL statement.
ExecuteReader: Specifies how a command string is interpreted.
Auto: ExecuteReader for SELECT-query and NonQuery for UPDATE, INSERT, or DELETE statements.
ExecuteReader: Use this operation to execute any arbitrary SQL statements in Oracle if you want the result set to be returned.
NonQuery: Use this operation to execute any arbitrary SQL statements in Oracle if you do not want any result set to be returned. You can use this operation to create database objects or change data in a database by executing UPDATE, INSERT, or DELETE statements. The return value of this operation is of Int32 data type, and For the UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the SQL statement. For all other types of statements, the return value is -1.
Scalar: Use this operation to execute any arbitrary SQL statements in Oracle to return a single value. This operation returns the value only in the first column of the first row in the result set returned by the SQL statement.
Default: 0
Example: ExecuteType.ExecuteReader
ThrowErrorOnFailure : Boolean
Choose if an error should be thrown if the Task fails.
Otherwise, returns Object { Success = false }
Default: True
Example: true
TimeoutSeconds : Int32
Timeout value in seconds.
Default: 30
Example: 30
OracleIsolationLevel : TransactionIsolationLevel
Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
Possible values:
Default: Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
None: Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
ReadUncommitted: Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
ReadCommitted: Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
RepeatableRead: Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
Serializable: Transaction isolation level for the query.
Options:
- Default
- ReadCommited
- None
- Serializable
- ReadUncommited
- RepeatableRead
Additional information can be found from here
Default: 0
Example: Default
BindParameterByName : Boolean
Choose to bind the parameter by name.
If set to false parameter order is crucial.
Default: True
Example: true
EnableSafeNumericMapping : Boolean
When true, attempts to safely map high-precision Oracle numbers to .NET types
by rounding the scale. (Oracle can store up to 38 digits, while .NET only 29)
Note: Whole numbers exceeding 29 digits may still fail
Default: False
Example: false
Task Result
Success : Boolean
Boolean value of success of the query
Example: true
Message : String
String value of the Error message that comes from Oracle.
Example: "ORA-01722: invalid number"
Output : Object
List of JObjects showing the output of the query.
Example: [{"ID": "1","FIRST_NAME": "Saija","LAST_NAME": "Saijalainen","START_DATE": ""}]
Task Changelog
Changelog for Task Frends.Oracle.ExecuteQuery.
[4.0.0] - 2026-02-26
Fixed
Fixed the issue with converting query results to JToken in Auto mode.
Added
[Breaking Change] Added an option to enable rounding of decimal values.
Changed
Error related to parsing values is more descriptive now.
[Breaking Change] Normalize behavior between Auto and ExecuteReader mode.
[3.2.0] - 2025-03-25
Changed
Update packages: Microsoft.Extensions.DependencyInjection 5.0.1 -> 9.0.3 Oracle.ManagedDataAccess.Core 3.21.170 -> 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
[3.1.0] - 2025-03-25
Fixed
Fixed issue with converting query results to JToken.
Updated Newtonsoft.Json to version 13.0.3.
Updated Oracle.ManagedDataAccess.Core to version 3.21.170.
[3.0.0] - 2025-03-24
Added
[Breaking] New 'ExecuteType' parameter to control how SQL command string is executed.
Default value for new parameter is 'Auto'
Use the default parameter if you want the Task to work as before.
[2.0.1] - 2022-11-04
Fixed
Fixed issue which resulted to task not able to close connection.
[2.0.0] - 2022-10-31
Fixed
[Breaking] Simplified implementation and merged ConnectionProperties and QueryProperties classes into one Input class.
Changed the result output object to be dynamic to enable dot notation.
Changed the implementation to resemble other database related tasks.
Modified the task to be asynchronous.
Changed the task use different methods when doing 'select' query and when doing other queries.
Updated workflow for Linux based testing and enabled the tests.
[1.0.0] - 2022-04-22
Added
Initial implementation.
Last updated
Was this helpful?

