After SQL in ODBC Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
arsh
Participant
Posts: 9
Joined: Thu Jan 18, 2007 10:44 pm
Location: Kolkata, India

After SQL in ODBC Stage

Post by arsh »

I have a job that is expected to create a view after successful insert of records in SQL Server.
I have used the create view statement in the After SQL section.
The problem is that even though the job fails due to a key violation error, the After SQL executes.
Can I put a condition to execute the After SQL only if the job completes fine or do I need to take the view create to a different job?

Thank You
-AA
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

I'm assuming you are using the ODBC Connector stage. There is no conditional execution of the After SQL. if you enable it, it runs regardless.

Sort of find it strange that the job has to create a view every time it runs. Are you creating a new table every run? If so, why does it matter if the view is created? If the job has an error, and then has to be re-run, won't it create a new table and then require a new view anyway?

But yes - if you need to only create it after a 100% successful run, I'd put it in a follow-on process.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply