Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone.
How can I log the MS SQL queries to the TC Management Console?
I would like to write the query to the log (only query, without rows/results).
I use the tDBInput component and the flow is very simple:
tDBInput(MSSQL)---->tJavaRow ----->tDBOutput
I know that for some DB technology (for example Snowflake) the queries (tDBInput and tDBRow) are written to the log automatically but for MS SQL is doesn't work.
Regards.
Hi,
The most easy way will be store the query in a context variable and print it using a tJava.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi nikhillthampi.
Maybe I'm wrong but simple System.out.println(context.query) puts the query into the output.
But I would like to see the query in the Cloud log.
How can I do it?
Regards.
Thanks a lot.
I did as you both wrote and it looks ok.
I thought that there is more easier and shorter way to do it so this is why I asked.
Right now If I want to add some log entries/details in a few places in job, it is necessary to add a lot of components to the job.
For example, if I have 10 different queries to run in one job in different places I need to add 10 additional tJava component and 10 additional tJobLog component.
This makes the job difficult to read.
It would be great to have some java function to write some logs (context variables) in both places - to the output and to the cloud log (web).
Do you know if there is something like this?
Thanks.