OTX Reference  
OpenTestSystem.Otx.Extensions.SQL.Actions.ExecuteUpdate Class Reference

An INSERT, UPDATE or DELETE statement or an OTX SQL Extension statement More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.SQL.Actions.ExecuteUpdate:
Inheritance graph

Public Attributes

ConnectionTerm connection
 This element represents an open Connection. More...
 
IntegerVariable result
 Returns the row count for SQL Data Manipulation statements or 0 for SQL statements that return nothing. More...
 
StringTerm statement
 Mandatory SQL statement string which is send to the database. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Actions.ActionRealisation
OtxLink validFor
 Validity of ActionRealisation. More...
 

Detailed Description

An INSERT, UPDATE or DELETE statement or an OTX SQL Extension statement

The ExecuteUpdate action executes the given SQL statement, which may be an INSERT, UPDATE or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

Exceptions
Exceptions.CommandException
Exceptions.ConnectionException
Syntax
SQL.ExecuteUpdate(ConnectionTerm connection, StringTerm statement, IntegerVariable result);
IntegerVariable result
Returns the row count for SQL Data Manipulation statements or 0 for SQL statements that return nothin...
Definition: SQL.cs:449
ConnectionTerm connection
This element represents an open Connection.
Definition: SQL.cs:429
StringTerm statement
Mandatory SQL statement string which is send to the database.
Definition: SQL.cs:439
Examples
// Local Declarations
SQL.Connection Connection1;
SQL.ResultSet ResultSet1;
Integer Integer1;
List<Boolean> List1;
// Flow
try
{
// connect with DotNet platform
Connection1 = SQL.CreateConnection("DRIVER={SQL Server};Server=.;InitialCatalog=classicmodels;username=sa;password=saas");
}
catch (Exception)
{
// connect with Java platform
Connection1 = SQL.CreateConnection("jdbc:sqlserver://localhost;databaseName=classicmodels;username=sa;password=saas");
}
catch (Exception Exception1)
{
throw Exception1;
}
try
{
SQL.ExecuteUpdate(Connection1, "UPDATE classicmodels.dbo.visits SET first_name = N'Steven' ,visited_at = getdate(),phone = N'0123456789',store_id = 19,has_buy_product = 1 WHERE last_name = N'Jorg'", Integer1);
}
catch (SQL.CommandException Exception1)
{
throw Exception1;
}
catch (SQL.ConnectionException Exception1)
{
throw Exception1;
}
finally
{
SQL.CloseConnection(Connection1);
}

Member Data Documentation

◆ connection

ConnectionTerm OpenTestSystem.Otx.Extensions.SQL.Actions.ExecuteUpdate.connection

This element represents an open Connection.

◆ result

IntegerVariable OpenTestSystem.Otx.Extensions.SQL.Actions.ExecuteUpdate.result

Returns the row count for SQL Data Manipulation statements or 0 for SQL statements that return nothing.

◆ statement

StringTerm OpenTestSystem.Otx.Extensions.SQL.Actions.ExecuteUpdate.statement

Mandatory SQL statement string which is send to the database.