Difference between revisions of "Statement"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} Configuration)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Statement]] element contains the statement to be evaluated. Those statements might contain [[placeholders]] that will be replaced at runtime.
+
==Description==
  
It is used by: [[DBOperations]].
+
This element defines the statement to be evaluated.
  
The Statement element has the following parameters:
+
Can contains [[placeholders]] that will be replaced at runtime.
  
 +
=={{GVESB}} Configuration==
 +
 +
The element statement can be used by:
 +
* [[CallDescriptor]]
 +
* [[DBOFlatSelect]]
 +
* [[DBOInsert]]
 +
* [[DBOInsertOrUpdate]]
 +
* [[DBOMultiFlatSelect]]
 +
* [[DBOSelect]]
 +
* [[DBOThreadSelect]]
 +
* [[DBOUpdate]]
 +
* [[DBOUpdateOrInsert]]
 +
* [[Excel-call#Sheet|Sheet]]
 +
 +
Its attributes are:
 
{|class="gvtable"
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
! Attribute !! Type !! Description
 
|-
 
|-
| statementType || required || This element represents the type of statement to use.
+
| type || required || Must be:
We recommend using a CallableStatement to process stored procedures.
+
* DBOSelect : select
 +
* DBOInsert : insert
 +
* DBOUpdate : update
 +
* DBOInsertOrUpdate : insert|update
 +
* DBOUpdateOrInsert : insert|update
 +
* DBOCallSP : callsp
 +
* Excel Sheet : select
 
The attribute's admitted values are:
 
The attribute's admitted values are:
* CallableStatement
+
* select
* PreparedStatement
+
* insert
|}
+
* update
 +
* callsp
 +
The attribute's value cannot be null.
 +
|-
 +
| id || optional || Statement identifier. Default is 0. It is used as value of row/@id attribute:
 +
* Select: identifies the statement from which have been extracted the marked rows.
 +
* Update: identifies the statement to be used to process the input row parameters.
 +
The attribute's value cannot be null.
 +
|-
 +
| keys || optional || Only useful in DBOSelect.
 +
Specifies the index of select output on which group the results.
 +
The corresponding values are specified as attributes of 'data' element within the 'RowSet' element.
 +
For example, in the select: SELECT id,company_code,name FROM employees
 +
specifying the attribute keys = "2", the result would be:
 +
<syntaxhighlight lang="XML"><RowSet>
 +
  <data key_2="GreenVulcano">
 +
      <row><col>19</col><col>pippo</col></row>
 +
      <row><col>25</col><col>pluto</col></row>
 +
  </data>
 +
</RowSet>
 +
</syntaxhighlight>
 +
Can specify multiple keys separated by commas.
  
Might contain the sub-elements:
+
'''The select NEEDS to have an ORDER BY rule with THE SAME fields used in the attribute, and in the same order'''
* [[#StatementValue|StatementValue]]
 
* [[#ParamResolvers|ParamResolvers]]
 
  
==StatementValue==
+
The attribute's value cannot be null.
 
+
|}
StatementValue contains the value of the statement to be performed.
 
 
 
The StatementValue Element is used by: [[Statement]].
 
 
 
==ParamResolvers==
 
 
 
This element contains the list of Resolver used to resolve the parameters included in the statement.
 
 
 
Resolvers are applied in sequence, following the order of definition, and can be of different types.
 
 
 
The ParamResolvers Element is used by: [[Statement]].
 
 
 
Might contain more sub-elements:
 
* [[#ParamResolver|ParamResolver]]
 
 
 
===ParamResolver===
 
 
 
This element represents the type of a resolver to use for solving the parameters included in the statement.
 
 
 
The ParamResolver Element is used by: [[#ParamResolver|ParamResolver]]
 
  
Might contain the sub-elements:
+
Does not contain subelements.
* [[Description]]
 
* [[#XPathParamResolver|XPathParamResolver]] or [[#GVBufferParamResolver|GVBufferParamResolver]]
 

Latest revision as of 20:16, 6 April 2017

Description

This element defines the statement to be evaluated.

Can contains placeholders that will be replaced at runtime.

GreenVulcano® ESB Configuration

The element statement can be used by:

Its attributes are:

Attribute Type Description
type required Must be:
  • DBOSelect : select
  • DBOInsert : insert
  • DBOUpdate : update
  • DBOInsertOrUpdate : insert|update
  • DBOUpdateOrInsert : insert|update
  • DBOCallSP : callsp
  • Excel Sheet : select

The attribute's admitted values are:

  • select
  • insert
  • update
  • callsp

The attribute's value cannot be null.

id optional Statement identifier. Default is 0. It is used as value of row/@id attribute:
  • Select: identifies the statement from which have been extracted the marked rows.
  • Update: identifies the statement to be used to process the input row parameters.

The attribute's value cannot be null.

keys optional Only useful in DBOSelect.

Specifies the index of select output on which group the results. The corresponding values are specified as attributes of 'data' element within the 'RowSet' element. For example, in the select: SELECT id,company_code,name FROM employees specifying the attribute keys = "2", the result would be:

<RowSet>
   <data key_2="GreenVulcano">
      <row><col>19</col><col>pippo</col></row>
      <row><col>25</col><col>pluto</col></row>
   </data> 
</RowSet>

Can specify multiple keys separated by commas.

The select NEEDS to have an ORDER BY rule with THE SAME fields used in the attribute, and in the same order

The attribute's value cannot be null.

Does not contain subelements.