Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Virtualization Demoette… Parameterized Queries

Similar presentations


Presentation on theme: "Data Virtualization Demoette… Parameterized Queries"— Presentation transcript:

1 Data Virtualization Demoette… Parameterized Queries
Hello, and welcome to the Demoette series for Cisco Information Server, or CIS. In this Demoette, we demonstrate the use of Parameterized Queries.

2 Agenda What are they and why do they matter? A basic demo Summary
Here is our agenda. We begin by defining parameterized queries and outlining their importance for our customers. Next we walk through a very basic demo of parameterized queries. Finally, we summarize the contents of this demoette.

3 Agenda What are they and why do they matter? A basic demo Summary
Let’s begin by discussing what parameterized queries are and why they are important for our customers.

4 What are they? Parameterized Queries
SQL Query that includes named parameters Parameters may appear in projections or selections Implemented as a Stored Procedure in CIS A Parameterized Query is a CIS SQL query that includes named parameters in projections or selections. In CIS, Parameterized Queries are a type of Stored Procedure.

5 Why do they matter? Parameterized Queries
Add user-friendly flexibility to data access Select Where From Parameterized Queries are important to our customers because they enable user-friendly flexibility to be added to data access requests. Parameters may be added in three areas: as part of a Select clause, a Where clause, or a From clause in a SQL query.

6 Agenda What are they and why do they matter? A basic demo Summary
Next, let’s walk through a very basic demo that shows the use of Parameterized Queries.

7 Demo: Here is the business problem…
Business Analysts CIS Data Source 1 Data Source 2 Here is the business problem we illustrate in this demo. Our business analysts use CIS to access complex virtual views, but they don’t want to simply download tables. They need to be able to apply various types of filters to the data. However, these users are not well-versed in SQL, so we want to provide them a simpler way to enter their filters as parameters in stored procedures that we expose.

8 Demo: Before you begin…
Import CAR file This demo uses data from the Examples folder that is delivered with CIS, so no installation of data is required. However, a CAR file is available in the Additional Resources folder that accompanies this demoette. You can build these resources from scratch, or import the CAR file if you want to use the pre-built artifacts.

9 Demo: Parameterized SELECT clause
We are ready to begin our demo. Right-click a folder and select New Parameterized Query. <CLICK> Give the query a name… <CLICK> … and drag CompositeView from the Examples folder onto the modeling palette. <CLICK> On the Grid Panel, select three columns: OrderID, ProductID, and CompanyName. We have now created a basic view, and are ready to add a parameter.

10 Demo: Parameterized SELECT clause
Now click an empty row in the Column area, and select Parameter. <CLICK> Give the parameter a name, and choose Varchar as the data type. <CLICK> Click OK, and the new parameter appears in the Grid. You can change the alias if you wish. <CLICK> Now execute the query, and enter a value for the parameter. <CLICK> The parameter value is returned as part of the result set.

11 Demo: Parameterized WHERE clause
Next, let’s add a parameter to a Where clause. Create a new parameterized query just as we did previously, using the CompositeView resource from the Examples folder, and selecting the same three columns in the Grid panel. <CLICK> On the Grid Panel, right-click in the Criteria column… <CLICK> … for the CompanyName row, and choose Parameter. <CLICK> Give the parameter a name, and select Varchar as the data type. <CLICK> CIS automatically generates this clause in the Criteria cell. As you can see, an ‘equals’ comparison is generated by default.

12 Demo: Parameterized WHERE clause
Let’s change that default comparison. We could do it here on the SQL Script tab… <CLICK> … but let’s do it on the Grid tab. <CLICK> We’ll change the Equals to a Like. <CLICK> The change is automatically reflected in the generated SQL Script.

13 Demo: Parameterized WHERE clause
Now when we execute, we can enter a valid value for the LIKE clause… <CLICK> … and see the corresponding results.

14 Demo: Parameterized FROM clause
Finally, let’s build a Packaged Query that uses a parameter in a FROM clause. This is typically used when we want to embed a parameter-driven stored procedure or transformation in a Packaged Query. We create a new Packaged Query, and drag in the Stored Procedure LookupProduct from the Examples folder. <CLICK> We are prompted for a parameter value, but instead of entering a literal, we choose Query Parameter from the drop-down. <CLICK> We name the parameter, and click OK.

15 Demo: Parameterized FROM clause
As the SQL Script tab shows, the input parameter is used as the parameter for the embedded procedure. <CLICK> We execute, enter a parameter value for the product ID… <CLICK> … and the appropriate data is returned.

16 Demo: Publishing a Parameterized Query
When we publish a Parameterized Query as a virtual database, it appears as a Stored Procedure. <CLICK> Here we use CIS’s SQL Scratchpad tool as a client to execute the stored procedure and retrieve results. Our demo is complete.

17 Agenda What are they and why do they matter? A basic demo Summary
Let’s summarize what we have seen in this presentation.

18 Summary Parameterized Queries SQL Query that includes named parameters
Parameters may appear in projections or selections Implemented as a Stored Procedure in CIS Add user-friendly flexibility to data access Select Where From A Parameterized Query is a CIS SQL query that includes named parameters in projections or selections. In CIS, Parameterized Queries are a type of Stored Procedure. Parameterized Queries are important to our customers because they enable user-friendly flexibility to be added to data access requests. Parameters may be added in three areas: as part of a Select clause, a Where clause, or a From clause in a SQL query. Thank you.

19 TOMORROW starts here.


Download ppt "Data Virtualization Demoette… Parameterized Queries"

Similar presentations


Ads by Google