Difference between revisions of "DBOFlatSelect"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} configuration)
({{GVESB}} configuration)
Line 8: Line 8:
  
 
Must be defined for each field the FieldFormatter, that allows you to force the formatting of the values ​​extracted from the database
 
Must be defined for each field the FieldFormatter, that allows you to force the formatting of the values ​​extracted from the database
 
Might contain the following sub-elements:
 
* [[Description]]
 
* [[DHVariables]]
 
* [[FieldFormatters]]
 
* [[statement]]
 
  
 
Its attributes are:
 
Its attributes are:
Line 27: Line 21:
 
For example:
 
For example:
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
 
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
<DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
+
<DBOFlatSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect"
            jdbc-connection-name="ds.gv_cama" make-dump="none" name="Partners_FinalReport" type="dbobuilder">
+
              name="Partners_FinalReport-select" type="dbo">
      <DBOFlatSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect" 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,3" terminator-char=","  type="field-formatter"/>
+
      <FieldFormatter date-format="yyyyMMddHHmmssSSS"
                  <FieldFormatter date-format="yyyyMMddHHmmssSSS" field-id="4" type="field-formatter"/>
+
                      field-id="4" type="field-formatter"/>
            </FieldFormatters>
+
  </FieldFormatters>
            <statement id="0" type="select">SELECT m.CAMPAIGN, c.MSISDN, c.EVENT_TIME, c.EVENT
+
  <statement id="0" type="select">
                  FROM CAMA.CDR_EVENT c, CAMA.MESSAGES m, CAMA.PARTNERS p
+
      SELECT m.CAMPAIGN, c.MSISDN, c.EVENT_TIME, c.EVENT
                  where m.ID = c.MSG_ID, ...</statement>
+
      FROM CAMA.CDR_EVENT c, CAMA.MESSAGES m, CAMA.PARTNERS p
      </DBOFlatSelect>
+
      where m.ID = c.MSG_ID
</DBOBuilder>
+
      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>
 +
</syntaxhighlight>
 +
 
 +
will generate the output:
 +
<syntaxhighlight lang="XML">
 +
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
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
 +
Might contain the following sub-elements:
 +
* [[Description]]
 +
* [[DHVariables]]
 +
* [[FieldFormatters]]
 +
* [[statement]]

Revision as of 15:35, 30 March 2012

Description

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

GreenVulcano® ESB configuration

DBOFlatSelect with VulCon

DBOFlatSelect allows you to run a select on the database. The result of the select will be a CSV document.

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

Its attributes are:

  • type: dbo
  • class: it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect
  • name
  • force-mode (caller|xml2db): 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: DataSource JNDI name.
    Override connection defined in DBOBuilder.
  • ignore-input (true|false): Tell the engine do not use the input data.
  • output-data: The default is the value of @name-Output.

For example:

<?xml version="1.0" encoding="UTF-8"?>
<DBOFlatSelect class="it.greenvulcano.gvesb.datahandling.dbo.DBOFlatSelect"
               name="Partners_FinalReport-select" type="dbo">
   <FieldFormatters id="0">
       <FieldFormatter field-id="1,2,3" terminator-char=","  type="field-formatter"/>
       <FieldFormatter date-format="yyyyMMddHHmmssSSS"
                       field-id="4" type="field-formatter"/>
   </FieldFormatters>
   <statement id="0" type="select">
       SELECT m.CAMPAIGN, c.MSISDN, c.EVENT_TIME, c.EVENT
       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:

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


Might contain the following sub-elements: