Question

How to run .sql file through FME

  • 30 January 2019
  • 1 reply
  • 43 views

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

Userlevel 4

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.

Reply