This script executes a set of SQL statements.
The entire set of statements is executed within a database transaction, which is rolled back if an error occurs and the database can handle transactions.
The current session must contain the connection parameters for database access.
dosql.php processes the following HTTP parameters:
The response structure returned by dosql.php is an XML document as outlined below:
<result>
<update>
<rows>number of rows affected by statement sql:0</rows>
<keys>
... result-set for keys generated by statement sql:0 ...
</keys>
</update>
<update>
<rows>number of rows affected by statement sql:1</rows>
<keys>
... result-set for keys generated by statement sql:1 ...
</keys>
</update>
...
<result-set>
<columns>
<column>
<name>name_of_column_1</name>
<type>sql_type_of_column_1</type>
</column>
<column>
<name>name_of_column_2</name>
<type>sql_type_of_column_2</type>
</column>
...
</columns>
... data ...
</result-set>
</result>
If the reqired format was xml, the data node looks like this:
<data>
<row>
<col>data for row 1 column 1</col>
<col>data for row 1 column 2</col>
...
</row>
<row>
<col>data for row 2 column 1</col>
<col>data for row 2 column 2</col>
...
</row>
...
</data>
If csv format was requested, the following data node is returned:
<csvdata><![CDATA[row 1 in CSV format row 2 in CSV format ... ]]></csvdata>
In case of errors or warnings, the following XML nodes may be inserted anywhere in the response:
<error>
<reason>error message</reason>
<sqlstate>SQL state</sqlstate>
<vendor-code>vendor code</vendor-code>
</error>
<warning>
<reason>error message</reason>
<sqlstate>SQL state</sqlstate>
<vendor-code>vendor code</vendor-code>
</warning>