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

Announcements
Maximize ROI with Qlik Professional Services – Expert Guidance, Faster Results: Explore Qlik Services
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How get table name in tmysqlinput

Hello,
I have a problem for retrieve a name of table in a tmysqlinput.
I try :
context.table = globalMap.get("tMysqlInput_3" + "_TABLE_NAME");
But context.table is null.
Have you an idea ?
Thank
Labels (2)
7 Replies
Anonymous
Not applicable
Author

The table name from the attribute does not matter. The only name what is real in use is the name of the table in the query. The query can be retrieved with:
context.query = (String) globalMap.get("tMysqlInput_1_QUERY");

I suggest you put the table at first in a context variable and use this var in your query.
The attribute TABLE you want to get is only in use for such things like Guess Query function.
Anonymous
Not applicable
Author

Thank for answer,
However that doesn't work, the context.query is null..
I don't understand...
janhess
Creator II
Creator II

Did you change it to context.query = (String) globalMap.get("tMysqlInput_3_QUERY"); which seems to be your case?
Anonymous
Not applicable
Author

Yes
Anonymous
Not applicable
Author

I have try with other jobs but the var it's always null
Anonymous
Not applicable
Author

Open your job and take a look at the source code. You will find a put to the global map with the query.
When do you read out the query? This query is - per definition - available at the end of the flow, meaning you should get the query from the globalmap in a next subjob e.g. with a tJava.
Anonymous
Not applicable
Author

Thank for the answer,
It's work ! 0683p000009MACn.png
If i understand, i can retrieve the table name after execution ?
If it's that, it's a bad new, because i require the table name before execution of query. In fact i check the status of table, if it's good i launch the query, if not good exit.
is it possible to retrieve the table name at the beginning?