• No results found

Your query results will be displayed in the Section 9.2.5, “Sample SQL Results for Preview Data” view The view will automatically open or get focus if not visible in your perspective.

9.2.3. Preview Relational Procedure

To preview a relational procedure:

Step 1 - Select a relational procedure in the Section C.2.1, “Model Explorer View” or diagram. The procedure can be in a view model as well as a source model.

Step 2 - Right-click select the Preview Data action . You can also select the same action in the tool-bar of either the Section C.2.1, “Model Explorer View” or diagram.

Step 3 - An input parameter input dialog is presented. Enter a valid value for each parameter. Note that if data entered does not match the parameter datatype (String, integer, etc...), an error message will be displayed in the dialog header. When all required values are entered, click the OK button to execute the query.

Figure 9.6. Procedure Parameter Input Dialog

Step 4 - Your query results will be displayed in the Section 9.2.5, “Sample SQL Results for Preview Data” view. The view will automatically open or get focus if not visible in your perspective.

9.2.4. Preview Web Service Operation

To preview a Web service operation:

Step 1 : Select a Web service operation in the Section C.2.1, “Model Explorer View” or diagram. The operation can be in a view model as well as a source model.

Step 2 : Right-click select the Preview Data action . You can also select the same action in the tool-bar of either the Section C.2.1, “Model Explorer View” or diagram.

Step 3 : An input parameter input dialog is presented. Enter a valid value for each parameter. Note that if data entered does not match the parameter datatype (String, integer, etc...), an error message will be displayed in the dialog header. When all required values are entered, click the OK button to execute the query.

Figure 9.7. Procedure Parameter Input Dialog

Step 4 - Your query results will be displayed in the Section 9.2.5, “Sample SQL Results for Preview Data” view. The view will automatically open or get focus if not visible in your perspective.

9.2.5. Sample SQL Results for Preview Data

Preview Data results are displayed in the Eclipse Datatools SQL Results view as shown below. Note there are a number of display preference and filter options for this view via toolbar buttons and the dropdown menu.

Figure 9.8. SQL Results View

9.2.6. Execution Plans

When Preview Data is executed, the Teiid Execution Plan is also displayed as shown below. The Execution Plan may also be obtained by rt-clicking on a previewable object, then selecting Modeling > Show Execution Plan in the context menu.

Figure 9.9. Teiid Execution Plan View

9.3. Testing With Your VDB

In Teiid Designer you can execute a VDB to test/query actual data. The requirements for VDB execution are:

A deployed VDB backed by valid deployed Data Sources

An instance of a Teiid Connection Profile configured for the deployed VDB

Teiid Designer simplifies this process via Deploy VDB and Execute VDB actions. Deploy VDB does just that, deploy a selected VDB to a running Teiid instance. Execute VDB performs the VDB deployment, creates a Teiid Connection Profile, opens the Database Development perspective and creates a connection to your VDB.

9.3.1. Creating Data Sources

The mechanism by which VDBs are able to query actual data sources is the Data Source. These are deployed configurations backed by database or source connection jars. Each source model referenced within a VDB requires a JNDI name representing a deployed Data Source.

When creating VDBs you do not need to have deployed data sources on your Teiid server, but if you wish to test your VDB, the data sources need to be present.

Teiid Designer provides a Create Data Source action so you can create compatible data sources for your source model. If you wish to create a data source for a specific model you can select that source model in your workspace and select the Modeling > Create Data Source action. This will extract the connection profile data from your source model and create a corresponding data source on your default Teiid server.

You can also create data sources from the Teiid view. Select a Teiid server instance in the Teiid view and right-click select the Create Data Source action. This will launch the Create Data Source Dialog shown below.

Figure 9.10. Create Data Source Dialog

You can either select and existing Connection Profile from the drop-down list (Use Connection Profile Info option) or check the Use Model Info option and select an existing source model containing connection info.

After creating your new data source it should now be shown in the Data Sources folder of the corresponding Teiid server.

9.3.2. Execute VDB from Model Explorer

If you have a Teiid instance defined and connected in your Teiid view you can:

Step 1 : Right-click a VDB in your Model Explorer select Modeling > Execute VDB action. This action will insure your selected VDB is deployed to Teiid, create a Teiid Connection Profile specific for that VDB, open the Database Development perspective and create a connection to your VDB.

Figure 9.11. Execute VDB Action

Step 2 : Select your new Teiid connection profile and right-click select Open SQL Scrapbook, enter your designer SQL (i.e. SELECT * FROM TableXXXX), select all text and right-click select Execute Selected Text

Figure 9.12. SQL Scrapbook Editor