Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
control+e
control+ f
type tablename
load * ,
1 as junk
resident tablename;
drop table tablename;
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.
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
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.