Five Stars

Microsoft SQL connections

Hi Team ,
Thanks in advance. I have developed a simple job for reading a txt file and load the data into db using tmssqloutput component . After establishing the connections with a particular db, talend would prepare insert scripts to load data into db . Is it possible to retrieve those elements in talend . I'm aware of getting this information using sql server profiler . But can we get this done using talend ?
Thanks,
Karthik
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: Microsoft SQL connections

Hi Karthik,

 

Yes, you can do this by ticking "Enable debug mode" in the Advanced Settings of your tMSSqlOutput component, then sending the Main output to a tFlowToIterate, at which point you'll have access to the query executed in a global variable named similar to "tMSSqlOuput_1_QUERY".

 

Here's an example which logs the query to the console in a tJava component:

 

tMSSqlOutputDebug.png

 

The code in tJava_1 is just:

 

System.out.println(((String)globalMap.get("tMSSqlOutput_1_QUERY")));

 

Regards,

 

 

Chris

1 REPLY
Six Stars

Re: Microsoft SQL connections

Hi Karthik,

 

Yes, you can do this by ticking "Enable debug mode" in the Advanced Settings of your tMSSqlOutput component, then sending the Main output to a tFlowToIterate, at which point you'll have access to the query executed in a global variable named similar to "tMSSqlOuput_1_QUERY".

 

Here's an example which logs the query to the console in a tJava component:

 

tMSSqlOutputDebug.png

 

The code in tJava_1 is just:

 

System.out.println(((String)globalMap.get("tMSSqlOutput_1_QUERY")));

 

Regards,

 

 

Chris