Execute SQL Server Stored Procedure Multiple times in a loop

Seven Stars

Execute SQL Server Stored Procedure Multiple times in a loop

Hi,

 

I want to execute the same stored procedure 3 times but with different values of input parameter to stored procedure for each of these 3 iterations. Basically stored procedure creates different sql depending upon the value of the parameter.

 

Can some one please tell me how this can be done? Any turtorial or video for this would be of great help.

 

Regards

Tarunjit Singh


Accepted Solutions
Thirteen Stars

Re: Execute SQL Server Stored Procedure Multiple times in a loop

generally similar way:

 

https://community.talend.com/t5/Design-and-Development/how-to-iterate-tRESTClient-page-number-from-M...

 

not important - is it REST server or Stored procedure

 

in any case the best way - do anything, and ask help when error or problem happens

 

 

 

 


https://community.talend.com/t5/What-s-new-and-announcements/We-are-all-developers-here-aren-t-we/m-...

 

 

-----------

All Replies
Thirteen Stars

Re: Execute SQL Server Stored Procedure Multiple times in a loop

You just need:

 

tLoop for 3 iteration
tJava or tFixedFlowInput for store parameters for each iteration and call procedure with current parameters

-----------
Seven Stars

Re: Execute SQL Server Stored Procedure Multiple times in a loop

Hi,

 

Thanks for the answer.

 

How can we pass different values in parameter of stored procedure for each iteration in tFixedFlowInput.

 

Here is an example :-

  • For first iteration we need to pass value 'ABC' in parameter of stored procedure.
  • For second iteration we need to pass value 'DEF' in parameter of stored procedure.
  • For second iteration we need to pass value 'GHI' in parameter of stored procedure

Any tutorial regarding passing dynamic values in stored procedure parameters will be of great help.

 

Regards

Tarunjit Singh

Thirteen Stars

Re: Execute SQL Server Stored Procedure Multiple times in a loop

generally similar way:

 

https://community.talend.com/t5/Design-and-Development/how-to-iterate-tRESTClient-page-number-from-M...

 

not important - is it REST server or Stored procedure

 

in any case the best way - do anything, and ask help when error or problem happens

 

 

 

 


https://community.talend.com/t5/What-s-new-and-announcements/We-are-all-developers-here-aren-t-we/m-...

 

 

-----------