Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue in table creation

I have actually two tables in a database for hive.

DB Name : test_db

table_a & table_b.

Once script is run , in sheet properties, we have only one table in Show Fields from table dropdown.

Table labels are getting updated in for loop and only table a is getting dropped

Below is the code

//Connect to hive

ODBC CONNECT TO hpc_hive;

a:

SQL use test_db;

SQL show tables;

LET vTablecount=NoOfRows('a');

For i=0 To $(vTablecount) -1

LET vTablename=Peek('tab_name',$(i),'a');

LET vMyTableNameQVD =Peek('tab_name',$(i),'a');

$(vTablename):

SQL desc $(vTablename);

Next i;

DROP Table a;

1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

Hello Ashwin,

As per my understanding tables are getting auto concatenated. To avoid this please use NoConcatenate statement before the table name of load statement.

//Connect to hive

ODBC CONNECT TO hpc_hive;

a:

SQL use test_db;

SQL show tables;

LET vTablecount=NoOfRows('a');

For i=0 To $(vTablecount) -1

LET vTablename=Peek('tab_name',$(i),'a');

LET vMyTableNameQVD =Peek('tab_name',$(i),'a');

NoConcatenate

$(vTablename):

SQL desc $(vTablename);

Next i;

DROP Table a;

Hope this will be helpful.

Regards!

Rahul

View solution in original post

7 Replies
rahulpawarb
Specialist III
Specialist III

Hello Ashwin,

Trust that you are doing well!

Have you verified the no. of rows hold by table a (before dropping table a; you can do it by commenting every statement after SQL show tables;).

Please correct me if I am wrong.

Regards!

Rahul

Not applicable
Author

Hi

No.of rows is equal to 2 before dropping table a.

rahulpawarb
Specialist III
Specialist III

Hello Ashwin,

As per my understanding tables are getting auto concatenated. To avoid this please use NoConcatenate statement before the table name of load statement.

//Connect to hive

ODBC CONNECT TO hpc_hive;

a:

SQL use test_db;

SQL show tables;

LET vTablecount=NoOfRows('a');

For i=0 To $(vTablecount) -1

LET vTablename=Peek('tab_name',$(i),'a');

LET vMyTableNameQVD =Peek('tab_name',$(i),'a');

NoConcatenate

$(vTablename):

SQL desc $(vTablename);

Next i;

DROP Table a;

Hope this will be helpful.

Regards!

Rahul

Not applicable
Author

Thanks Rahul it is working fine now.

rahulpawarb
Specialist III
Specialist III

Cheers,

Rahul

Not applicable
Author

Tables are shown separately in sheet properties but the column names are not filtering according to the table since the header name is same for both tables. Can you help me out in this.

rahulpawarb
Specialist III
Specialist III

Hello Ashwin,

Could you please share the application with sample data? This will help me to understand the situation and provide you required inputs.

Regards!

Rahul