0 Copyright 2012 FUJITSU Interstage BOP SQL Query Tutorial Todd Palmer October 2012.

Slides:



Advertisements
Similar presentations
Microsoft® Access® 2010 Training
Advertisements

RightNow 8 -- Adding a new report: New > Report: ORAnalytics > Reports > New Report
Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Access.
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Introduction To Form Builder
SiS Technical Training Development Track Technical Training(s) Day 1 – Day 2.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Copyright 2007, Paradigm Publishing Inc. BACKNEXTEND 3-1 LINKS TO OBJECTIVES Save a Filter as a Query Save a Filter as a Query Parameter Query Inner, Left,
CPSC 203 Introduction to Computers T59 & T64 By Jie (Jeff) Gao.
Database Applications – Microsoft Access Lesson 9 Designing Special Queries.
What is Sure BDCs? BDC stands for Batch Data Communication and is also known as Batch Input. It is a technique for mass input of data into SAP by simulating.
® IBM Software Group © 2009 IBM Corporation Rational Publishing Engine RQM Multi Level Report Tutorial David Rennie, IBM Rational Services A/NZ
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
An Introduction to Designing and Executing Workflows with Taverna Katy Wolstencroft University of Manchester.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Basic & Advanced Reporting in TIMSNT ** Part Two **
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Damian Tamayo Tutorial DTM Data Generator Fall 2008 CIS 764.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
Microsoft Access 2010 Chapter 10 Administering a Database System.
® Microsoft Access 2010 Tutorial 12 Managing and Securing a Database.
1/62 Introduction to and Using MS Access Database Management and Analysis Yunho Song.
National Center for Supercomputing Applications University of Illinois at Urbana-Champaign Ergo User Tutorial - Part 3 NCSA, UIUC.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/All Programs/Microsoft Office/Microsoft Office.
1 11 Exploring Microsoft Office Access 2007 Chapter 6 Data Protection.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Access Module Implementing a Database with Microsoft Access A Great Module on Your CD.
® Microsoft Access 2010 Tutorial 9 Using Action Queries and Advanced Table Relationships.
Entity Framework Database Connection with ASP Notes from started/getting-started-with-ef-using-mvc/creating-an-
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED INTEGRATION.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
2 Copyright © 2008, Oracle. All rights reserved. Building the Physical Layer of a Repository.
IS OPEN THE LIBRARY Polaris ILS SimplyReports 5.0 SP3 Training.
IUIE Reporting Basics Workshop
About SharePoint Server 2007 My Sites
Plug-In T7: Problem Solving Using Access 2007
Objectives Create an action query to create a table
Data Virtualization Demoette… Parameterized Queries
Data Virtualization Community Edition
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
MODULE 7 Microsoft Access 2010
Data Upload & Management
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Electronic Field Study Advanced User Training
Guidelines for Microsoft® Office 2013
Tutorial 8 Sharing, Integrating, and Analyzing Data
Tutorial 9 Using Action Queries and Advanced Table Relationships
Presentation transcript:

0 Copyright 2012 FUJITSU Interstage BOP SQL Query Tutorial Todd Palmer October 2012

1 Copyright 2012 FUJITSU Introduction This tutorial explains how to create Web Services that invoke customized SQL queries from database tables. All SQL Queries are invoked from a Web Service This tutorial includes: Dynamic Query: SQL Queries other than the basic ones Dynamic Filters: SQL Queries with inputs Populating a Select where no enumeration table exists

2 Copyright 2012 FUJITSU Prerequisites You should already have completed Chapter 1 of the Developing Services training. You should have at least a cursory understanding of Database tables, SQL queries, and primary and foreign keys. You understand how to create User Interfaces that use Web Services as described in the chapter on User Interfaces in the BOP Fundamentals Training. This tutorial leverages the Northwind database installed in the downloadable Community VM.

3 Copyright 2012 FUJITSU Dynamic Queries As shown in chapter 1 of the Developing Services training, Interstage BOP will generate basic Web Services. These include: Get Object by ID Get Object List Get Object List by Foreign Key Additionally, you can create Web Services that call your own customized SQL queries. These are known as Dynamic Queries.

4 Copyright 2012 FUJITSU Dynamic Queries In our first example we will create a Web Service that returns all orders that were shipped to the USA. Open the Workspace and navigate to: Metadata/Databases/Northwind/Tables Open the Orders table.

5 Copyright 2012 FUJITSU Dynamic Queries The table dialog shows the metadata of the Orders table including: Columns Key: Primary and Foreign Note that ShipCountry is not a Foreign Key so BOP doesn’t automatically generate a Web Service for us to filter by it. Click: Generate Web Service on SQL Query

6 Copyright 2012 FUJITSU Dynamic Queries Click in the Select area and click the All checkbox. In the Where area select ShipCountry and click Add. Set the operator to = and the value to 'USA'

7 Copyright 2012 FUJITSU Generate the Dynamic Query You can click Validate to verify the SQL is valid. Click Generate Custom Web Service on SQL Query Web Service Operation Name: USAOrders Web Service Interface: New Folder Name: Northwind/Web Services/Internal Click Generate.

