Assume, you need to execute the script which is a little long and the output can not be captured in a single screenshot, so we can make use of spooling the output in the log file.
once you are ready to execute the script, browse to the location where you want to save a log file, in the snowsql command prompt use the below option (!spool on/off)
C:\Users>cd C:\Users\database
C:\Users\database>
C:\Users\database>snowsql -a **** -u technosnow
technosnow#TECHNO_WS@SNOWFLAKE.INFORMATION_SCHEMA>!spool snowflake_first_log.log
technosnow#TECHNO_WS@SNOWFLAKE.INFORMATION_SCHEMA>SELECT CURRENT_DATABASE();
+--------------------+
| CURRENT_DATABASE() |
|--------------------|
| SNOWFLAKE |
+--------------------+
1 Row(s) produced. Time Elapsed: 0.503s
technosnow#TECHNO_WS@SNOWFLAKE.INFORMATION_SCHEMA>SELECT CURRENT_SCHEMA();
+--------------------+
| CURRENT_SCHEMA() |
|--------------------|
| INFORMATION_SCHEMA |
+--------------------+
1 Row(s) produced. Time Elapsed: 0.509s
technosnow#TECHNO_WS@SNOWFLAKE.INFORMATION_SCHEMA>!spool off;
technosnow#TECHNO_WS@SNOWFLAKE.INFORMATION_SCHEMA>
In this way, you can re-direct the output of scripts executed in the snowflake database
0 comments:
Post a Comment