Deleting Databases

Use the del-db operation to remove one or more databases.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet deleting a database includes the del-db operation node:

<packet version="1.4.2.0">
<database>
   <del-db>
   ...
   </del-db>
</database>
</packet>

 

The del-db node is presented by type DatabaseDelDbInputType (database_input.xsd), and its graphical representation is as follows:

Note: If the filter node is blank, all databases are removed.

 

Response Packet Structure

The del-db node of the output XML packet is presented by type DatabaseDelDBOutputType (database_output.xsd) and structured as follows:

 

 

Samples

Deleting a database

The request packet looks as follows:

<packet>
<database>
<del-db>
   <filter>
      <db-id>55</db-id>
   </filter>
</del-db>
</database>
</packet>

Response:

<packet>
<database>
   <del-db>

   <result>
      <status>ok</status>
      <filter-id>55</filter-id>
      <id>55</id>
   </result>

   </del-db>
</database>
</packet>

 

Negative response from the server can look as follows:

<packet">
<database>
   <del-db>

   <result>
      <status>error</status>
      <errcode>1013</errcode>
      <errtext>Database does not exist</errtext>
      <filter-id>55</filter-id>
   </result>

   </del-db>
</database>
</packet>
Deleting multiple databases

The request packet looks as follows:

<packet>
<database>

<del-db>
   <filter/>
</del-db>

<del-db>
   <filter>
      <db-id>15</db-id>
   </filter>
</del-db>

</database>
</packet>

 Response:

<packet>
<database>
   <del-db>

   <result>
      <status>ok</status>
      <filter-id>15</filter-id>
      <id>15</id>
   </result>

   <result>
      <status>ok</status>
      <filter-id>43</filter-id>
      <id>43</id>
   </result>

   <result>
      <status>error</status>
      <errcode>1013</errcode>
      <errtext>Database does not exist</errtext>
      <filter-id>15</filter-id>
   </result>

   </del-db>
</database>
</packet>

 The last result shows error, because the database with ID 15 is already deleted.