3 Replies Latest reply: Apr 16, 2015 9:43 AM by Kothandaram Mugalipoo RSS

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

    Boris Kacevich

      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