Skip to main content
Question

How to run .sql file through FME

  • January 30, 2019
  • 1 reply
  • 248 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?

1 reply

david_r
Evangelist
  • 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.


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