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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get column name from dynamic data type which is defined in tMysqlInput?

Dear all,

 

I want to get all the column name which is defined on tMysqlInput component and the flow is contained in the picture below.

 

0683p000009M6uL.png

 

- Inside the tMysqlInput, I defined the Query which related to context variables, so it will change sometimes I run it. So I defined the Schema which is "dynamic" type.

 

- My target is getting all the column name with it's data in Mysql.

 

Who can help me for this case please!!!

Thank you guys!

Labels (4)
3 Replies
Anonymous
Not applicable
Author

Try this in your java row

Dynamic dyn = row1.dynamic_column_name;
Set<String> columns = dyn.getAllColumnNames();

If you want to loop through them all you can do something like

for(int i = 0; i < dyn.getColumnCount(); i++){
	DynamicMetadata meta = dyn.getColumnMetadata(i);
        String col_name = meta.getName();
}
Anonymous
Not applicable
Author

Thank you @evansdar for your help. It worked perfectly!

Anonymous
Not applicable
Author

Also, my currently purpose is getting data from mysql (about rows size which I defined before) and then put it into dataset. The final flow is:

 

0683p000009M6uz.png

 

Could you please help me how can I transform it into dataset from tMysqlInput (which used my custom query)?

 

Thank you and hope you have a happy day!