我有几个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.
最满意答案
我认为你必须手动计算参考图形,然后相应地命令脚本的执行。
因此,您需要创建一组脚本views1.sql,views2.sql,...和packages1.sql,packages2.sql,... Views1.sql仅包含未引用任何软件包的视图。 Packages1.sql仅包含不引用任何视图的软件包。 Views2.sql仅包含引用来自packages1.sql的包的视图。 Packages2.sql仅包含引用views1.sql中的视图的包。
等到你完成了。
I think you have to calculate the reference graph manually and then order the execution of the scripts accordingly.
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.
更多推荐
发布评论