(8.0.26)
mysql コマンドで -sオプション追加
mysql -s test <<EOF | tee a.sql
select 'select now();'
EOF
(19c)
sqlplusコマンドで -Sオプション追加
sqlplus -S test/test@pdb1 <<EOF | tee a.sql
set head off
select 'select systimestamp from dual;' from dual;
EOF
sqlplus test/test@pdb1 < a.sql
(14)
psqlコマンドで -tオプション追加
psql -t test <<EOF | tee a.sql
select 'select clock_timestamp();'
EOF
(2019)
sqlcmdコマンドで "-h -1"オプション追加し、SQL実行前にset nocount on;を追加
sqlcmd -h -1 -E -S mmm061 -d test -Q "set nocount on;select 'select getdate();';" | tee-object a.sql
sqlcmd -E -S mmm061 -d test -i a.sql