Download presentation
Presentation is loading. Please wait.
1
Data Virtualization Community Edition
Tutorial: Creating Virtual Views Hello, and welcome to the Tutorial Series for Cisco Information Server, or CIS. In this tutorial, we show how to create Virtual Views.
2
For more details… Resources: Additional information: Archives
Documentation Training Resources: Archives Data files Tutorial Document Note that Tutorials are NOT meant to be comprehensive training modules. Instead, they demonstrate a very basic use case that can be built quickly and easily. However, the Community Edition Knowledge Base contains additional information that will help you learn more and go deeper. Additional resources in the Knowledge Base include: <CLICK> Resources used to build the tutorial, such as Data Virtualization Archive files, data source files, and a document version of this tutorial. <CLICK> Additional information, including documentation and training materials.
3
Agenda What are they and why do they matter? How-to Summary
Here is our agenda. We begin by defining Virtual Views and outlining their importance in Data Virtualization projects. Next we demonstrate the basics of creating Virtual Views. Finally, we summarize the contents of this tutorial.
4
Agenda What are they and why do they matter? How-to Summary
Let’s begin by discussing what Virtual Views are, and why they are important for Data Virtualization.
5
What are they? Virtual Views Virtual Data Table
Defined by SQL and CIS Metadata Contains SQL SELECT and any ANSI-Standard SQL Often federate data from multiple physical sources In Cisco Data Virtualization, Views are Virtual Data Tables. Views are defined by SQL statements that use CIS Metadata. They consist of a SQL SELECT statement, along with any ANSI-Standard SQL you use to define and shape the data. In Data Virtualization, views often federate data from multiple disparate physical sources.
6
Why do they matter? Virtual Views Encapsulate business meaning
Hide complexity Enable re-use Virtual Views are the very heart of Data Virtualization. By federating data from disparate physical sources, views enable data developers to encapsulate the business meaning of data into simple relational structures, making it easier for data consumers to find and use the enterprise data they need. Views shield data consumers from the underlying complexity of the many physical data sources present in the modern enterprise. Views also enable reuse of information structures across many projects.
7
Agenda What are they and why do they matter? How-to Summary
Next, let’s walk through the basic steps of creating a virtual view.
8
Here is the business problem…
Data Analysts CIS Physical Source 1 Physical Source 2 Here is the business problem we illustrate in this tutorial. CIS Developers want to build a virtual view that combines data from two different physical databases, and then present this data as a single virtual table for their Data Analysts. View-building capabilities in CIS are extremely broad and deep. In this brief tutorial we can only scratch the surface of this functionality. However, this tutorial will provide a foundation that will help you learn independently. We have already created data source connections to these physical databases, so in this Tutorial we can concentrate on building the View. If you want to learn how to create relational data source connections, please see the tutorial on that topic. Also note that there are two other tutorials you will want to see after this one. First, note that this tutorial provides an introduction to view-building, but does not cover best practices for development. Our best practice of Layered Development is the subject of another Tutorial. In addition, there are other Tutorials that explain how to Publish virtual views to make them available to data consumers, both as virtual databases and as web services.
9
Let’s get started… We’re now ready to begin. First, create a folder for your work. <CLICK> You can write-click Shared… <CLICK> … or any folder of your choice. <CLICK> Select New Folder. <CLICK> Give the folder a name, and click OK.
10
Let’s get started… Right-click your new folder and select New View.
<CLICK> Give the View a name and click OK.
11
Create the View… A blue canvas appears in the Editor area. Note the error icons in the folder structure. As the flyover text explains, this new view has no definition yet.
12
Create the View… Let’s provide that definition. Open the Examples folder. <CLICK> Drag the products table from the ds_inventory data source onto the canvas. <CLICK> Now drag the orderdetails table from the ds_orders data source onto the canvas.
13
Create the View… We want to Join these two tables to create our view. Drag a line between the columns to use for the Join. In this case, they are both named productid. <CLICK> So far, we’ve been working on the Model tab in the editor. Now click on the SQL tab. Note that the work we have done on the Model tab has been automatically rendered as SQL.
14
Options on the Model tab…
Now return to the Model tab. Right-click on the Canvas to see some of the options available. Navigator opens a widget that will help you navigate the model if it becomes larger than available space on the screen. The other options affect the SQL for the View. For example, click Select Distinct… <CLICK> … then go to the SQL tab to see that the DISTINCT keyword has been added to the SQL statement.
15
Options on the Model tab…
To see more options, right-click the blue circles on the Join line. Select Properties. <CLICK> The properties dialog box lets you specify many characteristics of the Join, such as…. <CLICK> Equi-join or non-equi-join… <CLICK> Left, right, or full outer joins… <CLICK> … and a number of query optimization settings.
16
The Grid tab… Now move to the Grid tab. This tab lets us work with the columns in the view. <CLICK> SELECT * is the default projection.
17
The Grid tab… If you want to select individual columns for the projection, click any row of Column for a drop-down list of available columns. <CLICK> If you want all, or most, of the columns, click the List Columns icon. <CLICK> Now you can select individual tables, or all tables. <CLICK> Select all tables and click OK.
18
The Grid tab… Now all columns from both tables appear on the Grid.
<CLICK> Aliases are automatically generated for duplicate column names. You can also enter your own aliases for any column. <CLICK> If there are columns you don’t want, simply un-check them.
19
The Grid tab… As the SQL tab shows, our new projection has been generated. <CLICK> Save your work. <CLICK> Now execute the query.
20
The Grid tab… The query runs, and a small sample of results is returned to Studio.
21
SQL Functions on the Grid tab…
The Grid tab lets us specify many sophisticated SQL capabilities. Let’s look at just a few of them. Right-click the Product Description column… <CLICK> … and hover over Function. As you can see, a large number of SQL functions are available, divided into several different categories. Let’s trim any white space from the right of the Product Description column. <CLICK> Hover over Character… <CLICK> … and select RTRIM.
22
SQL Functions on the Grid tab…
The editor lets us work with function parameters. In the case of RTRIM, we don’t need to add anything. Click OK. <CLICK> The function is added to the projection… <CLICK> … and of course, to the generated SQL as well.
23
Filtering and Sorting on the Grid tab…
Next, we’ll use the grid tab to specify filtering and sorting. In the Order ID row, click Criteria and enter Greater Than 10. This will generate a SQL WHERE clause that ignores rows where the value is 10 or less. <CLICK> Now add sort criteria. Click the Sort Order cell for the Order ID column and select 1. One is the only choice because this is the first sort we are specifying. <CLICK> Click Sort Type for Order ID and select Ascending. <CLICK> Now click Sort Order for the Product ID column. Now the drop-down shows 1 and 2. Select 2. <CLICK> We’ll sort Product ID in Descending order.
24
Filtering and Sorting on the Grid tab…
As expected, the SQL tab now shows a WHERE clause and an ORDER BY clause. Save your work. <CLICK> Execute the query. We see that Order IDs less than 10 are filtered out, and our sort order is working as expected.
25
Editing on the SQL tab… Finally, let’s look at editing directly on the SQL tab. I want to translate the Product Name column to upper case. <CLICK> When I being typing, this warning message appears. As the message notes, the Model and Grid tabs will be removed if I edit the SQL tab directly. Don’t worry, though. We can easily re-create these tabs. Note that there are a few edge cases in SQL that do prevent us from re-generating the Model and Grid tabs. For example, if you use SQL Common Table Expressions, CIS cannot re-generate the Model and Grid. Again, don’t worry if this occurs; Views will still work whether or not these tabs are present. <CLICK> I enter my SQL and save my work.
26
Editing on the SQL tab… Execute the query, and the Product Names appear in upper case. <CLICK> As expected, the Model and Grid tabs are now gone. <CLICK> Click Generate Model on the tool bar. <CLICK> The Model and Grid tabs are re-created. We have examined a number of techniques for creating virtual views, concentrating on the Model, Grid, and SQL tabs. Our demo is complete.
27
Agenda What are they and why do they matter? How-to Summary
Let’s summarize what we have seen in this tutorial.
28
Summary: Definition Virtual Views Virtual Data Table
Defined by SQL and CIS Metadata Contains SQL SELECT and any ANSI-Standard SQL Often federate data from multiple physical sources In Cisco Data Virtualization, Views are Virtual Data Tables. Views are defined by SQL statements that use CIS Metadata. They consist of a SQL SELECT statement, along with any ANSI-Standard SQL you use to define and shape the data. In Data Virtualization, views often federate data from multiple disparate physical sources.
29
Summary: Benefits Virtual Views Encapsulate business meaning
Hide complexity Enable re-use Virtual Views are the very heart of Data Virtualization. By federating data from disparate physical sources, views enable data developers to encapsulate the business meaning of data into simple relational structures, making it easier for data consumers to find and use the enterprise data they need. Views shield data consumers from the underlying complexity of the many physical data sources present in the modern enterprise. Views also enable reuse of information structures across many projects.
30
Summary: Key Take-aways
Views Created Graphically on Model and Grid tabs Created Manually on SQL tab Graphical tabs will be removed Graphical tabs can be re-created in most cases Graphical tabs are not required Move freely between Graphical and Manual modes As you work with Virtual Views, keep these key take-aways in mind. Views are created graphically on the Model and Grid tabs of the View Editor. You can also create views manually on the SQL tab. If you choose this approach, the graphical tabs will be removed. However, they can easily be re-created in most cases. In edge cases where the graphical tabs cannot be re-created, the Views will still work correctly; the graphical tabs are not required. As a data developer, feel free to move between Graphical and Manual modes freely, and work in whatever way is most convenient for you at any given moment.
31
Summary: What’s next? Use your knowledge to create Views against many different physical data sources Leverage your knowledge to explore other features of the View Editor Learn Layered Development Best Practices Publish Views as Virtual Databases and Web Services After completing this tutorial, you are ready to begin creating views against all your physical data sources. You are also ready to explore other features of the View Editor that we did not show in this Tutorial. To learn more, see our Tutorial on Layered Development Best Practices, as well as Tutorials on Publishing Views for end-user consumption. Thank you.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.