Skip to main content
Solved

Call stored procedure multiple times in SQLExecutor

  • September 18, 2020
  • 3 replies
  • 98 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

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

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

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

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.