Difference between revisions of "DBOMultiFlatSelect"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} configuration)
 
(3 intermediate revisions by one other user not shown)
Line 8: Line 8:
  
 
Must be defined for each select statement and field the FieldFormatter, that allows you to force the formatting of the values ​​extracted from the database.
 
Must be defined for each select statement and field the FieldFormatter, that allows you to force the formatting of the values ​​extracted from the database.
 +
 +
DBOMultiFlatSelect element is used by [[DBOBuilder]].
 +
 +
The following table shows its attributes:
 +
{|class="gvtable"
 +
! Attribute !! Type !! Description
 +
|-
 +
| type || fixed || This attribute must assume the value '''dbo'''
 +
|-
 +
| class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.datahandling.dbo.DBOMultiFlatSelect'''
 +
|-
 +
| name || required || DOMultiFlatSelect name
 +
|-
 +
| force-mode || required || (caller or db2xml): Force mode of the DBO, can be used in [[DBOBuilder]] whit more heterogeneous [[DBOBuilder#DBO|DBO]]. <br/> Mode:<br/> caller - inherit the mode of the caller<br/> db2xml - data extraction mode
 +
|-
 +
| jdbc-connection-name || required || DataSource JNDI name. <br/>  Override connection defined in [[DBOBuilder]].
 +
|-
 +
| ignore-input || optional || (true or false): Tells the engine do not use the input data.
 +
|-
 +
| output-data || optional || The default is the value of @name-Output.
 +
|}
  
 
For example:
 
For example:
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
<DBOFlatSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect"
+
<DBOMultiFlatSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect"
                            name="Partners_FinalReport-select" type="dbo">
+
                    name="Partners_FinalReport-select" type="dbo">
 
       <FieldFormatters id="0">
 
       <FieldFormatters id="0">
           <FieldFormatter field-id="1,2,3" terminator-char=","  type="field-formatter"/>
+
           <FieldFormatter field-id="1,2" terminator-char=","  type="field-formatter"/>
           <FieldFormatter field-id="4" type="field-formatter"/>
+
           <FieldFormatter field-id="3" type="field-formatter"/>
 
       </FieldFormatters>
 
       </FieldFormatters>
 
       <FieldFormatters id= "1">
 
       <FieldFormatters id= "1">
           <FieldFormatter field-id="1,2,3" terminator-char="," type="field-formatter"/>
+
           <FieldFormatter field-id="1,2" terminator-char=","
           <FieldFormatter date-format="yyyyMMddHHmmssSSS" field-id="4" type="field-formatter"/>
+
                          type="field-formatter"/>
 +
           <FieldFormatter date-format="yyyyMMddHHmmssSSS"  
 +
                          field-id="3" type="field-formatter"/>
 
       </FieldFormatters>
 
       </FieldFormatters>
 
     <statement id="0" type="select">
 
     <statement id="0" type="select">
           SELECT ‘Service Code’, ‘MSISDN, ‘Timestamp’ from dual
+
           SELECT 'Service Code','MSISDN','Timestamp' from dual
      </statement>
+
    </statement>
 
     <statement id= "1" type="select">
 
     <statement id= "1" type="select">
           SELECT m.CAMPAIGN, c.MSISDN, c.EVENT_TIME, c.EVENT
+
           SELECT m.CAMPAIGN, c.MSISDN, c.EVENT_TIME
 
           FROM CAMA.CDR_EVENT c, CAMA.MESSAGES m, CAMA.PARTNERS p
 
           FROM CAMA.CDR_EVENT c, CAMA.MESSAGES m, CAMA.PARTNERS p
 
           where m.ID = c.MSG_ID  and p.ID = m.PARTNER_ID  and p.ID = @{{PARTNER_ID}}
 
           where m.ID = c.MSG_ID  and p.ID = m.PARTNER_ID  and p.ID = @{{PARTNER_ID}}
           and c.EVENT_TIME &gt;= to_timestamp(@{{MIN_REPG_TIME}}, ‘YYYY-MM-DD HH24:MI:SS’)
+
           and c.EVENT_TIME <= to_timestamp('@{{MIN_REPG_TIME}}','YYYY-MM-DD HH24:MI:SS')
           and c.EVENT_TIME &lt; to_timestamp(@{{MAX_REPG_TIME}},’YYYY-MM-DD HH24:MI:SS’)
+
           and c.EVENT_TIME to_timestamp('@{{MAX_REPG_TIME}}','YYYY-MM-DD HH24:MI:SS')
      </statement>
+
    </statement>
 
</DBOFlatSelect>
 
</DBOFlatSelect>
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 36: Line 59:
 
will generate the output:
 
will generate the output:
 
<syntaxhighlight lang="XML">
 
<syntaxhighlight lang="XML">
 +
Service Code,MSISDN,Timestamp
 
TEST_1000130000,+10020000000,20111222170000000
 
TEST_1000130000,+10020000000,20111222170000000
 
TEST_1000130000,+10020000001,20111222170000000
 
TEST_1000130000,+10020000001,20111222170000000
Line 44: Line 68:
 
TEST_1000130000,+10020000006,20111222170000000
 
TEST_1000130000,+10020000006,20111222170000000
 
</syntaxhighlight>
 
</syntaxhighlight>
 
DBOMultiFlatSelect element is used by [[DBOBuilder]].
 
 
The following table shows its attributes:
 
{|class="gvtable"
 
! Attribute !! Type !! Description
 
|-
 
| type || fixed || This attribute must assume the value '''dbo'''
 
|-
 
| class || fixed || This attribute must assume the value '''it.greenvulcano.gvesb.datahandling.dbo.DBOMultiFlatSelect'''
 
|-
 
| name || required || DOMultiFlatSelect name
 
|-
 
| force-mode || required || (caller or db2xml): Force mode of the DBO, can be used in [[DBOBuilder]] whit more heterogeneous [[DBOBuilder#DBO|DBO]]. <br/> Mode:<br/> caller - inherit the mode of the caller<br/> db2xml - data extraction mode
 
|-
 
| jdbc-connection-name || required || DataSource JNDI name. <br/>  Override connection defined in [[DBOBuilder]].
 
|-
 
| ignore-input || optional || (true or false): Tells the engine do not use the input data.
 
|-
 
| output-data || optional || The default is the value of @name-Output.
 
|}
 
  
 
DBOMultiFlatSelect might contain the following sub-elements:
 
DBOMultiFlatSelect might contain the following sub-elements:

Latest revision as of 14:05, 24 June 2013

Description

The DBOMultiFlatSelect element represents the DBO optimized for select operations and conversion in CSV rows.

GreenVulcano® ESB configuration

DBOMultiFlatSelect allows you to run more select statements on the database. The result will be a CSV document with the concatenation of these selects.

Must be defined for each select statement and field the FieldFormatter, that allows you to force the formatting of the values ​​extracted from the database.

DBOMultiFlatSelect element is used by DBOBuilder.

The following table shows its attributes:

Attribute Type Description
type fixed This attribute must assume the value dbo
class fixed This attribute must assume the value it.greenvulcano.gvesb.datahandling.dbo.DBOMultiFlatSelect
name required DOMultiFlatSelect name
force-mode required (caller or db2xml): Force mode of the DBO, can be used in DBOBuilder whit more heterogeneous DBO.
Mode:
caller - inherit the mode of the caller
db2xml - data extraction mode
jdbc-connection-name required DataSource JNDI name.
Override connection defined in DBOBuilder.
ignore-input optional (true or false): Tells the engine do not use the input data.
output-data optional The default is the value of @name-Output.

For example:

<?xml version="1.0" encoding="UTF-8"?>
<DBOMultiFlatSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect"
                    name="Partners_FinalReport-select" type="dbo">
      <FieldFormatters id="0">
           <FieldFormatter field-id="1,2" terminator-char=","  type="field-formatter"/>
           <FieldFormatter field-id="3" type="field-formatter"/>
      </FieldFormatters>
      <FieldFormatters id= "1">
           <FieldFormatter field-id="1,2" terminator-char=","
                           type="field-formatter"/>
           <FieldFormatter date-format="yyyyMMddHHmmssSSS" 
                           field-id="3" type="field-formatter"/>
      </FieldFormatters>
     <statement id="0" type="select">
          SELECT 'Service Code','MSISDN','Timestamp' from dual
     </statement>
     <statement id= "1" type="select">
          SELECT m.CAMPAIGN, c.MSISDN, c.EVENT_TIME
          FROM CAMA.CDR_EVENT c, CAMA.MESSAGES m, CAMA.PARTNERS p
          where m.ID = c.MSG_ID   and p.ID = m.PARTNER_ID   and p.ID = @{{PARTNER_ID}}
          and c.EVENT_TIME <= to_timestamp('@{{MIN_REPG_TIME}}','YYYY-MM-DD HH24:MI:SS')
          and c.EVENT_TIME >  to_timestamp('@{{MAX_REPG_TIME}}','YYYY-MM-DD HH24:MI:SS')
     </statement>
</DBOFlatSelect>

will generate the output:

Service Code,MSISDN,Timestamp
TEST_1000130000,+10020000000,20111222170000000
TEST_1000130000,+10020000001,20111222170000000
TEST_1000130000,+10020000002,20111222170000000
TEST_1000130000,+10020000003,20111222170000000
TEST_1000130000,+10020000004,20111222170000000
TEST_1000130000,+10020000005,20111222170000000
TEST_1000130000,+10020000006,20111222170000000

DBOMultiFlatSelect might contain the following sub-elements: