Oracle Connector Stage - after sql statement

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
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Oracle Connector Stage - after sql statement

Post by Rob4732 »

Hello my friends,

I have a job that uses an Oracle connector stage to insert records into a table. I also have an 'after sql statement' defined in the connector stage. I noticed that when my Insert statement fails(and job aborts), the 'after sql statement' still executes. Don't see much in the documentation elaborating on this though.

My guess is that when the primary sql statement is executed(good or bad), the 'after sql statement' will execute. This may be the intended design.

Any input appreciated.

Thanks

Robert
We don't see things as they are;
We see them as we are.
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Workaround.

Removed the 'after sql statement' from Oracle connector stage. Created new job that calls a stored proc(which performs the after sql statement). This new job is setup in my sequencer as a successor job to my Insert job. And will only run if my Insert job was successful.



:?
We don't see things as they are;
We see them as we are.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Out of curiousity, what exactly are you doing 'after sql'?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

The after sql statement inserts a trigger record in a status table. The appearance of this record indicates to a legacy load process that this table has been succesfully loaded by Infosphere, allowing the legacy process to continue on.

Thanks

:D
We don't see things as they are;
We see them as we are.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Food for thought - with no mechanism to control if the after-sql fires another path might be a link to an aggregator set to Last that you direct to the status table. Link ordering can ensure it arrives after the main data and thus should only commit if the main data flow is successful. FWIW.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Thanks for the info. I'll try it out.
We don't see things as they are;
We see them as we are.
Post Reply