Standalone Stored procedure stage execution

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
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Standalone Stored procedure stage execution

Post by VCInDSX »

Hi,
I have a need to execute a MS SQL 2005 stored procedure from a datastage PX job and pass 4 parameters to this stored procedure via job parameters.

I created a new PX job and added one "Stored Procedure" Stage to it and set it up as "Transform" type.

I was able to configure the procedure name, connection details and all the required settings. However when i try to set the parameters, it prompts that the column name should match an existing column.

I tried importing the procedure into the repository and loaded into the Stored Procedure stage, but it still needs the column name to be existing in the job.

To satisfy this, I added a Row Generator stage that would supply dummy values and it worked well. Then i converted the Row Generator to generate only one record and set the columns to take the values from the job parameters.

I saw another post viewtopic.php?t=117033 where a "No Param" stored procedure was discussed and there were suggestions to use a transformer or DRS.

Are there any do's and don'ts in these approaches?

If i can execute the procedure without any additional stages, that would be best, but it appears that for most cases, a dummy transformer would be required to get things moving.

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

Re: Standalone Stored procedure stage execution

Post by chulett »

VCInDSX wrote:If i can execute the procedure without any additional stages, that would be best
You can't in a job. Something must drive it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

VCInDSX,
It's columns mapping of your STP stage's Maps to Column is wrong.
One of the enhanced features for 8.0.1 is that finally you can use STP stage against MS SQL Server.
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

Craig,
Thanks for the followup and your time.
Is there any overhead in using the Row Generator to route the param values to the job or should i look into using transformer for such purposes?


lstsaur,
Thanks for your time. I am afraid i am not following your feedback point(s) especially line 1 of your response.
It's columns mapping of your STP stage's Maps to Column is wrong.

You are correct, 8.0.1 has support for SQL Server Stored procedures. I am using the Stored Proecdure stage and have selected the DBMS type as SQL Server.

Thanks,
-V
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

Craig,
Thanks for the followup and your time.
Is there any overhead in using the Row Generator to route the param values to the job or should i look into using transformer for such purposes?


lstsaur,
Thanks for your time. I am afraid i am not following your feedback point(s) especially line 1 of your response.
It's columns mapping of your STP stage's Maps to Column is wrong.

You are correct, 8.0.1 has support for SQL Server Stored procedures. I am using the Stored Proecdure stage and have selected the DBMS type as SQL Server.

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

Post by chulett »

I would think that, in a PX job, a Row Generator would be the most appropriate starting point. With no equivalent in Server to that stage, we use a Transformer. However, you could use either I would imagine. [shrug]
-craig

"You can never have too many knives" -- Logan Nine Fingers
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

The warning message, the column name should match an existing column, tells that your Maps to Columns mapping of the Parameters tab is incorrect. Read STP pdf for detailed example how to map your parameters to existing columns.
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

As craig opined, it is not possible to have the Stored Procedure Stage on a job canvas by itself. For now, I will leave the Row Generator linked to the STP.

As for the matching column name, the Row Generator or some sort of input link needs to supply the column name that can be mapped to the Stored Procedure's parameter name. In my case, Row Generator is serving the purpose.

If there is any other way to do this, I will be willing to try that out.

Many Thanks,
-V
Post Reply