Plands.com Logo  Business Internet Services 
Main Menu
Home
Planetary CRM
  Benefits
  Features
  Demo
E-Mail Services
  E-mail Hosting
  Newsletters
  Discussion Lists
Web Hosting
Server Co-location
and Administration
Web Applications
Technical Support
Contact Us
DXP Samples
 
DxpHome  ||   Samples  ||   Details  ||   Docs  ||   Trees  ||   xml-xsl  ||   Links
// DbBatchStmt.java

The DbBatchStmt node executes an array of SqlStmts using a database Connection. The result of each stmt (if not null) is stored back in the request as store.n where store is the value of the store attrubute and n is the stmt number.

This tag operates in a manner to DbStmt but the current version only supports the following actions: query - Query results formatted as StringRecordSets for html output update - Update and return the the update counts in String values the represent numbers getValue - Query for a col value and store each result as a Strings

Example:

 
<dxp:DbBatchStmt action="update" dbcon="users" store="updatecnt">
   <dxp:SqlBatchStmt>
      <dxp:Cp name="sql">insert into options set col1='?', col2='?' where userid=?</dxp:Cp>
      <dxp:SqlBatchParam name="array1" type="CHAR"/>
      <dxp:SqlBatchParam name="array2" type="CHAR"/>
      <dxp:SqlBatchParam name="userid" type="NUMBER"/>
   </dxp:SqlBatchStmt>
</dxp:DbBatchStmt>
It's also possible to store the SqlBatchStmt outside the DbBatchStmt
<dxp:SqlBatchStmt store="batch">
   <dxp:Cp name="sql">insert into options set col1='?', col2='?' where userid=?</dxp:Cp>
   <dxp:SqlBatchParam name="array1" type="CHAR"/>
   <dxp:SqlBatchParam name="array2" type="CHAR"/>
   <dxp:SqlBatchParam name="userid" type="NUMBER"/>
</dxp:SqlBatchStmt>
  
<dxp:DbBatchStmt action="update" dbcon="users" store="updatecnt">
   <dxp:Ap name="batch" require="true"/>
</dxp:DbBatchStmt>


@author Mark Ashworth
@version 0.2, 2001-08-29

Return to Index

Note: We have tried to test all of the code examples but they may contain errors. Any questions, comments, suggestions, or problems should be sent to info@plands.com.