Home >  User Guide - UPLINX Report Tool > Generating Reports from the Command Line for Scripting and Scheduling > Example 3 - Generate CSV Output for Several SQL Commands

  Example 3 - Generate CSV Output for Several SQL Commands

 

 

 

 

Several SQL commands and associated output files can be defined in a XML file. The Report Tool is then run with the option /sqlxmlfile “XMLfile” to produce the output files.

A sample file is included in the install in the file “sqlxmlsample.txt”. The format must look similar to the following:

<?xml version="1.0"?>

<SqlXMLDataC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <SqlXMLlist>

    <SqlXMLC>

      <sqlcmd>select * from enduser</sqlcmd>

      <csvfile>C:\endusers.csv</csvfile>

      <csvheader>true</csvheader>

    </SqlXMLC>

    <SqlXMLC>

      <sqlcmd>select * from device</sqlcmd>

      <csvfile>C:\devices.csv</csvfile>

      <csvheader>false</csvheader>

    </SqlXMLC>

  </SqlXMLlist>

</SqlXMLDataC>

To execute these SQL commands and to generate the specified output files, the command is:

ReportTool.exe /sqlxmlfile "sqlxmlsample.txt"

Other options which specify the CUCM IP address or credentials can be added. If no other options are specified, the default settings are used. To set these default settings, run Report Tool in GUI mode and set the CUCM access details on the server tab and verify it by clicking the Test button.

 

 

 

Copyright © 2024 UPLINX - Last updated 26 Feb 2024