tMap with dynamic sql lookup

One Star

tMap with dynamic sql lookup

Hi,
in tMap it is not possible to lookup additional information with a dynamic sql query.
My tSybaseInput_1 is only fired at startup of my job, but i want to query the database for each row.
In tJavaRow_1 i also set the contextvar "currentAZ", which is used by tSybaseInput_1
Do you have a suitable solution, i don't want to fetch the whole table in tSybaseInput_1.

Query in t_SybaseInput_1:

"SELECT
AZ
FROM FCAdmin.Akte
WHERE AZ = '"+context.currentAZ+"'"


Thanks and Regards
Sebastian
Employee

Re: tMap with dynamic sql lookup

You can so a dynamic sql lookup into the TOS 3.1.0 M2 release.
See also this page, there is a screenshot on this subject (dynamic lookup, not specifically with SQL):
22642
One Star

Re: tMap with dynamic sql lookup

thanks, it works.
Sebastian
One Star

Re: tMap with dynamic sql lookup

Hi,
Can someone tell me how to perform dynamic look up in Talend?
please see below an example problem that requires dynamic lookup.
example:
source file has the following data
employee_name|employee_Id
===========================
Ted | 100
Mary | 200
Ted 100
target table structure:
surrogate_Id | Employee_Name | Employee_Id
=========================================

after load the target table should look as shown below
surrogate_Id | Employee_Name | Employee_Id
=======================================
1 | Ted | 100
2 | Mary | 200

currently when I do a look up and insert data, employee Ted is getting inserted twice. This might be because the commit happens at the end of the job.
How can I include records that were inserted as part of the current transaction but not commited??
Thanks in advance

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog