Question

I have a Job in talend that inserts data into a table.

Can I get this SQL sentences (ie "insert into tabla(a,b)values(....)")?

Was it helpful?

Solution

You can see the data inserted by adding tLogRow but if you want to see the generated insert on real time you can use the debugger.

For example, for the following job: enter image description here

Above you can see the data inserted from an excel file to a mysql table. This was generated using tLogRow. But if you want the sql generated sentence, by using the debug you can see it here:

enter image description here

Hope to help.

OTHER TIPS

You could simply place a tLogRow component either before or after your database output component to log things to the console if you are interested in seeing what data is being sent to the database.

I think it's impossible to see (it could be nice as an improvement in new releases). My problem, was when I change de source of my database output (Oracle SID to Oracle RAC), the inserts were made in the older database.

I fix it change the xml code in the "item" file. With the change older params attached to Oracle SID were stil there.

Thanks a lot!! Have a nice weekend Goon10 and ydaetskcoR!

You can check the generated JAVA code. You'll see an:

INSERT INTO (columns) VALUES (?,?,?)

thats the insert preparedStatement. Talend uses preparedStatements to do the inserts, thus only 1 insert will be generated and sent. In the main part of the component it will call

setString(value,position)

Please refer to: http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top