Next Topic

Previous Topic

Book Contents

sqlWrite()

Updates the database—such as updating the value in a column or inserting a row—by running a selected SQL "write" statement. Global "write" statements are specified in the following location: <Kaseya_Installation_Directory>\xml\Procedures\AgentProcSQL\0\SQLWrite\<filename.xml> Filenames can be any name with an .xml extension so long as they are formatted correctly internally. Multiple statements specified using one or more XML files display as a single combined combo box list in the user interface. Each SQL statement in the XML file has a unique label, and only the labels are shown in the combo box. If no SQL statements are defined, then *No Approved SQL* displays in the combo box.

Partition-Specific Statements

Partition-specific folders can contain partition-specific SQL statements. For example: <Kaseya_Installation_Directory>\xml\Procedures\AgentProcSQL\123456789\SQLWrite\<filename.xml>. Users can select and run all 0 folder SQL "write" statements and all SQL "write" statements located in the partition path that matches the partition they are using.

Example Format

<?xml version="1.0" encoding="utf-8" ?>
<queryList>
    <queryDef label="Update Table" sql="UPDATE table1 SET column2 = value2 WHERE column1 = value1" />
</queryList>

Example

sqlWrite("Update Table", "All Operating Systems", "Halt on Fail")