<?xml version="1.0"?>
<!-- These are the examples for XSF XEP-0043: Jabber Database Access-->
<stream xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" xml:lang="en"><!-- Example 1-->
<iq id="001" to="db.host" type="get">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
</iq>
      <!-- Example 2-->
<iq id="001" type="result" from="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one" permission="both"/>
      <table  name="tbl_two" permission="read"/>
  </database>
</iq>
      <!-- Example 3-->
<iq id="002" type="get" to="db.host"> 
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one"/>
  </database>
</iq>
      <!-- Example 4-->
<iq id="002" type="result" from="db.host">             
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one"    permission="both"> 
     <col name="a_int" type="int"/>
      <col name="a_float" type="float"/>
      <col name="a_char" type="char" size="10"/>
    </table>
  </database>
</iq> 
      <!-- Example 5-->
<iq id="003" type="get" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one">
      <col name="a_int"/>
      <col name="a_float"/>
      <col name="a_char"/>
    </table>
  </database>
</iq>

      SQL Syntax:
        select a_int, a_float, a_char
        from tbl_one
        <!-- Example 6-->
<iq id="003" type="get" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_one"  limit="2">
      <col name="a_int"/>
      <col name="a_float"/>
      <col name="a_char"/>
      </table>
  </database>
</iq>
       <!-- Example 7-->
<iq id="003" type="result" from="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one">
      <col name="a_int">1234</col>
      <col name="a_float">123.45</col>
      <col name="a_char">onetwothre</col>
    </table>
    <table  name="tbl_one">
      <col name="a_int">2345</col>
      <col name="a_float">234.56</col>
      <col name="a_char">twothreefo</col>
    </table>
  </database>
</iq>
       <!-- Example 8-->
<iq id="004" type="get" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one">
      <col name="a_int"/>
      <col name="a_float"/>
      <col name="a_char"/>
      <where>
        <col name="a_int" op="eq">1234</col>
        <col name="a_float" op="lt" conj="and">200.00</col>
      </where>
    </table>
  </database>
</iq>

         SQL Syntax:
         select a_int, a_float, a_char from tbl_one
         where   a_int = 1234 and a_float < 200.00
       <!-- Example 9-->
<iq id="003" type="result" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one">
      <col name="a_int">1234</col>
      <col name="a_float">123.45</col>
      <col name="a_char">onetwothre</col>
    </table>
  </database>
</iq>
      <!-- Example 10-->
<iq id="004" type="set" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one">
      <col name="a_int">3456</col>
      <col name="a_float">345.67</col>
      <col name="a_char">threefour</col>
    </table>
    <table  name="tbl_two">
      <col name="a_date">02/16/2002</col>
      <col name="a_numeric">123456789123.123</col>
    </table>
  </database>
</iq>

SQL syntax:
insert tbl_one (a_int, a_float,a_char)VALUES(3456,   345.67, 'threefour')
insert tbl_two (a_date, a_numeric) VALUES('02/16/2002', 123456789123.123)
      <!-- Example 11-->
<iq id="004" type="result" from="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_one"/>
    <table name="tbl_two">
      <error code="380">permission denied on table</error>
    </table>
  </database>
</iq>
      <!-- Example 12-->
<iq id="005" type="set" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table  name="tbl_one">
      <col name="a_char">aaaaaaaaaa</col>
      <where>
        <col name=c"a_int">1234</col>
      </where>
    </table>
  </database>
</iq>

        SQL Syntax:
    update tbl_one 
    set a_char = 'aaaaaaaaaa'
    where a_int = 1234
      <!-- Example 13-->
<iq id="005" type="result" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_one"/>
  </database>
</iq>
      <!-- Example 14-->
<iq id="006" type="set"  to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_one">
      <where>
        <col name="a_int" op="eq">1234</col>
      </where>
    </table>
    </database>
</iq>

      SQL Syntax:
      delete from tbl_one where a_int = 1234
    <!-- Example 15-->
<iq id="006" type="result"    to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_one"/>
  </database>
</iq>
    <!-- Example 16-->
<iq id="004" type="error" from="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_two">
      <error code="380">permission denied on table</error>
    </table>
</database>
    </iq>  
  <!-- Example 17-->
<iq id="004" type="error" from="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <error code="401">Access Denied</error>
  </database>
</iq>
  <!-- Example 18-->
<iq id="007" type="get" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <sql> select a_int, a_float from tbl_one </sql>
  </database>
</iq>
    <!-- Example 19-->
<iq id="007" type="result" to="db.host">
  <database 
      name="testdb"
      xmlns="http://openaether.org/projects/jabber_database.html"/>
    <table name="tbl_one" permission="both">
      <col name="a_int" type="integer"/>
      <col name="a_float" type="float"/>
    </table>
    <table name="tbl_one">
      <col name="a_int">1234</col>
      <col name="a_float">123.45</col>
    </table>
    <table name="tbl_one">
      <col name="a_int">2345</col>
      <col name="a_float">234.56</col>
    </table>
  </database>
</iq>
    </stream>

