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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Reading queries from .sql file and parsing query

Hi everyone,
My query is that I need to pass the output of an certain SQL query to target destination. let me elaborate the scenario.
I have an .sql file with an query.
Query: select empno, empname, sal, designation, company from EMP
This query will generate an output,
103 advani 100 gm infy
104 amit 100 developer TCS
Now my requirement is that this output is not seen in Talend Data Integration anywhere. I want to pass this query such that the respective output will be either transferred to similar database or be stored in an txt file in deliminated form.
I tried tSQLRow & tFileInputFullRow but couldn't figure out any way....
Let me explain again, I want to pass an SQL query in Talend Data Integration and output of respective query to be transferred in target database or deliminated file.
I tried running insert and update queries using tSQLRow, they work fine. Even the select queries work, but the obtained outpt needs to be used somewhere else.
Labels (2)
3 Replies
Anonymous
Not applicable
Author

Hi,
Now my requirement is that this output is not seen in Talend Data Integration anywhere. I want to pass this query such that the respective output will be either transferred to similar database or be stored in an txt file in deliminated form.
I tried tSQLRow & tFileInputFullRow but couldn't figure out any way....

Did you use tXXXinput component to execute sql query? Actually, I have made a demo job: tMySqlInput-->tlogrow to see the output. see my pics
Or you want to pass query into output file?( select empno, empname, sal, designation, company from EMP)
Best regards
Sabrina
0683p000009MAzL.png 0683p000009MAzQ.png 0683p000009MAzV.png
Anonymous
Not applicable
Author

Thanks xdshi,
I tried your method in Oracle instead of SQL, thanks it worked. But I have doubt. The values of table is seen in the query editor of tOracleRow as seen in screenshots. Also in tLogRow, I got output, but the data in table is shown as null. Why is it so?
Also I want to load the displayed data in tLogRow in deliminated file or similar structured database...... please help....
0683p000009MAza.jpg 0683p000009MAzf.jpg
Anonymous
Not applicable
Author

Hi,
The values of table is seen in the query editor of tOracleRow as seen in screenshots. Also in tLogRow, I got output, but the data in table is shown as null. Why is it so?

As a matter of fact, we usually use t<DB>Input to execute a select query, you have to use a tParseRecordSet after t<DB>Row to parse the record set if you use t<DB>Row to execute a select query.
Please see the component reference tMysqlRow with related scenarios.
Best regards
Sabrina