call oracle stored procedure in datastage server 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
AmarpreetKaur
Participant
Posts: 3
Joined: Tue Feb 28, 2012 4:18 am

call oracle stored procedure in datastage server job

Post by AmarpreetKaur »

I have one long oracle procedure which I want to execute via datastage server job. It is not taking any parameters and not returning anything. It is extracting data from some mainframe tables (via db links) and loading data in oracle target tables.
It is a long procedure that has got cursors, execute immediate statements, delete stmt, truncate stmt and many more.
It is internally calling some functions to dump data in log tables also.
The procedure is doing fine when we are executing this through unix script or through oracle only.

I want to know how to execute this procedure in datastage server job. Just want to call it and execute it in datastage without passing any parameter.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

What you seek to do is not possible in a server job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
AmarpreetKaur
Participant
Posts: 3
Joined: Tue Feb 28, 2012 4:18 am

Post by AmarpreetKaur »

thanks Ray! Is it possible through parallel jobs? Calling a procedure without any parameters and it will execute at backend...
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

I think you can try before /after sql query tab in oracle stage in server
eg.call storeprocedurename ;
AmarpreetKaur
Participant
Posts: 3
Joined: Tue Feb 28, 2012 4:18 am

Post by AmarpreetKaur »

I tried it using CALL ProcedureName, but it is giving me error: ORA-06576: not a valid function or procedure name. This procedure is working fine at oracle side. I even tried all the suggestions menioned on here.

Any other siggestion?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It does work fine 'Before SQL' in a Server OCI stage. Are you connecting as the owner? Or code in a dummy parameter and call it from the SP stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Re: call oracle stored procedure in datastage server job

Post by Mike »

AmarpreetKaur wrote:It is not taking any parameters and not returning anything.
So what's the rationale for running this stand-alone stored procedure from a server job?

Why not just run it from a job sequence if you simply want its execution controlled by DataStage?

Mike
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Good one Mike.

You can code in dummy parameter and call it from SP stage (as Craig suggested) or call it from ODBC stage... ;)
Kandy
_________________
Try and Try again…You will succeed atlast!!
macromathi1
Participant
Posts: 4
Joined: Tue Sep 18, 2007 3:40 pm
Location: Riyadh, Saudi Arabia

Post by macromathi1 »

oracle procedures very well can be called from before/after sql of oracle stage. check for the connection strings and qualify the procedure with the right schema..
Thanks,
Mathi Sang
Post Reply