Hi All,
Just want to know when a view of a Query is refreshed?
It appears that I had a view that was not up to date.
Dream
so you can create a query that is based on a view but not the other way round.
Villeroy wrote:A view that used to be a query, saved with right-click>"Create as view", will never be "refreshed" in terms of "synchronized with the modified query" just like a file that has been saved in some other file format will never be synchronized with its source.
I know of 4 ways to edit the definition (the SELECT statement) of a view.
1. Delete view and save the query again with right-click>"Create as view".
2. Do the same on the command line with DROP VIEW and CREATE VIEW.
3. Edit the view definition in the script file.
4. Copy the modified SELECT statement from the query into the SQL view of the view.
The last option works with embedded HSQLDB only.
As far as I know, this has absolutely nothing to do with anything else that you do to your database such as SHTDOWN COMPACT.
HSQL Documentation: http://www.hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_view_creation wrote:
ALTER VIEW
alter view statement
<alter view statement> ::= ALTER VIEW <table name> <view specification> AS <query expression> [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]
Alter a view. The statement is otherwise identical to CREATE VIEW. The new definition replaces the old. If there are database objects such as routines or views that reference the view, then these objects are recompiled with the new view definition. If the new definition is not compatible, the statement fails.
-- Return all View Definitions from the CURRENT_SCHEMA
Select
INFORMATION_SCHEMA.VIEWS.TABLE_NAME as VIEW_NAME,
INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION
From INFORMATION_SCHEMA.VIEWS
Where INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA = CURRENT_SCHEMA
-- Return View Definition For a Specific VIEW
Select
INFORMATION_SCHEMA.VIEWS.TABLE_NAME as VIEW_NAME,
INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION
From INFORMATION_SCHEMA.VIEWS
Where INFORMATION_SCHEMA.VIEWS.TABLE_NAME = 'MY_VIEW_NAME' -- Change to the name of VIEW you desire
Users browsing this forum: No registered users and 0 guests