Question

SQLExecutor Stored Procedure with return value

  • 14 July 2021
  • 3 replies
  • 40 views

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

Userlevel 5

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.

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

 

Userlevel 1
Badge +10

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