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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SQL DDL File execution

Hi,
I am new to Talend and maybe I have missed something (I Hope) that will allow me to execute SQL statements stored in a file. Specifically I have a DDL script that I want to run to create all of the data structures -- Types, Tables, Indexes, Constraints, FK, etc prior to doing the data load steps. Is there a simple way to do this? I am currently trying to do this against a DB2 database but will want this to be database agnostic. I would prefer to do this all within Talend as part of a job rather than use a separate tool to do the ddl and then talend for the dataload.
The data in the flat file generated by ER/Studio I want to load looks something like this (times hundreds of tables):

CREATE DISTINCT TYPE ADDRESSGENERAL AS VARCHAR(40) WITH COMPARISONS
;
CREATE DISTINCT TYPE BITMAP AS CHAR(128) WITH COMPARISONS
;
We are using TOS2.2.1

Thanks in advance for any direction you can give me on this.
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi,
If you have a fileInput with one Query per line like that :
UPDATE SAMPLE SET GROUP_ID = 'TEST1'
UPDATE SAMPLE SET GROUP_ID = 'TEST2'
UPDATE SAMPLE SET GROUP_ID = 'TEST3'
You can specify this file input into MetadataSchema fileDelimited :
1 column named Query for example.
Then, you are designing a Job like the following screenshot.
In the tDB2Row component, the Query specified is a Dynamic query provides by the FileInputDelimited.
For each row, you will have a run of your selected query.
In the query field, specify this dynamic query like that : ""+row1.Query+"" => row1 is the name of your Link between your components, Query is the name of your Column in the Schema.
IMPORTANT : your query must have no ";" character in end of line, keep just the SQL query.
Regards.