can we call stored procedures using before/after routines

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
harithay
Participant
Posts: 106
Joined: Tue Dec 14, 2004 10:51 pm

can we call stored procedures using before/after routines

Post by harithay »

Hi all,

before i run the etl job i need to populate a table using 'begin store procedure' and after running the job i need to update the same table using 'update stored procedure'.

My question is
can we call stored procedures using before job/stage and after job/stage routines

or
do i need to develop seperate server jobs to call stored proedure before and after etl job.


any suggestions.

Thanks
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

One method is to write a .bat script using the command line interface to your unnamed database. If Oracle, I suggest using sqplus, if SQL-Server, OSQL/ISQL is a good choice.

Use the script in the before/after transformer/job routine call of ExecDOS.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
harithay
Participant
Posts: 106
Joined: Tue Dec 14, 2004 10:51 pm

Post by harithay »

Thanks kcbland
I have one more question for you, does this subroutine returns a value if we pass input parameters to stored procedure.
I
kcbland wrote:One method is to write a .bat script using the command line interface to your unnamed database. If Oracle, I suggest using sqplus, if SQL-Server, OSQL/ISQL is a good choice.

Use the script in the before/after transformer/job routine call of ExecDOS.
,
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Whatever you build into the script can pass the appropriate error codes back to DS. Non-zero return codes from shell scripts can generate a fatal error if you like. It's up to you to write a robust script that error checks the stored procedure and sets the proper script return code.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply