Thx for your reply, I have tried both your solution, not workable.
Rob>> "DROP Table LogValues" will trhow exception because when i=1, this table doesn't exist. This table will only be created when i>=2. But this give me some idea, I will try IF not isnull(nooftables('LogVales')) then drop table later, maybe that can drop the log table.
I tried another way to avoid exception:
for i=1 to 3
SQL insert into etl_log values (1);
Noconcatenate SQL Select * from ETL_WorkFlow;
DROP Table ETL_WorkFlow$(i);
By this way, there has no exception.
But, the table named as "SQL insert into etl_log values (1)" is still there when input ctrl+T.
So I researched this issue again, seems this is caused by "QlikView recognize SQL insert as a SQL Select command", so after execution, it tried to fetch values into some table.
But, since this is an insert command, so no ResultSet return, of course no column can be find. And then, it will auto concatenate with previously table/fields. That's the reason why there exist a wried table, whose column names belong to ETL_WorkFlow , and table name belong to SQL insert.
I am not sure if anyone tried to use INSERT/UPDATE/DELETE in load script at before, I think this is an general issue, and QV should have some workaround.
BTW, does any one have good idea to catch exception? I know ScriptErrorCount can be used to identify if exception happened, but what I want is syntax like JAVA/Oracle. E.g: