After Subroutine open database connection

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
vbeeram
Participant
Posts: 63
Joined: Fri Apr 09, 2004 9:40 pm
Contact:

After Subroutine open database connection

Post by vbeeram »

Hi,

I am using UDB DB2 database,i need to open a database connection and get maximum value of column from table using Before/After Routine.So is there any procedure to do this?I am using Enterprize edition 7.0.1.

this is urgent.


regards
Beeram
bryan
Participant
Posts: 91
Joined: Sat Feb 21, 2004 1:17 pm

Post by bryan »

anyone please correct me if i am wrong!

write a shell script which has script to login to database

initiate sql

write your sql to find the max of the column in that script

save it



then select either before or after in ur job properties based on what client wants

select "execsh" and give the path where the above shell script is
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a job - even a server job - to perform the task, and run that job.

Can you please explain why you think that you have to do this in a Before/After Subroutine? Isn't "beforehand" sufficient?

That means you have the option of a batch, job control routine or job sequence to execute the one job (select max...) before the other. It's also much easier to put the result somewhere that the second job can access it (for example hashed file, job parameter) if you use this approach.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply