Page 1 of 1

After Subroutine open database connection

Posted: Thu Aug 26, 2004 8:45 am
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

Posted: Thu Aug 26, 2004 10:55 am
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

Posted: Thu Aug 26, 2004 4:19 pm
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.