8 Copyright 2012 FUJITSU Test the Dynamic Query Browse and Publish your newly created Web Service. Right click on the USAOrders Web Service and click: Test Web Service Operation In the Operation Test Tool click Invoke Check the response to see that Orders were returned. Your Web Service is now calling your SQL Query that you dynamically built.

9 Copyright 2012 FUJITSU Dynamic Filters We would really like to be able to pass the Shipping Country into the Web Service. We want to dynamically filter the results of a table based on some user input. In BOP this is referred to as a Dynamic Filter. In BOP we will define the SQL for this query to look like this: SELECT * FROM "Orders" WHERE "ShipCountry"=:ShipToCountry Notice the colon (:) before the ShipToCountry. This specifies that this part of the query will be supplied at run time.

10 Copyright 2012 FUJITSU Dynamic Filters In this example we will create a Web Service that returns all orders that were shipped to the user supplied country. Open the Workspace and navigate to: Metadata/Databases/Northwind/Tables You could open the table. However, this time just right click on the Orders table and select: Generate Custom Web Service on SQL Query

11 Copyright 2012 FUJITSU Dynamic Filters Click in the Select area and click the All checkbox. In the Where area select ShipCountry and click Add. Set the operator to = and the value to :ShipToCountry

12 Copyright 2012 FUJITSU Dynamic Filters Implementation Let’s take a look behind the scenes and see how BOP actually implements this query. You probably won’t be surprised that BOP uses XML to internally represent this query. You can see this XML by clicking on View. Notice the parameter element: It has a ShipToCountry child for our Dynamic Filter dd specifies the ShipCountry column in the Orders table dt specifies that the type is: string

13 Copyright 2012 FUJITSU Generate the Dynamic Filter You can click Validate to verify the SQL is valid. Click Generate Custom Web Service on SQL Query We want this Dynamic Filter Web Service added to our existing Interface: Web Service Operation Name: OrdersByShipCountry Web Service Interface: Existing Existing Web Service Interface: OrdersWebServiceInterface Click Generate.

14 Copyright 2012 FUJITSU Test the Dynamic Query Browse and Publish your newly created Web Service. Right click on the OrdersByShipCountry Web Service and click: Test Web Service Operation

15 Copyright 2012 FUJITSU Test the Dynamic Query Replace PARAMETER in ShipToCountry with Finland. In the Operation Test Tool click Invoke Check the response to see that Orders were returned. Your Web Service is now calling your SQL Query that you dynamically built.

16 Copyright 2012 FUJITSU Dynamic Filters in User Interfaces You can now use your Dynamic Filter Web Service in a User Interface. Create a new User Interface: Name: OrdersByCountry Description: Shows Orders By Ship Country Drag your OrdersByShipCountry Web Service onto your new User Interface. Make sure both input message and output message are checked. Click OK.

17 Copyright 2012 FUJITSU Dynamic Filters in User Interfaces Preview your User Interface. In the ShipToCountry field type: Finland Click on OrdersByShipCountry

18 Copyright 2012 FUJITSU Populating a Select Box In section of the User Interfaces chapter in the Fundamentals training we saw how to populate a Select box from a database table. However, that example assumes that the Select box items are enumerated in an existing table. We will need to make some adjustments to that approach as we don’t have a table of the countries referenced by ID from the Order.

19 Copyright 2012 FUJITSU Get Countries Query The following query returns an enumerated list of all the countries to which we are shipping orders: SELECT ShipCountry FROM Orders GROUP BY ShipCountry In the Orders table generate a custom Web Service based on the query.

20 Copyright 2012 FUJITSU Generate the Web Service Add this new Web Service to our existing Interface: Web Service Operation Name: GetShippedToCountries Web Service Interface: Existing Existing Web Service Interface: OrdersWebServiceInterface Click Generate. Publish and test your Web Service.

21 Copyright 2012 FUJITSU Populating the Select Now that we have a Web Service that returns the list of countries we can use it to populate the Select box. However, let’s be clear about something before we proceed. Technically, the query is not returning countries. It is actually returning Orders. That is because it is a query on the Orders table. We have just filtered out all of the other information. For our purposes this is a good thing as it will allow us to use our existing Orders object.

22 Copyright 2012 FUJITSU Configure the Select Dataset Open the OrdersByCountry User Interface. Right click on the ShipToCountry field and change it to a Select. In the Properties for the Select click on Edit Dataset Options. Click Create New Model. Click Yes to confirm creation of the model. In the Model Properties set: Get Operation: GetShippedToCountries Iterator Size: 0 Uncheck: Prompt To Save Notice that it correctly sets the Business Object to be Orders.

23 Copyright 2012 FUJITSU Configure the Select Dataset Click OK. In the Existing Model: For both Description and Value click on Get References from Model and select tns:ShipCountry. Click OK.

24 Copyright 2012 FUJITSU Testing the Select Preview the User Interface. Notice that the Select box lists the countries. Select a country and click OrdersByShipCountry.

25 Copyright 2012 FUJITSU Planned Additional Content Dynamic Sort? Composite queries?

26 Copyright 2012 FUJITSU