|
SQL queries
An XML file
can contain QUERY items that perform SQL queries to the database.
NOTE:
If you use Hummingbird DM 5.1.0.5 or later, you should activate the «Allow SQL
Passthrough» option in the Library Maintenance tool to be able to perform SQL
queries. See Requirements for additional
information.
Queries can
modify data in various tables.
<QUERY
onerror="break">UPDATE
DOCSADM.DOCUMENTTYPES SET MAX_VERSIONS='200' WHERE TYPE_ID='DEFAULT'</QUERY>
This query
will set the maximum number of versions to 200 for a document of the 'DEFAULT'
type.
Or add new
records to tables:
<QUERY
onerror="break">INSERT
INTO DOCSADM.MY_CUSTOM_TABLE (FIELD1, FIELD2) VALUES (1,2)</QUERY>
This query
will add a new record to the table MY_CUSTOM_TABLE.
Or delete
records from tables:
<QUERY
onerror="break">DELETE
FROM DOCSADM.MY_CUSTOM_TABLE WHERE FIELD1=1</QUERY>
Besides, the
results of SQL queries can be saved to variables for future use (see VARIABLE
for more information) and used to search for documents in order to update them
or check if document with the specified parameters exist in the library (see
DOCUMENT / SEARCH for more information).
Please see the
detailed description of the QUERY
element.
|