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: 
Anonymous
Not applicable

[resolved] retrieve results of a custom sql query from a database connection

Hi,
I want to be able to retrieve the result set of a complex sql query from a mysql database. The query joins many tables and includes custom where clauses to limit the resultset.
I used multiple tMysqlinput components as input into a tMap and this then outputs to a single tMysqlOutput. The tMap does the mappings and joins (not able to add additional where clauses).
However when I run this job, I notice that for each input component, ALL of the data is retrieved from the database before pipe-lining to the tMap.
I actually only want to get back the resultset of the query, is this possibly?
This is using TMDMCE-Studio-All-r50363-V4.1.1
Thanks in advance
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thanks, I could not do it until I realised that I needed to select the 'Built In' Schema type

View solution in original post

4 Replies
Anonymous
Not applicable
Author

You can write your query with subjoins in tMysqlinput. The schema defined shoud contain all the fieds in the select query.
eg:
select id,name,number from empdetails dtl,empdata data
where.....
id, name and number shoud be defined in the schema.
Anonymous
Not applicable
Author

Thanks for the reply lijolawrance.
So I deleted the table name from the component view and set the Query Type to Built In and then edited the sql and used the query that I had saved under the DB Connections/name/Queries. However I cannot see where I can create a custom schema to reflect the result set. I thought it may be in the View Schemas, but I cannot find where to create that.
Any help would be appreciated.
Thanks
Anonymous
Not applicable
Author

Its the Edit schema button in tMysqlinput where you need to define the resultset.
Anonymous
Not applicable
Author

Thanks, I could not do it until I realised that I needed to select the 'Built In' Schema type