on 2019 May 24 6:17 AM
While SQL Anywhere has supported temporary procedures and functions for a long time (at least with ASA 9 and above), views can only be created either permanently or on a per-statement level via common table expressions.
I would appreciate a CREATE TEMPORARY VIEW statement enhancement with all the reasons why temporary procedures and local temporary tables are useful:
My current use case is a complex analysis of some data which requires several complex views, so it would be quite difficult to use CTE for those, and on the other hand those views are focussed on that particular use case and won't be generally usable, so I would like to restrict them to the current connection and avoid them as permanent views.
Of course, please tell me if there is already a way to use temporary views:)
I agree 100%... the WITH clause is very useful, and I use it quite often to create multiple "cascading" view definitions to divide-and-conquer a difficult query... they are easier to code and debug than derived tables embedded in the final FROM.
...BUT a separate CREATE TEMPORARY VIEW statement would be even better because it would allow you to code it once and then use it in multiple separate queries.
In particular, it would be useful for building complex adhoc queries in Foxhound, especially if it had the same "Privileges" requirement as CREATE TEMPORARY PROCEDURE: "You do not need any privilege to create temporary procedures."
In other words, any user with SELECT privileges on the underlying tables would be able to use CREATE TEMPORARY VIEW with no extra privileges.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.