tMDMSP
and calls the stored procedure easily.
tMDMSP Standard properties
These properties are used to configure tMDMSP running in the Standard Job framework.
The Standard
tMDMSP component belongs to the Talend MDM family.
The component in this framework is available in all Talend
products.
Basic
settings
Schema and |
In SP principle, the schema is an input A schema is a row description, it defines The schema of this component is |
Use an existing connection |
Select this check box if you want to use a configured tMDMConnection component. |
MDM |
By default, Server |
URL |
Type in the URL of the MDM server. |
Username and |
Type in the user authentication data for the To enter the password, click the […] button next to the |
Data Container |
Type in the name of the data container that |
Type |
Select Master or Staging to specify the database on |
Procedure Name |
Type in the exact name of the Stored |
Parameters (in |
Click the Plus button and select the various Note:
The SP schema can hold more columns than |
Advanced
settings
tStatCatcher |
Select this check box to gather the |
Global
Variables
Global |
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component is used as intermediary component. It can be You can increase the timeout values for a Job using this component |
Connections |
Outgoing links (from this component to Row: Main
Trigger: Run if; Incoming links (from one component to this
Row: Main,
Trigger: Run if, For further information regarding |
Executing a stored procedure using tMDMSP
This scenario applies only to Talend MDM Platform and Talend Data Fabric.
In this scenario, the Job first generates parameters and sends them to tMDMSP, which executes a predefined stored procedure,
and then extracts data from the returned execution result and presents the extracted
data in the console.
-
Make sure the MDM server is up and running.
-
You have imported the MDM demo project and loaded the sample data into the data container
Product by running the Job MDM_LoadAll. -
You have been assigned a role with the appropriate user authorization and access rights to
the data model Product. -
You have created a store procedure called ProductSelection and
deployed this stored procedure to the MDM server.
In this example, the stored procedure ProductSelection is designed to query two fields
Name and Price of
Product data records within a price range:
For more information on working with stored procedures, see
Talend Studio
User Guide.
Creating a Job to execute the stored procedure
-
Drag and drop the following components onto the design workspace:
tFixedFlowInput, tMDMSP, tExtractXMLField, and tLogRow. -
Link the components using the Row >
Main connections.
Configuring tFixedFlowInput to generate a price range
-
Double-click tFixedFlowInput to open
its Basic settings view. -
Click the […] button next to
Edit schema to open the
schema editor. -
Click the [+] button to add two
parameters min and max
that are used to define the price range. -
Click OK to close the schema
editor. -
In the Mode area, keep the default
option Use Single Table, and enter
10 between quotes for the
min parameter and
15 between quotes for the
max parameter.
Configuring tMDMSP to execute the stored procedure
-
Double-click tMDMSP to open its
Basic settings view. - Enter the user name and password for accessing the MDM server.
-
In the Data Container field, enter
Product between quotes. -
In the Procedure Name field, enter
ProductSelection between quotes. -
In the Parameters table, click the
[+] button to add two rows,
and select min and max
respectively.
Configuring tExtractXMLField to extract data from the returned execution
result of the stored procedure
-
Double-click tExtractXMLField to open
its Basic settings view. -
Click the […] button next to
Edit schema to open the
schema editor. -
Add two columns to define the structure of the output data:
name and price. -
Click OK to close the schema editor,
and then click Yes in the Propagate dialog box. -
In the Loop XPath query field, enter
result between quotes on which the loop
is based.Each result of the stored procedure has the following syntax:
<result><col0>val1</col1>...<colN>valn</colN></result>
(wherecolN
is the nth column in the
SELECT
clause).Warning:If a null value exists in a data record to be returned by the
execution result of the stored procedure, some
inconsistencies will occur between the column number and the
value for this column in the returned data record. -
In XPath query column of the
Mapping table, enter the
exact node name on which the loop is applied:
col0 and col1,
respectively, between quotes.
Configuring the data display mode and executing the Job
-
Double-click the tLogRow component to
display its Basic settings
view. -
In the Mode area, select Table (print values in cells of a
table) for better readability of the
result. -
Save the Job and press F6 to run
it.According to the stored procedure and the price range, the
Product data records within the price
range of 10 to 15 are displayed with the values of the
Name and Price
fields as expected.