Не уверен, что есть проблема ... хотя !exit
может быть проблемой. Во-первых, еще один пример:
Мой тест с комментариями. sql:
select 'hello Grovers Corner';
-- this is a double dash comment
select 'hello Indiana'
-- dashes in middle of sql statement
from information_schema.tables
fetch 1 row only;
select 'hello United States'
// slashes in middle of sql statement
from information_schema.tables
fetch 1 row only;
// some final slashes on the last line
... обратите внимание, что нет !exit
в конце скрипт
... и выполнение snow sql с результатами:
$ snowsql -f comments.sql -o echo=True
* SnowSQL * v1.1.86
Type SQL statements or !help
select 'hello Grovers Corner';
+------------------------+
| 'HELLO GROVERS CORNER' |
|------------------------|
| hello Grovers Corner |
+------------------------+
1 Row(s) produced. Time Elapsed: 0.085s
-- this is a double dash comment
select 'hello Indiana'
-- dashes in middle of sql statement
from information_schema.tables
fetch 1 row only;
+-----------------+
| 'HELLO INDIANA' |
|-----------------|
| hello Indiana |
+-----------------+
1 Row(s) produced. Time Elapsed: 1.803s
select 'hello United States'
// slashes in middle of sql statement
from information_schema.tables
fetch 1 row only;
+-----------------------+
| 'HELLO UNITED STATES' |
|-----------------------|
| hello United States |
+-----------------------+
1 Row(s) produced. Time Elapsed: 1.748s
// some final slashes on the last line
000900 (42601): SQL compilation error:
Empty SQL statement.
Goodbye!
$
Итак, двойная косая черта не повлияла на оператор sql, но они путают конец сценарий!
Наконец, я заменил двойные косые черты в последней строке двойными черточками, и произошла нет SQL ошибка компиляции. И те же результаты без опции echo = True на этапе выполнения командной строки.
Я думаю, что это связано с моим собственным вопросом о явной невозможности НЕ завершать работу сценария при вызове из командной строки snow sql , (Смотрите ТАК вопрос логин. sql и НЕ выход )