Skip to main content
Question

SQLExecutor Stored Procedure with return value


Folks, we are trying to call an Oracle Stored Procedure using SQLExecutor that send the student information and it return student_id back to FmE to be used in subsequenct translations. any idea how to do it in FME.

store procedure name

intsertStudent(name,address,class) return student_id.

Apprciate your help!

 

 

 

 

3 replies

david_r
Evangelist
  • July 14, 2021

Try something like this:

select insertStudent('@Value(student_name)', 
  '@Value(student_address)', 
  '@Value(student_class)'as "student_id" 
from dual

This assumes that you have the attributes student_namestudent_address and student_class entering the SQLExecutor. You should get one feature back with the attribute student_id, which you'll have to expose manually in the SQLExecutor.


david_r wrote:

Try something like this:

select insertStudent('@Value(student_name)', 
  '@Value(student_address)', 
  '@Value(student_class)'as "student_id" 
from dual

This assumes that you have the attributes student_namestudent_address and student_class entering the SQLExecutor. You should get one feature back with the attribute student_id, which you'll have to expose manually in the SQLExecutor.

Thanks David,  this technique does not work when your function is performing DML operations. Error i got from FME

 

did not succeed; error was `ORA-14551: cannot perform a DML operation inside a query

 


nampreetatsafe
Safer
Forum|alt.badge.img+12

I'm wondering if the solution @david_r​ suggested in this post would work in your case: https://community.safe.com/s/question/0D54Q000080hKDTSA2/results-from-oracle-stored-procedure


Reply


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