oracle 将 SQL 文件包含到另一个 SQL 文件中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4268775/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 22:02:10  来源:igfitidea点击:

Include SQL file to another SQL file

sqlspringoracleincludeinit

提问by sergionni

I have a specific SQL file that may be "connected" to another, more generic SQL init file.

我有一个特定的 SQL 文件,它可以“连接”到另一个更通用的 SQL init 文件。

Is it possible to somehow include reference from one SQL file to another SQL file?

是否有可能以某种方式包含从一个 SQL 文件到另一个 SQL 文件的引用?

I am using Oracle and the DB is populated using Spring DataSourceInitializerclass.

我正在使用 Oracle,并且数据库是使用 SpringDataSourceInitializer类填充的。

回答by a_horse_with_no_name

If you are using SQL*Plus to run your script, you can use the @ (or @@) sign to include another SQL script.

如果您使用 SQL*Plus 运行您的脚本,您可以使用@(或@@)符号来包含另一个 SQL 脚本。

See the manual for details:

详情请参阅手册:

http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12002.htm#i2696724

http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12002.htm#i2696724

http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12003.htm#i2696759

http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12003.htm#i2696759