Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 07:54 AM
Thank you! I will submit that request.
In case anyone else stumbles upon this post, here is a function you can add that will return the view definition from information_schema, unformatted with an ALTER statement at the top:
DROP FUNCTION IF EXISTS <catalog>.<schema>.unformatedView;
CREATE OR REPLACE FUNCTION <catalog>.<schema>.unformatedView(catalogName STRING, schemaName STRING, viewName STRING)
RETURNS TABLE(viewDef STRING)
RETURN
SELECT CONCAT("ALTER VIEW ", catalogName, ".", schemaName, ".", viewName, " AS
", view_definition) as viewDef FROM system.information_schema.views
WHERE
table_catalog = catalogName and
table_schema = schemaName and
table_name = viewName;