Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Execute .sql file in talend

How to execute .sql file in talend when i run a job?

 

for example:

 

    If i run a job in talend the file(.sql) which i  placed in desktop should be triggered and it should affect in  mysql database  

 

   The .sql file may contain any qurey like create table or update or insert etc........

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi 

Set the Use Home Directory to <Mysql installation directory/bin>, and execute the command like

"cmd /c mysql -uUsername -pPassword -DDatabaseName <D:/files/in.sql"

0683p000009M8H7.png

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi
You can use a tsystem to execute a command to execute the .sql file like you do it from CMD.

Regards
Shong
Anonymous
Not applicable
Author

hi,

 

  can you please explain me how we can do it in tsystem component

 

Thanks

PhilHibbs
Creator II
Creator II

You should be able to do it by reading the file into a string with a tFileInputRaw component, write the contents into the globalMap, and use the globalMap entry as the Query in a tMysqlRow component.

Anonymous
Not applicable
Author

Hi 

Set the Use Home Directory to <Mysql installation directory/bin>, and execute the command like

"cmd /c mysql -uUsername -pPassword -DDatabaseName <D:/files/in.sql"

0683p000009M8H7.png

PhilHibbs
Creator II
Creator II

I can just see the expression on our security manager's face. "That's a password... in plain text... in a Talend job... you're fired!"

Anonymous
Not applicable
Author

hi shong,

 

 

  Thanks now it is working