ODBC Select
This task will execute an SQL query and return a data set back in XML format.
Settings
Output File
Required
The XML file to output results to.
Root
Required
The name to use for root node in the output XML file (e.g. Customers).
Row
Required
The name to use for each row in the output XML file (e.g. Customer).
Parameter Field
Optional
Parameter to use when building the output file.
Parameter Input File
Optional
The file containing the parameters that will be replaced in the query.
Parameter Output File
Optional
The file that will contain the parameters created from the query.
Query
Required
The SQL Query to be executed (e.g. SELECT * FROM Customers
). You can use the Using the Query Designer to build the query visually.
Connection
Required
The ODBC Connection to use. See the Connecting to an ODBC Database article if you require more information on how to create/manage connections.
Zynk Settings
Examples
You can find an example of how to use this task in the Using the ODBC Connector tutorial.
Sample SQL query:
SELECT CustomerAccountNumber, AccountBalance FROM SLCustomerAccount
Sample output file if you do not specify any values for the Root and Row XML field names. The output defaults to using "Rows" for the root and "Row" for each row in the result set.
<?xml version="1.0" standalone="yes"?>
<Rows>
<Row CustomerAccountNumber="INT01" AccountBalance="0.00" />
<Row CustomerAccountNumber="INT02" AccountBalance="0.00" />
<Row CustomerAccountNumber="INTE001" CustomerAccountName="Internetware Limited" AccountBalance="0.00" CreditLimit="0.00" />
</Rows>
Sample output file when the Root and Row properties have been as "Customers" and "Customer" to give us more specific XML
<?xml version="1.0" standalone="yes"?>
<Customers>
<Customer CustomerAccountNumber="INT01" CustomerAccountName="Merchant Solutions plc" AccountBalance="0.00" CreditLimit="10000.00" />
<Customer CustomerAccountNumber="INT02" CustomerAccountName="AG Electronics Ltd" AccountBalance="0.00" CreditLimit="10000.00" />
<Customer CustomerAccountNumber="INTE001" CustomerAccountName="Internetware Limited" AccountBalance="0.00" CreditLimit="0.00" />
</Customers>