Calling SQLServer StoredProc

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
htrisakti3
Charter Member
Charter Member
Posts: 36
Joined: Thu Jun 10, 2004 11:22 pm

Calling SQLServer StoredProc

Post by htrisakti3 »

Question:
when I call using EXEC StoredProc1 in After-SQL of SQLServer stage, does DataStage WAIT for completion of it ??

In my case, StoredProc1 calls 6 other storedprocs (storedproc1a, 1b, 1c...)
I saw that the first 2 storedproc's ran & not the rest.. I suspect DataStage only send Execute on main StoredProc1 and then exit .. ??
(which then stopped the unfinished storedproc from running)
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Calling SQLServer StoredProc

Post by sud »

htrisakti3 wrote:.. I suspect DataStage only send Execute on main StoredProc1 and then exit .. ??
That's right but
htrisakti3 wrote:(which then stopped the unfinished storedproc from running)
this is not correct. Datastage will issue an execute and terminate and all database errors have to be treated inside the procedure itself. Datastage will handle errors related to executing the proc but not it's runtime errors. Hence, there must have been an error in the stored proc which didn't allow the remaining procs to be called. Test the stored proc and see if it executes properly.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
htrisakti3
Charter Member
Charter Member
Posts: 36
Joined: Thu Jun 10, 2004 11:22 pm

tested from within sqlserver

Post by htrisakti3 »

Yes, I did test it from within SQLServer console & the main calling routine calls and completed all stored procs that needed to be called..

One more thing i found, in the documentation about RDBMS plug-in, in before/after SQL, it mentions that calling stored proc is NOT supported.

I guess this means, it may or may NOT work, no guarantee from Datastage?
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: tested from within sqlserver

Post by sud »

htrisakti3 wrote:Yes, I did test it from within SQLServer console & the main calling routine calls and completed all stored procs that needed to be called..

One more thing i found, in the documentation about RDBMS plug-in, in before/after SQL, it mentions that calling stored proc is NOT supported.

I guess this means, it may or may NOT work, no guarantee from Datastage?
Okay !! :roll:
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
newtier
Premium Member
Premium Member
Posts: 27
Joined: Mon Dec 13, 2004 5:50 pm
Location: St. Louis, MO

Re: tested from within sqlserver

Post by newtier »

There is also a stored procedure stage that you can put inline in your job flow.
Rick H
Senior Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

... depending on your exact 7.x version of DataStage. Initially it was only available for Oracle, with others like SQL Server added in a more recent release.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If your stored procedure doesnt have OUT or RETURN parameters then look into the odbc stage. It works pretty good for calling stored procedures.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply