Skip to main content
Question

How to run .sql file through FME

  • January 30, 2019
  • 1 reply
  • 312 views

kamalkarnatak3
Contributor
Forum|alt.badge.img

I want to execute a .sql file through FME. Is there any method to call a sql file before running FME translation? I think it is not possible through sql creator or executor. Is there any other way?

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.

1 reply

david_r
Celebrity
  • 8394 replies
  • January 30, 2019

If the sql file contains regular SQL statements then you can use the SQLExecutor or SQLCreator.

My preference would probably be to use a text file reader (read whole file at once = yes) and pass it into a SQLExecutor. You will probably have to prefix the file contents with the following line

FME_SQL_DELIMITER ;

Notice the space before the semi-colon.

If the sql file contains something like psql or sqlplus interactive commands, then you can look into the SystemCaller and use it with the corresponding database command line interpreter, passing the .sql file as a command line parameter.