Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get column names of a table in mySql from script?

Hello,

I'm trying to get column names from a mySql database table in a single column with the columns names.

I have a script working in dbVizualizer:

SELECT COLUMN_NAME

  FROM INFORMATION_SCHEMA.COLUMNS

  WHERE TABLE_SCHEMA='schema_name'

  AND TABLE_NAME='table_name';

This works fine.

But when I try to run it through the QV script, I get an empty result  - I'm using an ODBC connection to mySql.

Temp:

SQL

SELECT COLUMN_NAME

FROM INFORMATION_SCHEMA.COLUMNS

WHERE TABLE_SCHEMA='schema_name'

AND TABLE_NAME='table_name';

This script in QV gets an Empty result.

Anyone?

Thanks!

Boris

3 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi Boris,

What's the rest of your script?

Andy

Not applicable
Author

Never mind, I found the problem, the parameters I passed to the TABLE name and schema weren't in the right syntax.

Not applicable
Author

Boris.. If you have fixed the issue. then please close the ticket