PL/SQL Procedure to be called after datastage job.

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
shreya27
Participant
Posts: 23
Joined: Thu Jan 29, 2009 7:47 am

PL/SQL Procedure to be called after datastage job.

Post by shreya27 »

Hi All,

Is it possible to call a PL/SQL Procedure after a datastage job is executed? pls let me know.




Thanks
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

Post by varaprasad »

yes it is :)

Wrap your PL/SQL code in a Unix shell script and call from After Job subroutine.
shreya27
Participant
Posts: 23
Joined: Thu Jan 29, 2009 7:47 am

Post by shreya27 »

varaprasad wrote:yes it is :)

Wrap your PL/SQL code in a Unix shell script and call from After Job subroutine.

Can you pls provide the syntax to wrap the plsql code in unix shell script?
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

Post by varaprasad »

shreya27 wrote:
varaprasad wrote:yes it is :)

Can you pls provide the syntax to wrap the plsql code in unix shell script?
Are you serious??

Okay, Firstly you have not provided the full details of your environment mainly the Database.

But the below snippet may help you, if your database is Oracle.

#!/bin/sh

sqlplus -s username/password<<END
execute procedure_name( ..parameters..)
commit;
exit;
END
deb033
Participant
Posts: 6
Joined: Fri Sep 26, 2008 5:37 am

Post by deb033 »

I think very simply we can call the SP after the job.

Make one job with some table def. stage, pass some dummy column and the SP being called in the after sql part of it. then just link it to some dummy seq file.

Now in a sequencer, link this job after the main job. I hope this can solve the purpose.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or simply use the Stored Procedure stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply