ado.ExecuteSQL

This job executes an SQL statement on the database. As a result, an XML file with the response to the query is created and written to the OSTEMP directory.

If the job is executed in a Unicode system (database migrated to Unicode), missing N before texts are automatically added; already written N are ignored. To completely disable this behavior, Flags=2 must be passed.

Example of automatic Unicode supplementation
SELECT 'Horst' FROM test WHERE feld='Paul'
=>
SELECT N'Horst' FROM test WHERE feld=N'Paul'

1. Input Parameters

Name Type Required Description

Flags

LONG

Yes

0 = texts are automatically supplemented with N; 2 = no automatic replacements

CursorType

INT

Yes

-1 = cursor type as specified in the registry (default); 0, 1, 2, 3 = corresponding to ADO constants for cursor types. Other values result in error messages.

Command

STRING

Yes

SQL command to execute

2. Output Files

Name Description

[File List]

Path and name of the result file in XML format

3. Return Value

(INT): 0 = Job successful, otherwise error code.

Returned XML file for SELECT * FROM osorganisations
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
     xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
     xmlns:rs="urn:schemas-microsoft-com:rowset"
     xmlns:z="#RowsetSchema">
  <s:Schema id="RowsetSchema">
    <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30" rs:updatable="true">
      <s:AttributeType name="id" rs:number="1" rs:nullable="true" rs:writeunknown="true"
                       rs:basecatalog="as_test" rs:basetable="osorganisations" rs:basecolumn="id">
        <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="32"/>
      </s:AttributeType>
      <s:AttributeType name="name" rs:number="2" rs:nullable="true" rs:writeunknown="true"
                       rs:basecatalog="as_test" rs:basetable="osorganisations" rs:basecolumn="name">
        <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="255"/>
      </s:AttributeType>
      <s:AttributeType name="layout" rs:number="3" rs:nullable="true" rs:maydefer="true"
                       rs:writeunknown="true" rs:basecatalog="as_test"
                       rs:basetable="osorganisations" rs:basecolumn="layout">
        <s:datatype dt:type="bin.hex" dt:maxLength="2147483647" rs:long="true"/>
      </s:AttributeType>
      <s:AttributeType name="active" rs:number="4" rs:nullable="true" rs:writeunknown="true"
                       rs:basecatalog="as_test" rs:basetable="osorganisations" rs:basecolumn="active">
        <s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"/>
      </s:AttributeType>
      <s:extends type="rs:rowbase"/>
    </s:ElementType>
  </s:Schema>
  <rs:data>
    <z:row id="45808CE977334AB88C5A8EFF467689A8" name="Test" active="1"/>
  </rs:data>
</xml>