Announcement
Collapse
No announcement yet.
VVin_Virtuals, Field Aliases, and Order Bys
Collapse
X
-
Thanks for all the information and this will be fixed in the next 6.1 update
Leave a comment:
-
Thank you for letting me know! After trying that, I found that the fourth statement that I wrote is still invalid because the NAB Editor added "AS vv0" to the vvin_virtual that already had "AS myfield" in it.
Leave a comment:
-
If you need to save the data source, you can try pressing the escape key for now to get past the popup window.
Leave a comment:
-
The code above works, but if I try to do this:
Code:SELECT vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') AS myfield FROM democmast GROUP BY vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') ORDER BY myfield
Code:WITH my_cte AS ( SELECT vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') AS myfield FROM democmast GROUP BY vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') ) SELECT * FROM my_cte ORDER BY myfield
Code:WITH my_cte AS ( SELECT vvin_virtual( 'field', 'cname AS myfield', 'char', 10, NULL, 'false' ) FROM democmast GROUP BY vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') ) SELECT * FROM my_cte ORDER BY myfield
Code:SELECT vvin_virtual( 'field', 'cname AS myfield', 'char', 10, NULL, 'false' ) FROM democmast GROUP BY vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') ORDER BY myfield
Data Source
Alias added to your column(s) starting with "VV"
I hope this helps!
Leave a comment:
-
I just tried the following statement successfully. Is this similar to what you are attempting?
Code:SELECT vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') AS myfield FROM democmast GROUP BY vvin_virtual('field', 'cname', 'char', 10, NULL, 'false') ORDER BY vvin_virtual('field', 'cname', 'char', 10, NULL, 'false')
Leave a comment:
-
VVin_Virtuals, Field Aliases, and Order Bys
I have discovered some issues with the NAB Data Source Editor regarding vvin_virtuals, field aliases, and order by clauses.
I want to make a data source that selects upon a vvin_virtual, and then groups and orders the data by that vvin_virtual. This works fine until I want to make an alias for the vvin_virtual, and then put the alias in the ORDER BY clause. If I try that, I get this error:
SQL0206 - Column or global variable {alias name} not found.
If I try to put the SELECT statement in a CTE and then select from that CTE, ordering by the alias outside of the CTE, I still get the same error.
Interestingly, if I place the "AS {alias name}" from the select clause directly inside of the vv_invirtual, the CTE method mentioned above works.
However, this only works using a CTE. If I were to keep the vv_invirtual mentioned above, go back to using only a select statement, and order by the alias, then the NAB Data Source Editor will proceed to the "Preview" screen and show a popup that says this:
Data Source
Alias added to your column(s) starting with "VV"
The "OK" button on this popup does not work and I have no other choice but to close NAB, meaning that I will never be able to save the data source.Tags: None
Leave a comment: