Delete error table using IF in macro

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
 
S

Steve Schapel

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.
 
S

Song Su

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top