Accessing tables from a routine

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
arun_im4u
Premium Member
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

Accessing tables from a routine

Post by arun_im4u »

Hello,

I am writing a routine which will run before/after each job to capture audit logs for that job. The before routine will have to access a staging audit table retrieve latest info from it and the after routine will insert/update the audit logs to the table after each job run.

Any suggestions would be helpful.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I wouldn't even consider doing all that 'after job' in a routine. I'd suggest the routine simply lands the data ready to be consumed and then have a 'regular' job that reads all of those files and does the actual load of them.
-craig

"You can never have too many knives" -- Logan Nine Fingers
arun_im4u
Premium Member
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

Post by arun_im4u »

That was my proposal too, but the client would like to explore the possibility of logging the audit to the table as each job completes. So, I would like to know if there is a way I can write to a table after each job run from an after job routine, rather than run a separate audit job after each job completes.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Keep in mind the fact that you wouldn't *need* to run a separate audit job after each job completes, but could do so once after all jobs have run.

For sql from routines, you'd need to leverage ODBC via the BCI or BASIC Call Interface, not something for the faint hearted. Never mind the fact that the branded ODBC drivers that ship with the product are only for use in the GUI and "don't work" from a routine after 30 days. From what I understand, you'd need to purchase 3rd party drivers to implement this. Legally. Search the forums for BCI to get some ideas about what that would involve.
-craig

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