Recieving a parameter from a stored procedure

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
LANDO
Participant
Posts: 16
Joined: Mon Jan 09, 2006 3:35 am

Recieving a parameter from a stored procedure

Post by LANDO »

Hi All,

I created a procedure that recieves an integer and returns an Integer.
I'm trying to call the procedure vie stored procedure job and write the output into an Oracle table.
It keeps failing with the message of :'Second output column must be a Procedure return message'
What am I doing wrong ? :?
I have defined the 'Stored Procedure' as transform and gave each parameter and assigned target column.

Any suggestions ?
Best Regards,
Lando
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Re: Recieving a parameter from a stored procedure

Post by clarcombe »

LANDO wrote:Hi All,

I created a procedure that recieves an integer and returns an Integer.
I'm trying to call the procedure vie stored procedure job and write the output into an Oracle table.
It keeps failing with the message of :'Second output column must be a Procedure return message'
What am I doing wrong ? :?
I have defined the 'Stored Procedure' as transform and gave each parameter and assigned target column.

Any suggestions ?
Just to confirm are you actually using the stored procedure stage or have you written a job which gets data from a stored procedure.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
LANDO
Participant
Posts: 16
Joined: Mon Jan 09, 2006 3:35 am

Re: Recieving a parameter from a stored procedure

Post by LANDO »

Just to confirm are you actually using the stored procedure stage or have you written a job which gets data from a stored procedure.[/quote]

I'm Using a Stored procedure stage,
But if you have any suggestions on how to implement the stored procedure into a regular job and getting the necessary results that would help as well.
Best Regards,
Lando
LANDO
Participant
Posts: 16
Joined: Mon Jan 09, 2006 3:35 am

Post by LANDO »

Well to be accurate, I'm not sure what exactly you are reffering to.

I open anew server job and drug'n'drop the stored procedure ICON from the pallete --> I create a transformation --> and a target table.
I map the procedure results( I think ) to the proper target column.

Hope this helps to clarify what I'm trying to do.
Best Regards,
Lando
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Hi Lando,
The error message said that 'Second output column must be a Procedure return message'. You did not have a "ProcMess" on the output column of your STP stage. Please read the STP pdf file that will save you a lot time trying to figure out how to use Oracle's stored procedures.
jzparad
Charter Member
Charter Member
Posts: 151
Joined: Thu Apr 01, 2004 9:37 pm

Post by jzparad »

Lando,
I created a procedure that recieves an integer and returns an Integer.
I'm trying to call the procedure vie stored procedure job and write the output into an Oracle table.
From what you say, this looks very much like a lookup. You supply the key, it returns a value. If so, why not create an Oracle function which you can then call from an OCI stage using a simple "select fn(:1) from dual" and use the OCI stage as a lookup.

If you must use a stored procedure for some reason, why can't you just do the insert within the stored procedure again using an OCI stage with a User-defined SQL.
Jim Paradies
LANDO
Participant
Posts: 16
Joined: Mon Jan 09, 2006 3:35 am

Post by LANDO »

jzparad wrote: From what you say, this looks very much like a lookup. You supply the key, it returns a value. If so, why not create an Oracle function which you can then call from an OCI stage using a simple "select fn(:1) from dual" and use the OCI stage as a lookup.
Thanks,
I didn't think of that.
I altered the procedure to act like a function and it works. :D
Best Regards,
Lando
Post Reply