Skip to main content
Question

How to get results in SQL Executor/Creator from Oracle with the plsql block?

  • February 22, 2019
  • 5 replies
  • 171 views

I have a plsql script to perform some task on db. But it doesn't contain any code for returning output(results are stored in variables). I need to get these results into FME SQL executor or creator.

Is there any code sample to start with this? All I need is a example plsql code to get results into FME SQL Executor.

5 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • February 22, 2019

The only way to get data from a PL/SQL block into FME is storing the results in some format.

Two possible solution:

1) Store the result in a table by using an INSERT SQL statement in the PL/SQL and follow by a FeatureReader transformer to read the data from the table.

2) Store the result in a text file using the PL/SQL package UTL_FILE and read the contents of the text file using the FeatureReader transformer (or in case of a single attribute using the AttributeFileReader transformer.

Hope this helps.


  • Author
  • February 25, 2019
erik_jan wrote:

The only way to get data from a PL/SQL block into FME is storing the results in some format.

Two possible solution:

1) Store the result in a table by using an INSERT SQL statement in the PL/SQL and follow by a FeatureReader transformer to read the data from the table.

2) Store the result in a text file using the PL/SQL package UTL_FILE and read the contents of the text file using the FeatureReader transformer (or in case of a single attribute using the AttributeFileReader transformer.

Hope this helps.

Hi Erik,

Thank you for your response!

As you said I tried the first option but getting errors. Can you guide me with some example?

 


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • February 25, 2019
gauripearl wrote:

Hi Erik,

Thank you for your response!

As you said I tried the first option but getting errors. Can you guide me with some example?

 

What is the error you run into?


  • Author
  • February 25, 2019
erik_jan wrote:

The only way to get data from a PL/SQL block into FME is storing the results in some format.

Two possible solution:

1) Store the result in a table by using an INSERT SQL statement in the PL/SQL and follow by a FeatureReader transformer to read the data from the table.

2) Store the result in a text file using the PL/SQL package UTL_FILE and read the contents of the text file using the FeatureReader transformer (or in case of a single attribute using the AttributeFileReader transformer.

Hope this helps.

Error I get is, Invalid SQL statement .

Is it possible to write a function which will return results?

https://knowledge.safe.com/questions/82948/sql-executor-run-a-procedure.html

Here you have mentioned about it. Is it the best way to do that? Can you please guide me about how to do this.


Forum|alt.badge.img+2
gauripearl wrote:

Error I get is, Invalid SQL statement .

Is it possible to write a function which will return results?

https://knowledge.safe.com/questions/82948/sql-executor-run-a-procedure.html

Here you have mentioned about it. Is it the best way to do that? Can you please guide me about how to do this.

@gauripearl Regarding your error Invalid SQL Statement: You may have to use the FME_SQL_DELIMITER parameter if you have multi-line statements.


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