Page 1 of 2

Execute stored procedure without input link

Posted: Tue Oct 28, 2008 2:24 pm
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

Posted: Tue Oct 28, 2008 2:46 pm
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.

Posted: Tue Oct 28, 2008 5:15 pm
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

Posted: Tue Oct 28, 2008 5:17 pm
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

Posted: Tue Oct 28, 2008 10:10 pm
by owen3
We did:

Row_Gen-------->Store_Procedure------->Col_Gen--------->Output

Posted: Tue Oct 28, 2008 10:37 pm
by chulett
Not in a Server job, boys and girls. 'Ware the Job Type.

Posted: Wed Oct 29, 2008 7:48 am
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

Posted: Wed Oct 29, 2008 7:50 am
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.

Posted: Wed Oct 29, 2008 9:40 am
by aasaif
i always set it to transform

Posted: Wed Oct 29, 2008 9:50 am
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.

Posted: Wed Oct 29, 2008 10:14 am
by aasaif
I started with a transformer to the stored procedure but i get an error saying the transformer needs a input link

Posted: Wed Oct 29, 2008 10:20 am
by chulett
Because you did not add a stage variable as I specified. No need to use it but it needs to exist.

Posted: Wed Oct 29, 2008 1:19 pm
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

Posted: Wed Oct 29, 2008 1:20 pm
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

Posted: Wed Oct 29, 2008 2:15 pm
by dslisa
Have you tried @outrownum=1 as a constratint in the transformer??