Difference between revisions of "Statement"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "This section contains the statement to be evaluated which can contains the following placeholders: # fixed : a text string; # <nowiki>${{propname}} </nowiki> : a System propert...")
 
({{GVESB}} Configuration)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This section contains the statement to be evaluated which can contains the following placeholders:
+
==Description==
  
# fixed : a text string;
+
This element defines the statement to be evaluated.
# <nowiki>${{propname}} </nowiki>  : a System property name;
 
# <nowiki>sp{{propname}} </nowiki>  : a System property name;
 
# <nowiki>@{{propname}} </nowiki> : a inProperties property name;
 
# <nowiki>timestamp{{pattern}} </nowiki>: return the current timestamp formatted as ''pattern''
 
# <nowiki>dateformat{{date::source-pattern::dest-pattern}} </nowiki>: reformat ''date'' from 'source-pattern'' to ''dest-pattern''
 
# <nowiki>decode{{field[::cond1::val1][::cond2::val2][cond...n::val...n]::default}} </nowiki>: evaluate as if-then-else; if ''field'' is equal to cond1...n, return the value of val1...n, otherwise ''default''
 
# <nowiki>decodeL{{sep::field[::cond1::val1][::cond2::val2][cond...n::val...n]::default}}</nowiki> : is equivalent to ''decode'', with the difference that ''condX''  can be a list of values separated by ''sep''
 
# <nowiki>js{{scope::script}}</nowiki> : evaluate a JavaScript script, using the scope ''scope''
 
# <nowiki>sql{{[conn::]statement}}</nowiki>  : execute a select sql statement sql and return the value of the first field of the first selected record.<br/> The ''conn'' parameter is the JNDI name of a DataSource, if not defined is used the current connection
 
# <nowiki>sqllist{{[conn::]statement}}</nowiki>: execute a select sql statement sql and return the value of the first field of all selected records as a comma separated list. <br/> The ''conn'' parameter is the JNDI name of a DataSource, if not defined is used the current connection
 
# <nowiki>sqltable{{conn::statement}}</nowiki>: executes a select sql statement and returns all values of returned cursor as an XML. <br/>  The ''conn'' parameter is the JNDI name of a DataSource
 
# <nowiki>ognl{{script}}</nowiki> : evaluate a OGNL script
 
  
 +
Can contains [[placeholders]] that will be replaced at runtime.
  
 +
=={{GVESB}} Configuration==
  
The Statement element has the following parameters:
+
The element statement can be used by:
 +
* [[CallDescriptor]]
 +
* [[DBOFlatSelect]]
 +
* [[DBOInsert]]
 +
* [[DBOInsertOrUpdate]]
 +
* [[DBOMultiFlatSelect]]
 +
* [[DBOSelect]]
 +
* [[DBOThreadSelect]]
 +
* [[DBOUpdate]]
 +
* [[DBOUpdateOrInsert]]
 +
* [[Excel-call#Sheet|Sheet]]
  
* type:  
+
Its attributes are:
 +
{|class="gvtable"
 +
! 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:  
 +
<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.
  
  Must be:
+
'''The select NEEDS to have an ORDER BY rule with THE SAME fields used in the attribute, and in the same order'''
  
    DBOSelect          : select
+
The attribute's value cannot be null.
    DBOInsert          : insert
+
|}
    DBOUpdate          : update
 
    DBOInsertOrUpdate  : insert|update
 
    DBOUpdateOrInsert  : insert|update
 
    DBOCallSP          : callsp
 
  
    Excel Sheet        : select
+
Does not contain subelements.
 
 
* id: Pattern: ! [0-9]* ! set a integer value
 

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.