Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Load SQL table without knowing field names.

Hi All,

I have a new database that I am connecting to and i would like to use QlikView to show me all of the field names available in a certain table.

I have tried:

LOAD VISITS;

SQL SELECT *.*

FROM VISITS;

This throws an error , am i unable to use a wild card for fields?

Thanks

Wayne

8 Replies

Re: Load SQL table without knowing field names.

Try this:

LOAD *;

SQL SELECT *

FROM VISITS;

Then check all the field names on the front end

pooja_sn
Contributor

Re: Load SQL table without knowing field names.

Below SQL script will return all the column names from a SQL table:

SQL

select COLUMN_NAME

from INFORMATION_SCHEMA.COLUMNS

where TABLE_NAME='table_name'

Not applicable

Re: Load SQL table without knowing field names.

Hi,

I am able to access from Qlikview but this script is accessing the server directly?

Not applicable

Re: Load SQL table without knowing field names.

I am connecting with an ODBC connection through QlikView?

Re: Load SQL table without knowing field names.

MVP
MVP

Re: Load SQL table without knowing field names.

That's how I do it.

MVP
MVP

Re: Load SQL table without knowing field names.

However you would normally connect to your database management system through QlikView. We use ODBC here.

MVP
MVP

Re: Load SQL table without knowing field names.

You could do it on the server, but as shown it will run from QlikView. However, that script will depend heavily on your environment, I believe. At our company, for instance, it would look more like:

LOAD *
;
SQL
SELECT NAME
FROM SYSIBM.SYSCOLUMNS
WHERE TBCREATOR = 'SYSTLC'
AND TBNAME = 'VISITS'
;

But when I want to know the field names in a table, I do it like Sunny T suggested.