Delete error table using IF in macro

  • Thread starter Thread starter Song Su
  • Start date Start date
S

Song Su

When I import using macro, error tables created for each run. They are

sapbud_ImportErrors
sapbud_ImportErrors1 etc

How to use IF statement in macro? If these error tables exist, delete.

Thanks.

Song
 
Song,

I am not sure whether there is a more sophisticated way to do this. But I
have handled this problem by using an OpenQuery action in the macro, to run
a Make-Table query that creates such a table, in your case
sapbud_ImportErrors. If the table does not already exist, it makes one. If
the table does already exist, it overwrites the existing one. Either way,
you then avoid the error that you would otherwise get with the DeleteObject
action if there is no such table.
 
Make sense. I'll try that. Thank you.

Steve Schapel said:
Song,

I am not sure whether there is a more sophisticated way to do this. But I
have handled this problem by using an OpenQuery action in the macro, to
run a Make-Table query that creates such a table, in your case
sapbud_ImportErrors. If the table does not already exist, it makes one.
If the table does already exist, it overwrites the existing one. Either
way, you then avoid the error that you would otherwise get with the
DeleteObject action if there is no such table.
 
Back
Top