简化包和视图的创建 [英] streamlining creating of packages and views

查看:69
本文介绍了简化包和视图的创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有很少的SQL脚本可以设置应用程序的数据库.创建脚本的软件包很少具有很少的视图引用,并且类似的脚本创建脚本具有很少的视图引用.

I have few SQL scripts which setups the db of an app. have few scripts creating packages which has few references of views, and similarly have scripts for creating views which has references of packages.

有没有办法将这两个脚本分开,然后分别分别创建包或视图.

Is there a way to separate these two scripts which would then individually create only packages or views respectively.

或任何替代方法可以解决这个问题.

Or any alternate to work on this.

推荐答案

我认为您必须手动计算参考图,然后相应地命令脚本的执行.

I think you have to calculate the reference graph manually and then order the execution of the scripts accordingly.

因此,您需要创建一组脚本views1.sql,views2.sql,...以及packages1.sql,packages2.sql,... Views1.sql仅包含未引用任何程序包的视图. Packages1.sql仅包含未引用任何视图的软件包. Views2.sql仅包含引用packages1.sql中的程序包的视图. Packages2.sql仅包含引用views1.sql中的视图的软件包.

So you need to create a set of scripts views1.sql, views2.sql, ... and packages1.sql, packages2.sql, ... Views1.sql contains only views that are not referencing any packages. Packages1.sql contains only packages that are not referencing any views. Views2.sql contains only views that are referencing packages from packages1.sql. Packages2.sql contains only packages that are referencing views from views1.sql.

依次类推,直到完成为止.

And so on until you are finished.

这篇关于简化包和视图的创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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