DBJoin

We assume that you have already learned what is described in:

If you want to find the right Joiner for your purposes, see Joiners Comparison.

Short Summary

DBJoin receives data through a single input port and joins it with data from a database table. These two data sources can potentially have different metadata structures.

Component Same input metadata Sorted inputs Slave inputs Outputs Output for drivers without slave Output for slaves without driver Joining based on equality
DBJoinnono1 (virtual)1-2yesnoyes

Abstract

DBJoin receives data through a single input port and joins it with data from a database table. These two data sources can potentially have different metadata structure. It is a general purpose joiner usable in most common situations. It does not require the input to be sorted and is very fast as data is processed in memory.

The data attached to the first input port is called the master, the second data source is called slave. Its data is considered as if it were incoming through the second (virtual) input port. Each master record is matched to the slave record on one or more fields known as a join key. The output is produced by applying a transformation that maps joined inputs to the output.

Icon

Ports

DBJoin receives data through a single input port and joins it with data from a database table. These two data sources can potentially have different metadata structure.

The joined data is then sent to the first output port. The second output port can optionally be used to capture unmatched master records.

Port typeNumberRequiredDescriptionMetadata
Input0yesMaster input portAny
1 (virtual)yesSlave input portAny
Output0yesOutput port for the joined dataAny
1noOptional output port for master data records without slave matches. (Only if the Join type attribute is set to Inner join.) This applies only to LookupJoin and DBJoin.Input 0

DBJoin Attributes

AttributeReqDescriptionPossible values
Basic
Join keyyesKey according to which the incoming data flows are joined. See Join key. 
Left outer join If set to true, also driver records without corresponding slave are parsed. Otherwise, inner join is performed.false (default) | true
DB connectionyesID of the DB connection to be used as the resource of slave records. 
DB metadata ID of DB metadata to be used. If not set, metadata is extracted from database using SQL query. 
Query URL3)Name of external file, including path, defining SQL query. 
SQL query3)SQL query defined in the graph. 
Transform1), 2)Transformation in CTL or Java defined in the graph. 
Transform URL1), 2)External file defining the transformation in CTL or Java. 
Transform class1), 2)External transformation class. 
Cache size Maximum number of records with different key values that can be stored in memory.100 (default)
Advanced
Transform source charset Encoding of external file defining the transformation.ISO-8859-1 (default)
Deprecated
Error actions Definition of the action that should be performed when the specified transformation returns some Error code. See Return Values of Transformations. 
Error log URL of the file to which error messages for specified Error actions should be written. If not set, they are written to Console. 

Legend:

1) One of these transformation attributes should be set. Any of them must use a common CTL template for Joiners or implement a RecordTransform interface.

See CTL Scripting Specifics or Java Interfaces for more information.

See also Defining Transformations for detailed information about transformations.

2) The unique exception is the case when none of these three attributes is specified, but the SQL query attribute defines what records will be read from DB table. Values of Join key contained in the input records serve to select the records from db table. These are unloaded and sent unchanged to the output port without any transformation.

3) One of these attributes must be specified. If both are defined, Query URL has the highest priority.

Advanced Description

CTL Scripting Specifics

When you define your join attributes you must specify a transformation that maps fields from input data sources to the output. This can be done using the Transformations tab of the Transform Editor. However, you may find that you are unable to specify more advanced transformations using this easist approach. This is when you need to use CTL scripting.

For detailed information about CloudConnect Transformation Language see Part XI, CTL - CloudConnect Transformation Language. (CTL is a full-fledged, yet simple language that allows you to perform almost any imaginable transformation.)

CTL scripting allows you to specify custom field mapping using the simple CTL scripting language.

All Joiners share the same transformation template which can be found in CTL Templates for Joiners.

Java Interfaces

If you define your transformation in Java, it must implement the following interface that is common for all Joiners:

Java Interfaces for Joiners