Difference between revisions of "DBOCallSP"

From GreenVulcano Wiki
Jump to: navigation, search
({{GVESB}} configuration)
Line 44: Line 44:
 
|}
 
|}
  
For example:
+
As an example, see the following stored procedure:
<syntaxhighlight lang="XML"><?xml version="1.0" encoding="UTF-8"?>
+
<syntaxhighlight lang="sql">
 +
PROCEDURE LOAD_XML_FILE (v_file_name in varchar2, v_file in CLOB, v_file_id out number)
 +
....
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="xml">
 
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
 
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
 
       name="TestInsertXML" type="call">
 
       name="TestInsertXML" type="call">
Line 67: Line 71:
 
     </DBOBuilder>
 
     </DBOBuilder>
 
</dh-call>
 
</dh-call>
 +
</syntaxhighlight>
 +
The service receive as input an XML document (and a '''FILE_NAME''' property) and load it into a table, returning a number representing the key of the file in the table.
 +
The '''InsertXML''' transformation create the following XML in order to provide the parameters for the procedure:
 +
<syntaxhighlight lang="xml">
 +
<RowSet>
 +
    <data>
 +
        <row id="0">
 +
            <col>Test.txt</col>
 +
            <col type="long-string">&lt;PersonsData&gt;
 +
    &lt;PersonData&gt;
 +
    &lt;Name&gt;ANTONIO ROSSI&lt;/Name&gt;
 +
    &lt;BirthDate&gt;05/02/1980&lt;/BirthDate&gt;
 +
    &lt;City&gt;MILANO&lt;/City&gt;
 +
    &lt;/PersonData&gt;
 +
    &lt;/PersonsData&gt;</col>
 +
        </row>
 +
    </data>
 +
</RowSet>
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 07:58, 12 January 2016

Description

The DBOCallSP element represents the DBO optimized for operations on store procedures.

GreenVulcano® ESB configuration

DBOCallSP with VulCon

DBOCallSP might contain the following sub-elements:

Its attributes are:

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.DBOCallSP
name required DBOCallSP name
transformation optional Transformation to be applied on the input data to obtain the internal XML commands.
force-mode required Force mode of the DBO, can be used in DBOBuilder whit more heterogeneous DBO.
Mode:
caller - inherit the mode of the caller
call - call procedure mode.

The attribute's admitted values are:

  • caller
  • xml2db
execute-query required This parameter specifies is the callable statements must be executed with API CallableStatement#executeQuery().
Default is false.

The attribute's admitted values are:

  • true
  • false
jdbc-connection-name required DataSource JNDI name.
Override connection defined in DBOBuilder.
ignore-input required Tell the engine do not use the input data.

The attribute's admitted values are:

  • true
  • false
input-data required The default is the value of @name-Input.
Can be set as the @output-data of a preceding DBO to use its output as input.
output-data required The default is the value of @name-Output.

As an example, see the following stored procedure:

PROCEDURE LOAD_XML_FILE (v_file_name in varchar2, v_file in CLOB, v_file_id out number)
....
<dh-call class="it.greenvulcano.gvesb.virtual.datahandler.DataHandlerCallOperation"
      name="TestInsertXML" type="call">
    <DBOBuilder class="it.greenvulcano.gvesb.datahandling.dbobuilder.DBOBuilder"
           isXA="true" jdbc-connection-name="ds.gv_test"
           name="TestInsertXML" transacted="true"
           type="dbobuilder">
        <DBOCallSP class="it.greenvulcano.gvesb.datahandling.dbo.DBOCallSP"
                name="InsertXML" transformation="InsertXML"
                type="dbo">
                    <CallDescriptor>
                        <statement id="0" type="callsp">begin load_xml_file(?, ?, ?); end;</statement>
                        <SPOutputParameters>
                              <SPOutputParameter db-type="number"
                                       java-type="string" position="3"
                                       prop-name="RESULT"
                                       return-in-prop="false"/>
                        </SPOutputParameters>
                    </CallDescriptor>
        </DBOCallSP>
    </DBOBuilder>
</dh-call>

The service receive as input an XML document (and a FILE_NAME property) and load it into a table, returning a number representing the key of the file in the table. The InsertXML transformation create the following XML in order to provide the parameters for the procedure:

<RowSet>
    <data>
        <row id="0">
            <col>Test.txt</col>
            <col type="long-string">&lt;PersonsData&gt;
    &lt;PersonData&gt;
    &lt;Name&gt;ANTONIO ROSSI&lt;/Name&gt;
    &lt;BirthDate&gt;05/02/1980&lt;/BirthDate&gt;
    &lt;City&gt;MILANO&lt;/City&gt;
    &lt;/PersonData&gt;
    &lt;/PersonsData&gt;</col>
        </row>
    </data>
</RowSet>