组成多个mysql脚本 [英] composing multiple mysql scripts
问题描述
是否可以在复合脚本中包含其他mysql脚本?理想情况下,我不想为所包含的脚本创建存储过程...对于较大的项目,我希望按层次维护几个较小的脚本,然后根据需要进行组合...但是,现在,我很乐于学习如何包含其他脚本...
Is it possible to INCLUDE other mysql scripts in a composite script? Ideally I do not want to create a stored procedure for the included scripts... For larger projects I would like to maintain several smaller scripts hierarchically and then compose them as required... But for now, I'd be happy to just learn how to include other scripts...
推荐答案
source
是一个内置命令,您可以在MySQL客户端工具(用于执行SQL脚本的工具)中使用):
source
is a builtin command you can use in the MySQL client tool (which is what you're using to execute the SQL script):
mysql> source otherfile.sql
If you're executing SQL in a stored procedure or with an API, you should know that MySQL client builtins work only in the MySQL client.
这篇关于组成多个mysql脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!