Store procedure in DataStage

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
peppinodicapri
Participant
Posts: 5
Joined: Thu Jan 27, 2005 8:34 am

Store procedure in DataStage

Post by peppinodicapri »

I have tried to execute one procedure in stage ODBC: User-defined
SQL=call nameprocedure(); The procedure is executed several times
(loop). How I can avoid the loop?

Thanks
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
please post the structure of the job.
I used a stored procedure via ODBC but it never run more then once.
so I wonder how come your's does?
does the SP have a recursive call?, or does it simply contains a bad join which results in a cartezian result set (5 rows from table a with no join on table b having also 5 rows will return 5*5 = 25 rows)???

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
lpadrta
Premium Member
Premium Member
Posts: 38
Joined: Thu Nov 07, 2002 7:39 am
Location: Jacksonville, FL

Post by lpadrta »

Hello peppinodicapri,

I have also come across a situation where I ran a DataStage job one time that called a stored procedure one time via an ODBC connection, and the DataStage job logs show one execution, but tracing on the SQL server shows the stored procedure executed multiple times. And the same thing happens with other stored procedures. I even ran one of the stored procedure from Query Analyzer and the stored procedure executed multiple times.

That seems to suggest there is something interesting about the stored procedures, not DataStage.

Did you ever find out why yours did that?

Thanks,

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

Re: Store procedure in DataStage

Post by ray.wurlod »

peppinodicapri wrote:I have tried to execute one procedure in stage ODBC: User-defined
SQL=call nameprocedure(); The procedure is executed several times
(loop). How I can avoid the loop?

Thanks
The stored procedure is called once for each row processed by the job.

The only way you can "avoid the loop" is by processing only one row.
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