MySQL中的spool命令等效于什么? [英] What is the equivalent of the spool command in MySQL?

查看:294
本文介绍了MySQL中的spool命令等效于什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道您在尝试将报告写入Oracle SQLplus中的文件时使用了spool命令.

I know you use the spool command when you are trying to write a report to a file in Oracle SQLplus.

MySQL中的等效命令是什么?

What is the equivalent command in MySQL?

这是我的代码:

set termout off

spool ${DB_ADMIN_HOME}/data/Datareport.log @ ${DB_ADMIN_HOME}/Scripts.Datavalidation/Datareportscript.sql

spool off
exit

如何在MySQL中编写它?

How can I write it in MySQL?

推荐答案

如果我明白了你的要求:

If I get what you are asking:

mysql dbname < ${DB_ADMIN_HOME}/Scripts.Datavalidation/Datareportscript.sql \
> ${DB_ADMIN_HOME}/data/Datareport.log 

使用重定向.

这篇关于MySQL中的spool命令等效于什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