$Database.ExecuteNonQuery

Overview

Creates a connection to the relevant system with the information defined on the domain and runs the query. Returns the number of affected rows

number $Database.ExecuteNonQuery(connectionName: string, query: string, parameters: object, timeout: number)

Arguments

string connectionName

name of external database name

string query

query to be run

object parameters

parameters set on the query. Optional.

number timeout

request timeout. Optional.

Remarks

This method is used to run a query on an external database. The connection name is defined on the domain settings with a connection string to database.

Query dialect is based on external database type and directly executed on the database.

Timeout parameter is used to specify the maximum time to wait for the query to execute, if not specified default timeout is used.

Example

$Database.ExecuteNonQuery("AppDB", "delete Users where Id = @Id", { Id: "1" });

See Also

Copyright © 2010 - 2023 Emakin. All rights reserved.