Reputation: 811
We have a view definition which internally uses other 5 views. When we use a RoundhousE to execute the database scripts, these view scripts are getting executed in alphabetical order. Hence out of these 5 views, which are used inside the main view, only 3 views are getting executed ahead of the main view and rest 2 views are not yet created and hence the main view script throws error. How can we solve this apart from renaming the views?
Upvotes: 0
Views: 53
Reputation: 12581
Either in the wiki, or in the source docs, I believe we cover this exact scenario. If not, we should add it there.
The solution when you have a dependency on order is to rename the files (not the views). Typically you would put the file names in order based on "0000_" (e.g. 0001_viewname.sql
, 0002_viewname.sql
, etc) at the front of the view name, but you could also just move the name of the main view to "z_" to place it after the other views.
I know you asked how you can solve this apart from renaming the view files, but renaming the files is how you resolve this issue.
Upvotes: 2