Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
is there any way in QlikView that I can delete all temp_tables that might remain after one iteration of a subroutine, without knowing their exact name (the name is different depending on the iteration in which they were created)?
Thanks a lot!
Best regards,
DataNibbler
Hi
Actually TableName() is zero based, and you need to go backwards so that TableName(i) is not affected by the earlier run (otherwise it will skip every second table to be deleted):
For zi = NoOfTables() - 1 To 0 Step -1
Let vTable = TableName(zi);
If WildMatch(vTable, 'temp*') Then
DROP Table $(vTable);
End If
Next
HTH
Jonathan
Hi DataNibbler,
if you used a table prefix like 'temp' - you could run a loop through all tables like:
for i = 1 to nooftables()
if left(tablename($(i)), 4) = 'temp' then
drop tables tablename($i));
end if
next
- Marcus
Hi Marcus,
that core_statement (the >> DROP TABLES ... <<) does not seem to work. The editor underlines the back_part
( >> tablename($(i)) <<)
and I get an error that the table in the DROP statement was not found
Hi
Actually TableName() is zero based, and you need to go backwards so that TableName(i) is not affected by the earlier run (otherwise it will skip every second table to be deleted):
For zi = NoOfTables() - 1 To 0 Step -1
Let vTable = TableName(zi);
If WildMatch(vTable, 'temp*') Then
DROP Table $(vTable);
End If
Next
HTH
Jonathan
Thanks Jonathan!
That works.
I need that as an interim - in the long run, maybe I will see where and why these tables are created - actually, every table created in my subroutine is supposed to be deleted, I store away the important info and use it afterwards.
It's just that I have no time to look at everything in detail any more than I have to - I have to concentrate on getting this thing in the air ...
Best regards,
DataNibbler