Hi @lifalin2016, there is an FME specific syntax says any error occurs while executing a SQL statement won't stop the translation (i.e. FME ignores the error) if the statement was preceded with a single hyphen.
"An individual statement may be preceded with a hyphen, indicating that errors should be ignored.
The following example contains two SQL commands where errors from the first command will be ignored:FME_SQL_DELIMITER ;-SELECT * FROM TABLEA;SELECT * FROM TABLEB;" -- SQL Statement, Parameters, SQLExecutor HelpBecause of that, I think that FME removes the leading hyphen from any statement before passing the statement to a database engine and therefore it could cause the error you have observed on a comment statement starting with two hyphens.I don't consider it as a bug, but think it should be documented somewhere, or there is a room to improve the implementation not to remove the first hyphen if the line starts with two consecutive hyphens.
Hi @lifalin2016, there is an FME specific syntax says any error occurs while executing a SQL statement won't stop the translation (i.e. FME ignores the error) if the statement was preceded with a single hyphen.
"An individual statement may be preceded with a hyphen, indicating that errors should be ignored.
The following example contains two SQL commands where errors from the first command will be ignored:FME_SQL_DELIMITER ;-SELECT * FROM TABLEA;SELECT * FROM TABLEB;" -- SQL Statement, Parameters, SQLExecutor HelpBecause of that, I think that FME removes the leading hyphen from any statement before passing the statement to a database engine and therefore it could cause the error you have observed on a comment statement starting with two hyphens.I don't consider it as a bug, but think it should be documented somewhere, or there is a room to improve the implementation not to remove the first hyphen if the line starts with two consecutive hyphens.
(adding as comment instead of answer)
Thanks Takashi.
That would explain it, although I didn't use SqlExecutor, so its embedded help wasn't readily available.
But
yes, there's room for some improvement. My expectation in an SQL window
designed for SQL Server commands would clearly be, that it supports
standard T-SQL. At least having the FME "syntax extensions" be
optionally added (e.g. with a checkbox) would go a long way to resolve
expectations.
But summarizing, it seems that three dashes would indeed work, and /* ... */ would also work.
Cheers, and have a nice weekend.
(adding as comment instead of answer)
Thanks Takashi.
That would explain it, although I didn't use SqlExecutor, so its embedded help wasn't readily available.
But
yes, there's room for some improvement. My expectation in an SQL window
designed for SQL Server commands would clearly be, that it supports
standard T-SQL. At least having the FME "syntax extensions" be
optionally added (e.g. with a checkbox) would go a long way to resolve
expectations.
But summarizing, it seems that three dashes would indeed work, and /* ... */ would also work.
Cheers, and have a nice weekend.
Actually, it's still not quite good.
Even when I know that a command will fail, and prepend the command with a dash, it still (when failing) gets logged as an error in the log file.
This is most irritating, as I assumed the dash would make FME ignore any errors. At least don't log it as an error, just as a warning.
Closing this as behaviour has changed in later versions.