title: select multiple records from postgresql DB and insert to another table using WSO2ESB
body: <p>we are trying to perform DB operation like Select and Insert. first we try to fetch the data from a table from Mysql datasource and next step is to insert the data we fetched to another table which is in Postgre datasource. Tried DBlookup mediator in WSO2ESB to fetch records but received only one record while executing select statement. following is the code tried to fetch data from MySQl.</p>
  
  <pre><code>&lt;dblookup&gt;
      &lt;connection&gt;
          &lt;pool&gt;
              &lt;password/&gt;
              &lt;driver/&gt;
              &lt;url/&gt;
              &lt;user/&gt;
          &lt;/pool&gt;
      &lt;/connection&gt;
      &lt;statement&gt;
          &lt;sql&gt;&lt;![CDATA[select &lt;col1&gt; as &lt;aliasname1&gt;,&lt;col2&gt; as &lt;aliasname2&gt; from &lt;tablename&gt;]]&gt;&lt;/sql&gt;
          &lt;result column="aliasname1" name="aliasname1"/&gt;
          &lt;result column="aliasname2" name="aliasname2"/&gt;
      &lt;/statement&gt;
  &lt;/dblookup&gt;
  &lt;log&gt;
      &lt;property expression="get-property('aliasname1')" name="Return aliasname1"/&gt;
      &lt;property expression="get-property('aliasname2')" name="Return aliasname2"/&gt;
  &lt;/log&gt;
  </code></pre>
  
  <p>but we are receiving 1 record details. request you to guide me how to fetch all records from table and based on that how to insert the same no.of records to another table.</p>