Skip to main content
Solved

Call stored procedure multiple times in SQLExecutor

  • September 18, 2020
  • 3 replies
  • 67 views

sunsilk11
Contributor
Forum|alt.badge.img+6

Hi I would like to call an oracle stored multiple times, passing different parameters.

It seems only the first call is successful.

Any idea what is the correct syntax ?

 

begin 

storedproc1(param1, parm2);

storedproc1(param3, parm4);

end;

 

I have also tried

FME_SQL_DELIMITER / 

begin 

storedproc1(param1, parm2);

storedproc1(param3, parm4);

end;

/

Best answer by david_r

sunsilk11 wrote:

No error. Simply the first call works. The rest doesn't.

If I create multiple (12) SQLExecutor and make one call in each, all work.

This implies an issue in the syntax when having multiple calls. Could it be that I need a delay somewhere?

 

You could always try the following, to see if it makes a difference:

FME_SQL_DELIMITER / 
begin 
storedproc1(param1, parm2);
end;
/
begin 
storedproc1(param3, parm4);
end;
/

But I would recommend that you try start by looking into what's happening on the database server. In principle, FME does nothing more than splitting up the statements according to the FME_SQL_DELIMITER and sending each block to the database as-is. So my first hunch would be to start looking there.

View original
Did this help you find an answer to your question?

3 replies

david_r
Celebrity
  • September 18, 2020

You should not use FME_SQL_DELIMITER in this case, so the first example should be correct.

Do you get any error messages?


sunsilk11
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • September 18, 2020
david_r wrote:

You should not use FME_SQL_DELIMITER in this case, so the first example should be correct.

Do you get any error messages?

No error. Simply the first call works. The rest doesn't.

If I create multiple (12) SQLExecutor and make one call in each, all work.

This implies an issue in the syntax when having multiple calls. Could it be that I need a delay somewhere?

 


david_r
Celebrity
  • Best Answer
  • September 18, 2020
sunsilk11 wrote:

No error. Simply the first call works. The rest doesn't.

If I create multiple (12) SQLExecutor and make one call in each, all work.

This implies an issue in the syntax when having multiple calls. Could it be that I need a delay somewhere?

 

You could always try the following, to see if it makes a difference:

FME_SQL_DELIMITER / 
begin 
storedproc1(param1, parm2);
end;
/
begin 
storedproc1(param3, parm4);
end;
/

But I would recommend that you try start by looking into what's happening on the database server. In principle, FME does nothing more than splitting up the statements according to the FME_SQL_DELIMITER and sending each block to the database as-is. So my first hunch would be to start looking there.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings