Error while executing Sql Server stored procedure

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
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Error while executing Sql Server stored procedure

Post by prasson_ibm »

Hi All,

I am trying to execute a Sql-Server Stored procedure from Datasage parallel job and my job is like this:-

RowGen(1 row) ---->Stored Procedure stage ----> peek stage

I have imported the metadata from TableDefinition--> Stored Procedure Def.

I have selected below setting in StoredProcedure Stage:-

General Tab:
-------------------------------
Database Vendor: MySQL Server

Syntex Tab:
-------------------------
Procedure Type: Transform
Procedure Name: dbo.UP_IN_AMBIT_PRICE;
Procedure call Syntex: EXEC dbo.UP_IN_AMBIT_PRICE;

Parameter Tab:
------------------
I removed Return Value from parameter name since in output link I checked Procedure status to link.

Input Tab:
-----------------
Unchecked to Forward Raw data and Execute procedure for each row.

Output Tab:
--------------
Checked procedure status to link and procedure allow multiple rows.

Now when I am executing the job I am getting below error message:

Code: Select all

Stored_Procedure_5,0: Failure during execution of operator logic.
APT_CombinedOperatorController,0: Fatal Error: Fatal: Wrong number or types of arguments in call to dbo.UP_IN_AMBIT_PRICE;
Can anyone help me to trace the issue. I don't know where exactly I am doing wrong :(

Thanks
Prasoon
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,

I executed the PROC on sql server and its giving output:

USE[IMJID]
GO

DECLARE @return_value int

EXEC [odb].[UP_IN_AMBIT_PR]

SELECT 'Return Value' = @return_value

GO

In this case which stored procedure type will be appropriate (source/Transform).

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

Post by chulett »

The type is very straight-forward:

If data only comes out: Source
If data only goes in: Target
If data goes in and out: Transform
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Ok,
In my case data is going out so Source Stored Procedure will work.

Now i am struggling with my first issue,with error like

"al: Wrong number or types of arguments in call to dbo.UP_IN_AMBIT_PRICE"

Here we don't have any argument passing to stored procedure and yes we are getting a return value which i suppose to get in output column as ProCode.

Kindly need your help.

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

Post by chulett »

prasson_ibm wrote:In my case data is going out so Source Stored Procedure will work.
For that to be true you'd need to get rid of the Row Generator.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Ok I have removed row regenerator.

Now my design is :

Stored Procedure Stage -----> Peek Stage.

Still I am getting same error as I have mentioned before.

What could be the reason for this issue.

Thanks
Prasoon
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Take a good look at the UP_IN_AMBIT_PRICE stored procedure. What exactly does it do? From the name, I'd expect it to have an input argument and an output argument but, without seeing its actual SQL, cannot be totally certain.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
BillB
Premium Member
Premium Member
Posts: 48
Joined: Tue Nov 13, 2007 6:44 pm

Post by BillB »

Can you try this, and see if it helps?
On the Syntax tab of your stored procedure stage
a) Uncheck Generate prodecure call
b) Edit the Procedure call syntax so it looks like this

Code: Select all

{ ? = CALL UP_IN_AMBIT_PRICE }
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi All,

I am able to resolve the issue. I was getting error because there were two columns with same name and while importing the metadata in job, one of the column was not importing.

I raised this concern to associated team and they renamed one of the column.
Post Reply