Top  | Previous | Next

system.db.runSFUpdateQuery

Description

Runs a query through the store and forward system and to multiple datasources at the same time.

Syntax

system.db.runSFUpdateQuery(query, datasources)

Parameters

String query - A query (typically an UPDATE, INSERT, or DELETE) to run.

String[] datasources - List of datasources to run the query through.

Returns

boolean - Returns true if successfully sent to store-and-forward system.

Scope

All

Examples

Example 1: Run through single datasource

 

print system.db.runSFUpdateQuery("INSERT INTO recipes (name, sp1, sp2, sp3) "

 + "VALUES ('A Name', 5, 234, 1)", ["MySQLDatasource"])

 

Example 2: Run through two datasources

 

print system.db.runSFUpdateQuery("INSERT INTO recipes (name, sp1, sp2, sp3) "

 + "VALUES ('A Name', 5, 234, 1)", ["MySQLDatasource", "SQLServerDatasource"])