One Star

[resolved] 'Guess Query' button returning empty queries

Hello,
I'm currently using talend for training purposes and I've hit on a slight problem.
I created a mysql local database for use with talend, and have been able to use talend to create tables and insert data into those tables.
But when I tried to use talend to get data from those tables I found that the 'Guess Query' button isn't working as expected.
I created a tMysqlInput, configured the connection, selected the table it will fetch information from, and then I tried to use the 'Guess Query' button, my query became "". No matter what table I chosse, all of the queries become "" if I use 'Guess Query'.
Writing the queries myself isn't that much of a bother, but I just want to know why this functionality isn't working as I expected.
Best Regards,
Tiago Vieira
EDIT: I seem to have spoken too soon. The problem was that I forgot to select the schema.
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] 'Guess Query' button returning empty queries

Hi,
The "Guess Query" button will generate a SELECT based on the schema you defined for the component and the "Guess Schema" will generate a schema based on your own query.
As a lazy, you may:
- write a "SELECT * FROM YourTable" in the query field
- use "Guess Schema" to retrieve the schema relative to the table
- modify the schema definition (essentially by removing undesired fields") or not if you have to deal with all the table columns
- use "Guess Query" to generate a detailed SELECT where all the columns associated to schema fields are mentionned explicitly.
The you can change the query, using tranformation function as soon as your respect the schema definition.
Regards,
TRF
1 REPLY
One Star

Re: [resolved] 'Guess Query' button returning empty queries

Hi,
The "Guess Query" button will generate a SELECT based on the schema you defined for the component and the "Guess Schema" will generate a schema based on your own query.
As a lazy, you may:
- write a "SELECT * FROM YourTable" in the query field
- use "Guess Schema" to retrieve the schema relative to the table
- modify the schema definition (essentially by removing undesired fields") or not if you have to deal with all the table columns
- use "Guess Query" to generate a detailed SELECT where all the columns associated to schema fields are mentionned explicitly.
The you can change the query, using tranformation function as soon as your respect the schema definition.
Regards,
TRF