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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
czuriaga
Contributor
Contributor

How to call / execute a MySQL script

I've already used a tMySQLRow component to execute several statements (configuring the connection with "allowMultiQueries=true"), but now I have a SQL file with different types of statements:

- Drop tables
- Create tables
- Create indexes
- Function declarations  (set delimiter //     create function xxxx...      set delimiter ; )
- Truncate tables
- Insert into table select ....

There are many statements, and not sure the function declarations that work under mysql console, can be embedded in the tMySQLRow component.

Is there any way or tMySQL component like tMySQLRow able to execute a MySQL script (SQL text file)?

Thanks

Labels (2)
1 Reply
Anonymous
Not applicable

Yes. You can use the component tSQLScriptParser. This component does not run the statements it self but parses a script (also from a file) and iterates through the single statements.
You can use the Iterate flow and e.g. a tMysqlRow to run the statements.
https://exchange.talend.com/#marketplaceproductoverview:gallery=marketplace%252F1&pi=marketplace%252...
There is also a stupid useless copy of my component, only my original version is maintained.