Routine example code

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
maheshsada
Participant
Posts: 69
Joined: Tue Jan 18, 2005 12:15 am

Routine example code

Post by maheshsada »

I want to write a routine, which needs to call a oracle database procedure and return the error or success code.

Based on that the job should get failed or success.

i have thought of ODBC stage, but we need to create ODBC datasource in the client for the stage to connect.

But since iam not sure how to deploy that thinking of writing a routine and just calling the procedure in the routine

I have searched forum and pdf also not able to trace a suitable example.

regards

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

Post by kcbland »

In your routine use the DSExecute API to run system commands. By running sqlplus with the appropriate information you can get the results and error checking you desire.
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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You are going to need a properly configured Oracle client on the DataStage server machine no matter what you want to do. Whether you use a DataStage job (the preferred approach) or not, what you're creating is a client application as far as Oracle is concerned.

So do think about using the tool properly; the OCI and ODBC stages can already do what you want. Your alternatives are to write a routine using BCI functions (search the Forum) or to write a shell script to call sqlplus (again search the Forum).
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