Comments and answers for "Comments in END_SQL statements ?" https://knowledge.亚搏在线safe.com/questions/62651/comments-in-end-sql-statements.html The latest comments and answers for the question "Comments in END_SQL statements ?" Comment by lifalin2016 on lifalin2016's comment https://knowledge.亚搏在线safe.com/comments/64502/view.html 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.
Wed,21 Feb 2018 07:20:34 GMT lifalin2016
Comment by lifalin2016 on lifalin2016's answer https://knowledge.亚搏在线safe.com/comments/63256/view.html
(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,和/ *……*/ would also work.
Cheers,and have a nice weekend.


Fri,02 Feb 2018 10:38:37 GMT lifalin2016
Answer by takashi https://knowledge.亚搏在线safe.com/answers/62655/view.html

@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 Help
Because 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.
Fri,26 Jan 2018 08:52:55 GMT takashi