Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

(Resident Table Drop)Please help me Friends.

Hello Everybody,

                       At First I want to search a specific table and if the table exists I want to drop that table.

                       How to do that please help me.

Thanks & Regards,

Koushik.

4 Replies
SunilChauhan
Champion
Champion

control+e

control+ f

type tablename

load * ,

1 as junk

resident tablename;

drop table tablename;

Sunil Chauhan
Not applicable
Author

Sir,

    I do not want to drop it manually.I want to write a script like that whenever it will load the script

    autometically it will search for the hardcoaded table name and if exists it will be droped.

     What will be the code and flow of script?

     Please help me again.

Thanking you.

Koushik.

Not applicable
Author

Hi,

Use this script

let numTables = NoOfTables();

for i=1 to $(numTables)

let tt = TableName(0);

if tt = 'YOUR TABLE' THEN 

drop table [$(tt)];

END IF

next

SEARCH THE REF MANUAL FOR THE IF STATEMENT SCRIPT ON PAGE 311

Not applicable
Author

Hi,

Please see if the attached sample can help you.

Tab1:

Load * Inline [

A

1

2

3

4

5

];

Tab2:

Load * Inline [

B

7

8

9

0

];

//You please harcode the table here - 'Tab2' in the function below TableNumber

LET vTabNum = TableNumber('Tab2');

if vTabNum <> Null() then

    Drop Table Tab2;

end if

Cheers.