mysql 脚本的脚本

发布于 2024-09-09 08:10:32 字数 334 浏览 2 评论 0原文

我有一个数据库,需要在oracle和mysql中维护。脚本的数据插入脚本如下所示。当然,Mysql 使用源,而 oracle 使用 @ 在所有其他方面,调用的脚本及其调用顺序是相同的。 (那是因为它们只是符合 ANSI 的插入语句)。

有没有办法修改脚本的脚本,使其在mysql和oracle中都可以工作?


-- 在 mysql 中
使用 mydb;
源 insert_man_rows.sql
源 insert_leg_rows.sql

-- 在 oracle 中
@insert_man_rows.sql
@insert_leg_rows.sql

I have a database that I need to maintain in both oracle and mysql. The data insert script of scripts looks like below. Of course Mysql uses source while oracle uses @ In all other respects the scripts invoked and their order of invocation are identical. (That's because they are just ANSI compliant insert statements).

Is there anyway to modify the script of scripts so it works in both mysql and oracle?


-- In mysql
use mydb;
source insert_man_rows.sql
source insert_leg_rows.sql

-- In oracle
@ insert_man_rows.sql
@ insert_leg_rows.sql

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟─花易冷 2024-09-16 08:10:32

您可以创建一个仅包含子脚本名称的原始脚本,然后为您当前使用的一些简单脚本的数据库处理它。

You can create a proto-script that will contain just the names of sub-scripts, and then process it for database you're currently using some simple script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文