/features/views
VIEWS
View are available in most adapters and usually allow data changes such as UPDATE, DELETE and INSERT operations, depending on the adapter's ability to support the underlying API calls.
Create a View
To create a view, use the CREATE VIEW statement in SQL Server Management Studio.
-- Create a view against a SharePoint list called 'USStates' CREATE VIEW vUSStates AS SELECT ID, Title, [State Code] FROM SharePoint.[list@USStates]
-- Create a view against a CSV File CREATE VIEW vFirestations AS SELECT TOP 10 * FROM CSV.[data@firestations2] WHERE _path = 'c:\tmp\firestations\usfa-registry-AL.txt'
Views created in Enzo support simple SQL commands against a single adapter. At this time, it is not possible to create views that JOIN multiple adapters.
Views are created in the context of the current Enzo login and configuration setting.
Calling a View
Once a view has been created on an adapter, it is now made available as a handler. For example, if a view called vUSStates has been created on the SharePoint adapter, the following command can be sent to Enzo:
SELECT * FROM SharePoint.vUSStates
And if the ID column of that view is marked as Searchable, the following command can be executed:
SELECT * FROM SharePoint.vUSStates WHERE ID=1
When executing a SQL command from a Linked Server, the fully qualified name is required:
SELECT * FROM [localhost,9550].bsc.SharePoint.vUSStates WHERE ID=1
In this example, we are calling a view defined on the CSV adapter:
SELECT * FROM CSV.vFirestations