Execute stored procedure without input link

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

aasaif
Participant
Posts: 98
Joined: Fri Sep 19, 2008 9:12 am

Execute stored procedure without input link

Post by aasaif »

Hello -
I need to execute to execute a stored procedure that only inserts into a job log then run my etl job. All my input parameters for the stored procedure are job parameters. I am trying to figure out how to execute a stored procedure while passing job parameters and then begin to load the data any help? I have created a stored procedure stage for the sp

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

Post by chulett »

Use an input link. Start from a Transformer, adding a dummy stage variable so it will compile and a constraint of "OUTROWNUM=1" so it only generates one row. Set your job parameters into fields in the input link so they can be easily passed to the stored procedure.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dslisa
Participant
Posts: 24
Joined: Mon Oct 27, 2008 6:48 pm

Post by dslisa »

Or you could start with a row generator stage. Set number of rows to produce to 1 and define your columns same as your input parameter.

so your job design will be like

row generator--------------->SP Stage----------------------->Output
dslisa
Participant
Posts: 24
Joined: Mon Oct 27, 2008 6:48 pm

Post by dslisa »

Or you could start with a row generator stage. Set number of rows to produce to 1 and define your columns same as your input parameter.

so your job design will be like

row generator--------------->SP Stage----------------------->Output
owen3
Participant
Posts: 18
Joined: Mon Dec 17, 2007 8:27 pm

Post by owen3 »

We did:

Row_Gen-------->Store_Procedure------->Col_Gen--------->Output
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not in a Server job, boys and girls. 'Ware the Job Type.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aasaif
Participant
Posts: 98
Joined: Fri Sep 19, 2008 9:12 am

Post by aasaif »

I was little confused again on how you only get one row to come out of tranformer stage or stored procedure stage based on when complete. Because at the end of the job after the update stored procedure is complete i have to call another stored procedure for job complete
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First mention of that requirement. Have you tried (from memory) setting it to a "Transform" type in the SP stage? Rather than Source or Target that is.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aasaif
Participant
Posts: 98
Joined: Fri Sep 19, 2008 9:12 am

Post by aasaif »

i always set it to transform
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Swell. Then that means it can support an output link as well as an input link and you can use the Forward row data option to pass the same columns out as came in.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aasaif
Participant
Posts: 98
Joined: Fri Sep 19, 2008 9:12 am

Post by aasaif »

I started with a transformer to the stored procedure but i get an error saying the transformer needs a input link
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Because you did not add a stage variable as I specified. No need to use it but it needs to exist.
-craig

"You can never have too many knives" -- Logan Nine Fingers
aasaif
Participant
Posts: 98
Joined: Fri Sep 19, 2008 9:12 am

Post by aasaif »

I was about to compile and insert into the job log so my two questions is this.

1. Since i am only passing one row into the stored procedure, how do i tell the transformer to only pass one row to the stored procedure?

2. After the stored procedue completed how do i tell it to continue on to uploading the data file
aasaif
Participant
Posts: 98
Joined: Fri Sep 19, 2008 9:12 am

Post by aasaif »

I was about to compile and insert into the job log so my two questions is this.

1. Since i am only passing one row into the stored procedure, how do i tell the transformer to only pass one row to the stored procedure?

2. After the stored procedue completed how do i tell it to continue on to uploading the data file
dslisa
Participant
Posts: 24
Joined: Mon Oct 27, 2008 6:48 pm

Post by dslisa »

Have you tried @outrownum=1 as a constratint in the transformer??
Post Reply