Accessing Data

640
Accessing Data using Actuate e.Report Designer Professional

Transcript of Accessing Data

Page 1: Accessing Data

Accessing Datausing Actuate e.Report Designer Professional

Page 2: Accessing Data

Information in this document is subject to change without notice. Examples provided are fictitious. No part of this document may be reproduced or transmitted in any form, or by any means, electronic or mechanical, for any purpose, in whole or in part, without the express written permission of Actuate Corporation.

© 1995 - 2009 by Actuate Corporation. All rights reserved. Printed in the United States of America.

Contains information proprietary to:Actuate Corporation2207 Bridgepointe ParkwaySan Mateo, CA 94404

www.actuate.comwww.birt-exchange.com

The software described in this manual is provided by Actuate Corporation under an Actuate License agreement. The software may be used only in accordance with the terms of the agreement. Actuate software products are protected by U.S. and International patents and patents pending. For a current list of patents, please see http://www.actuate.com/patents.

Actuate Corporation trademarks and registered trademarks include:Actuate, the Actuate logo, BIRT, Collaborative Reporting Architecture, e.Analysis, e.Report, e.Reporting, e.Spreadsheet, Encyclopedia, Formula One, Interactive Viewing, Nimble, the Nimble logo, Performancesoft, Performancesoft Track, Performancesoft Views, Report Encyclopedia, Reportlet, and XML reports.

Actuate products may contain third-party products or technologies. Third-party trademarks or registered trademarks of their respective owners, companies, or organizations include:

Adobe Systems Incorporated: Flash Player. Apache Software Foundation (www.apache.org): Axis, Batik, Batik SVG library, Commons Command Line Interface (CLI), Commons Codec, Derby, Struts, Tomcat, Xalan-J, Xerces, and Xerces2 Java Parser. Bits Per Second, Ltd. and Graphics Server Technologies, L.P.: Graphics Server. Bruno Lowagie and Paulo Soares: iText, licensed under the Mozilla Public License (MPL). Castor (www.castor.org), ExoLab Project (www.exolab.org), and Intalio, Inc. (www.intalio.org): Castor. Codejock Software: Xtreme Toolkit Pro. Component One, LLC.: VSFlexGrid Pro. DataDirect Technologies Corporation: DataDirect JDBC, DataDirect ODBC. Eclipse Foundation, Inc. (www.eclipse.org): Data Tools Platform (DTP) ODA, Eclipse SDK, Graphics Editor Framework (GEF), and Eclipse Modeling Framework (EMF), licensed under the Eclipse Public License (EPL). International Components for Unicode (ICU): ICU library. Liferay (www.liferay.com): Liferay, licensed under the MIT License. Microsoft Corporation (Microsoft Developer Network): CompoundDocument Library. Netscape Communications Corporation, Inc.: Rhino, licensed under the Netscape Public License (NPL). Oracle Corporation: Berkeley DB. Rogue Wave Software, Inc.: Rogue Wave library. Sam Stephenson (prototype.conio.net): prototype.js, licensed under the MIT license. Sun Microsystems, Inc.: JAXB, JDK, Jstl. World Wide Web Consortium (W3C)(MIT, ERCIM, Keio): Flute, JTidy, Simple API for CSS. XFree86 Project, Inc.: (www.xfree86.org): xvfb.

All other brand or product names are trademarks or registered trademarks of their respective owners, companies, or organizations.

Document No. 090326-2-130381 March 12, 2009

Page 3: Accessing Data

i

ContentsAbout Accessing Data usingActuate e.Report Designer Professional. . . . . . . . . . . . . . . . . . . . . . . . . xvii

Part 1Using Actuate e.Report Designer Professionaldata access technology

Chapter 1Accessing a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3About accessing data for reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4About data access terms and relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Connecting to the data source from a report design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Choosing where to place a connection component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Creating a connection component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Specifying the data to retrieve from a data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Chapter 2Migrating reports and reusing report components . . . . . . . . . . . . . . . . . 11About migrating reports and reusing report components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Using a connection configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Selecting an existing connection configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Understanding e.Report Designer Professional connection configuration files . . . . . . . . . . . . . 14Using a connection configuration file to access data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Choosing whether to place data connection and data source components in a library . . . . 19Specifying a connection for use in developing a report design . . . . . . . . . . . . . . . . . . . . . . . . 19Specifying a connection for use in running a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Specifying connections in the Runtime element for use when running the report . . . . . 23Setting the ConfigKey property to specify using a different connection when running a re-

port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Choosing a connection or data source component from a connection configuration file . . . . . 25

Chapter 3Modifying data processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29About modifying data processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Modifying handling of a connection component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30About data adapters, data source components and data filters . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Combining data adapters to form a data stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Instantiating data adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Page 4: Accessing Data

ii

Customizing a data stream by modifying data adapter methods . . . . . . . . . . . . . . . . . . . . . . .33Adding code for additional data stream tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34Accessing data in non-sequential order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34

Using data filters to process rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35About data rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36Creating a computed field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39Accessing other types of data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40

Sorting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41Specifying the desired sort order for sorting within the data source . . . . . . . . . . . . . . . . . . . .42Avoiding sorting by the group section sort key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43Specifying the desired sort order using the OrderBy property . . . . . . . . . . . . . . . . . . . . . . . . .44Specifying the desired sort order for sorting internally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45

Filtering data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46Working with data from multiple sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48

Creating a merge filter to combine the rows of the data sources . . . . . . . . . . . . . . . . . . . . . . . .50Creating a union filter to process the data sources sequentially . . . . . . . . . . . . . . . . . . . . . . . .53

Chapter 4Displaying data rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57About displaying data rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58Modifying an ROD file to display data rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59Specifying the columns to display data rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62

Changing the order of columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63Modifying, adding, and deleting columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65

Modifying font attributes for displaying data rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73

Chapter 5Accessing data in a comma-separated values (CSV) text file . . . . . . . . . 77Accessing data from a CSV text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78Creating a custom data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78Creating variables to identify which text file to use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79Defining data row variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81Displaying text file data in a report design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83Specifying processing of the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83Running and viewing the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85

Part 2Accessing data in a database or ODBC data source

Chapter 6Connecting to a database or ODBC data source . . . . . . . . . . . . . . . . . . . 89About database and ODBC connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90Preparing to access data using a database or ODBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90

Page 5: Accessing Data

iii

Using an ODBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90Preparing to access data using an ODBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91Configuring an ODBC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

Using a native database driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94Defining a database or ODBC connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Creating a query data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97About AFC support for database and ODBC connections and queries . . . . . . . . . . . . . . . . . . . 100

Chapter 7Creating a database or ODBC query . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103About creating database and ODBC queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104Creating a query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104Creating a query graphically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

Opening Query Editor and Database Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106Using tables, views, and synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Creating table joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112

About the automatic generation of joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112Creating and deleting joins manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113Modifying the generated FROM clause for a query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115

Selecting and modifying columns and creating computed fields . . . . . . . . . . . . . . . . . . . . . .116Selecting columns from a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116Creating a computed field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118Changing the order of columns or the data type of a column . . . . . . . . . . . . . . . . . . . . . . .119

Summarizing data from multiple rows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120Adding conditions to a query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

About how e.Report Designer Professional applies conditions . . . . . . . . . . . . . . . . . . . . 123Using QBE to specify a condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125Putting a condition on row retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125Putting conditions on an aggregate row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

Viewing the generated SQL SELECT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Creating a query by writing a SQL SELECT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

Writing the SQL query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Preparing the query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133Modifying the textual query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134Accepting the textual query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

Converting a graphical query to a textual query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134Previewing the rows that a database or ODBC query returns . . . . . . . . . . . . . . . . . . . . . . . . . . 136Changing the properties of a result column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

Changing the data type of graphical query results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138Changing the display name of query results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139Changing the data type, display length, and reference name of textual query results . . . 140

Specifying sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142Specifying data source sorting using a graphical query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

Page 6: Accessing Data

iv

Specifying sorting for a textual query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144Overriding sorting by the group section sort key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144

Chapter 8Filtering data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147About user-specified filtering in database and ODBC queries . . . . . . . . . . . . . . . . . . . . . . . . . . .148Prompting the user to provide a specific value to filter results . . . . . . . . . . . . . . . . . . . . . . . . . .149

Using a simple call to a static parameter to specify a condition . . . . . . . . . . . . . . . . . . . . . . .150Using SQL to specify a condition or other query clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151Preparing a textual query to describe a static parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152Specifying a parameter’s property values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152

Filtering query results with user-supplied expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153Filtering a graphical query using a user-supplied expression . . . . . . . . . . . . . . . . . . . . . . . . .154Filtering a textual query using a user-supplied expression . . . . . . . . . . . . . . . . . . . . . . . . . . .155

Including an ad hoc parameter in a textual query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155Preparing a textual query to describe an ad hoc parameter . . . . . . . . . . . . . . . . . . . . . . . .156Modifying the property values of the ad hoc parameter . . . . . . . . . . . . . . . . . . . . . . . . . . .156

Chapter 9Maintaining a database or ODBC query . . . . . . . . . . . . . . . . . . . . . . . . . 159About maintaining database and ODBC queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .160Timing and optimizing data source queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .160

Viewing the SQL SELECT statement that e.Report Designer Professional sends to the data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161

Modifying the SQL code in a query to optimize the query . . . . . . . . . . . . . . . . . . . . . . . . . . .162Updating a query when the data source changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163

Sending SQL statements to change the data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164Updating a textual query when the data source changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164Updating a graphical query when the data source changes . . . . . . . . . . . . . . . . . . . . . . . . . .165

Ensuring that a query connects to the correct data source . . . . . . . . . . . . . . . . . . . . . . . . .167Updating the data dictionary during synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . .168Determining whether a graphical query and its data source are synchronized . . . . . . . .169Synchronizing a graphical query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171Verifying that synchronization is complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173

Chapter 10Accessing data using a stored procedure . . . . . . . . . . . . . . . . . . . . . . . 175About accessing a database using a stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176Preparing to use a stored procedure to access a database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177Designing a report that uses a stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177Selecting a stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179

Changing the name of a stored procedure component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182Limiting which stored procedures are available for selection . . . . . . . . . . . . . . . . . . . . . . . . .182

Page 7: Accessing Data

v

Working with data from a stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183Using parameters with stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

Specifying whether parameters are input or output parameters . . . . . . . . . . . . . . . . . . . . . . 185Working with a sample value for an input parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

Ensuring that the stored procedure is synchronized with the database . . . . . . . . . . . . . . . . . . 188Using Oracle stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

Using Oracle data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Accessing stored functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Identifying stored procedures and stored functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189Processing additional cursors that a procedure or function returns . . . . . . . . . . . . . . . . . . . 190Understanding how e.Report Designer Professional works with a stored function . . . . . . 190

About the EMP table in the example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190About the stored function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191About the result columns and parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192Supplying parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194Viewing the report results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

Customizing access to handle specific databases or multiple result sets . . . . . . . . . . . . . . . . . 194Accessing a stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

Mapping Actuate variable types and Visual Basic type codes . . . . . . . . . . . . . . . . . . . . . 195Working with an Oracle stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196Working with a stored procedure’s return value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197Working with a stored procedure to return an ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

Accessing multiple result sets from Oracle stored procedures . . . . . . . . . . . . . . . . . . . . . . . 199Adding support in Actuate Basic methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199Using the CPointer type with another stored procedure function . . . . . . . . . . . . . . . . . . 200Fetching the data row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202Calling the Oracle stored procedure with result sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

Part 3Accessing SAP data

Chapter 11Connecting to an SAP data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207About accessing SAP data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208Configuring the system environment for accessing SAP data . . . . . . . . . . . . . . . . . . . . . . . . . . 208Connecting to an SAP system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

Chapter 12Accessing SAP BW data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213About accessing SAP BW data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214Preparing to use your SAP BW data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214Creating a report design that uses an SAP BW BEx Query data stream . . . . . . . . . . . . . . . . . . 214

Page 8: Accessing Data

vi

Understanding MDX Query terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220Querying data from an SAP InfoProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221

Opening SAP BW BEx Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221Selecting an InfoProvider and BEx query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222Selecting the type of data to include on each axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224

Creating an axis by selecting a set or property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225Adding the cross-product of several sets to an axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229Moving an axis and changing its axis type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232Modifying an axis to include members that do not contain data . . . . . . . . . . . . . . . . . . . .233Deleting axes, sets, and properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .236Specifying the axes for each type of layout style in Report Wizard . . . . . . . . . . . . . . . . . .239

Specifying the values of any SAP Variables that are used in the BEx query . . . . . . . . . . . . .242Specifying how to sort the returned data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245Limiting the returned data using filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247Specifying slices to limit the data returned by the query . . . . . . . . . . . . . . . . . . . . . . . . . . . . .251Displaying and verifying the resulting MDX query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253

Working with memory issues when querying an SAP BW data source . . . . . . . . . . . . . . . . . . .254Handling memory issues that cause a crash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255Solving out of memory errors when using an SAP BW InfoProvider . . . . . . . . . . . . . . . . . .255

Determining which BAPI call caused the error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256Setting the fetch size properties for a BAPI call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256

Creating a report design that uses an SAP BW ODS data stream . . . . . . . . . . . . . . . . . . . . . . . .259

Chapter 13Accessing SAP R/3 data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265About accessing SAP R/3 data streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266Configuring the report environment for SAP R/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266Preparing to use your SAP R/3 data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266Accessing data from an SAP R/3 data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267Starting to specify an SAP R/3 data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268

Selecting the desired BAPI or other RFM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268Finding the desired BAPI or other RFM using the Alphabetical view . . . . . . . . . . . . . . .268Finding the desired BAPI or other RFM using the Search view . . . . . . . . . . . . . . . . . . . . .270

Viewing information about the BAPI or RFM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .272Modifying parameters from BAPI or other RFMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275

Modifying the data types and default values of SAP R/3 parameters . . . . . . . . . . . . . . .279Specifying the primary result set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282

Controlling RFM execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284Working offline after you specify a BAPI or other RFM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284

Part 4Accessing data using Actuate Information Object technology

Page 9: Accessing Data

vii

Chapter 14Accessing an Actuate Information Object . . . . . . . . . . . . . . . . . . . . . . . . 287About information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

Working with an information object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289Preparing to access information object data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Setting up the report design to access information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289Using Information Object Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

Opening Information Object Query Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293Choosing an editor for designing an information object query . . . . . . . . . . . . . . . . . . . . . . . 294Using the expression builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

Creating an information object query in the Basic Design perspective . . . . . . . . . . . . . . . . . . . 296Creating a graphical information object query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

Selecting one or more information objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302Defining output columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303Setting column properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305Specifying a join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306

About joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306Optimizing joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

Specifying filtering on a column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310Setting filter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .311Setting filter prompt properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

Specifying the sort order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317Specifying columns to group in the query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318Specifying filtering on an aggregate column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319Defining parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

Specifying a parameter’s prompt properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324Setting parameter properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327Setting source parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328Synchronizing source parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

Creating a textual information object query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331Displaying output columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332Displaying parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

Displaying information object query output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334Modifying font attributes for information object query output in Actuate Query . . . . . . . . . 335

Chapter 15Actuate SQL reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339About Actuate SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340Differences between Actuate SQL and ANSI SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

Limitations compared to ANSI SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340Extensions to ANSI SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341Database limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344FILTERS statement in report designers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

Page 10: Accessing Data

viii

Actuate SQL syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .345Actuate SQL grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .346Using white space characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351Using keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351Using comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352Specifying maps and information objects in Actuate SQL queries . . . . . . . . . . . . . . . . . . . . .352Using identifiers in Actuate SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352Using column aliases in Actuate SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352Specifying parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .353Using subqueries in Actuate SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354

Data types and data type casting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355Facets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355Casting rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .356String comparison and ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357

Functions and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358Comparison operators: =, <>, >=, >, <=, < . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358Range test operator: BETWEEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358Comparison operator: IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359Arithmetic operators: +, -, *, / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359Numeric functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360

FLOOR, CEILING, MOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360ROUND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361POWER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361

Null test operators: is [not] null . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362Logical operators: and, or, not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362String functions and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362

Case conversion functions: UPPER, LOWER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363Concatenation operator: || . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363Length function: CHAR_LENGTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363LIKE operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364Substring functions: LEFT, RIGHT, SUBSTRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364Trimming functions: LTRIM, RTRIM, TRIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366Search function: POSITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366

Timestamp functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .367CURRENT_TIMESTAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368CURRENT_DATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368DATEADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368DATEDIFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369DATEPART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .370DATESERIAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .370

Aggregate functions: COUNT, MIN, MAX, SUM, AVG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371System function: CURRENT_USER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372

Providing query optimization hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372

Page 11: Accessing Data

ix

Indicating that a table in a join is optional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372Using the OPTIONAL keyword with a computed field . . . . . . . . . . . . . . . . . . . . . . . . . . . 374Using the OPTIONAL keyword with parentheses ( ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375Using the OPTIONAL keyword with aggregate functions . . . . . . . . . . . . . . . . . . . . . . . . 376

Specifying the cardinality of a join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377Using pragmas to tune a query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378

Disabling cost-based optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378Disabling indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380Specifying a threshold value for indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381

Part 5Using Actuate open data access technology

Chapter 16Creating a custom data driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385About accessing additional types of data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Accessing data using a custom data driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Creating a data source user interface for a custom data driver . . . . . . . . . . . . . . . . . . . . . . . . . 388

DataStreamDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389DesignSessionRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389DesignSessionResponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390ResultSetDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390

Providing classes to access data during report generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390Providing configuration information about your custom data driver . . . . . . . . . . . . . . . . . . . . 393Installing a custom data driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393

Chapter 17Configuration file XML schema reference . . . . . . . . . . . . . . . . . . . . . . . . 395About providing user access to custom data sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396Providing, naming, and placing your configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396Understanding the schema of odaconfig.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397Using the elements of odaconfig.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402AlternativeOdaDataTypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404ArrayOfString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405DataSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406DataSources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407DataTypeMapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407DataTypeMappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407DesignerSpecific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408DesignerSpecificProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408DesignerSpecificType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408

Page 12: Accessing Data

x

DesignTimeInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .409DriverLibraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .410InterfaceType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411LibrariesForOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411LibrariesForOsType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411ListOfProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .412NativeDataTypeType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .412OdaScalarDataType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .413OpenDataAccessConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .414OSType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .415Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .415Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .416PropertyType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .416RunTimeInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .417TraceLogging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .418VendorInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .419

Chapter 18Custom data driver XML reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421About communicating the structure of your data source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .422Data source builder reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .422ArrayOfInputFieldDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .422ArrayOfInputParameterDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .423ArrayOfNameValuePair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .423ArrayOfOutputFieldDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .423ArrayOfOutputParameterDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .424ArrayOfProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .424ArrayOfResultColumn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .424ArrayOfString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .425AxisType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .425ColumnAxisInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .425ConnectionProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .426DataStreamDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .426DesignSessionRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .428DesignSessionResponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .429DynamicConditionReference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .430DynamicQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .430ExternalState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .431HorizontalAlignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .432InputFieldDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .432InputParameterDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .434NameValuePair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .437OdaDataType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .437

Page 13: Accessing Data

xi

OdaScalarDataType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438OutputFieldDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439OutputParameterDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440ResponseState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441ResultColumn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441ResultSetDefinition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444SessionEditMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444SessionLocale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445StateInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447

Chapter 19Custom data driver Java reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449About Java interfaces and Java classes for creating a custom data driver . . . . . . . . . . . . . . . . . 450Open data access Java reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451Class FileHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452FileHandler.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453FileHandler.publish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453Filter.isLoggable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454Class Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455Handler.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Handler.flush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Handler.getFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Handler.getFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Handler.getLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456Handler.getLoggingErrorHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457Handler.isLoggable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457Handler.publish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457Handler.reportError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457Handler.setFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458Handler.setFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458Handler.setLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458Handler.setLoggingErrorHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458IBlob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458IBlob.getBinaryStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459IBlob.getBytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459IBlob.length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460IClob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460IClob.getCharacterStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461IClob.getSubString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461IClob.length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461ICallStatement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462

Page 14: Accessing Data

xii

ICallStatement.findOutParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .463ICallStatement.getBigDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .464ICallStatement.getBlob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .464ICallStatement.getClob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .465ICallStatement.getDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .465ICallStatement.getDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .466ICallStatement.getInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .467ICallStatement.getMetaDataOf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .467ICallStatement.getResultSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .467ICallStatement.getResultSetNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .468ICallStatement.getRow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .468ICallStatement.getSortSpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .469ICallStatement.getString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .469ICallStatement.getTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .470ICallStatement.getTimestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .470ICallStatement.setNewRow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .471ICallStatement.setNewRowSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .472ICallStatement.setSortSpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .472ICallStatement.wasNull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .473IConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473IConnection.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .474IConnection.commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .474IConnection.createStatement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .475IConnection.getMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .475IConnection.isOpened . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .475IConnection.open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .476IConnection.rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .476IConnectionFactory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476IConnectionFactory.getConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .477IConnectionFactory.setLogConfiguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .477IConnectionMetaData. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478IConnectionMetaData.getConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .479IConnectionMetaData.getDriverMajorVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .479IConnectionMetaData.getDriverMinorVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .479IConnectionMetaData.getDriverName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480IConnectionMetaData.getDriverVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480IConnectionMetaData.getMaxConnections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480IConnectionMetaData.getMaxStatements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480IConnectionMetaData.getOdaMajorVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .481IConnectionMetaData.getOdaMinorVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .481IDataSourceMetaData. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481IDataSourceMetaData.getConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .483IDataSourceMetaData.getDataSourceMajorVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .484

Page 15: Accessing Data

xiii

IDataSourceMetaData.getDataSourceMinorVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484IDataSourceMetaData.getDataSourceObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484IDataSourceMetaData.getDataSourceProductName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485IDataSourceMetaData.getDataSourceProduct

Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485IDataSourceMetaData.getSortMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485IDataSourceMetaData.getSQLStateType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486IDataSourceMetaData.supportsInParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486IDataSourceMetaData.supportsMultipleOpen

Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486IDataSourceMetaData.supportsMultipleResultSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486IDataSourceMetaData.supportsNamedParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487IDataSourceMetaData.supportsNamedResultSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487IDataSourceMetaData.supportsOutParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487IParameterMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487IParameterMetaData.getParameterCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489IParameterMetaData.getParameterMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489IParameterMetaData.getParameterType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490IParameterMetaData.getParameterTypeName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490IParameterMetaData.getPrecision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490IParameterMetaData.getScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491IParameterMetaData.isNullable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491IResultSet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491IResultSet.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493IResultSet.findColumn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493IResultSet.getBigDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493IResultSet.getBlob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494IResultSet.getClob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494IResultSet.getDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495IResultSet.getDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495IResultSet.getInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496IResultSet.getMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496IResultSet.getRow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497IResultSet.getString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497IResultSet.getTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498IResultSet.getTimestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498IResultSet.next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499IResultSet.setMaxRows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499IResultSet.wasNull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499IResultSetMetaData. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500IResultSetMetaData.getColumnCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501IResultSetMetaData.getColumnDisplayLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501IResultSetMetaData.getColumnLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501

Page 16: Accessing Data

xiv

IResultSetMetaData.getColumnName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502IResultSetMetaData.getColumnType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502IResultSetMetaData.getColumnTypeName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502IResultSetMetaData.getPrecision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .503IResultSetMetaData.getScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .503IResultSetMetaData.isNullable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .503IRowSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504IRowSet.absolute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505IRowSet.add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505IRowSet.clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .505IRowSet.isEmpty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506IRowSet.previous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506IRowSet.setBigDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506IRowSet.setDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507IRowSet.setDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507IRowSet.setInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508IRowSet.setString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508IRowSet.setTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509IRowSet.setTimestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .510IRowSet.size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .510IStatement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511IStatement.clearInParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513IStatement.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513IStatement.execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513IStatement.executeQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .514IStatement.findInParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .515IStatement.getMaxRows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .515IStatement.getMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .515IStatement.getMoreResults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516IStatement.getParameterMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516IStatement.getParameterType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516IStatement.getResultSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517IStatement.getSortSpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517IStatement.prepare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517IStatement.setBigDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .518IStatement.setDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .518IStatement.setDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .518IStatement.setInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .519IStatement.setMaxRows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .520IStatement.setProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .520IStatement.setPropertyInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .520IStatement.setSortSpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .521IStatement.setString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .521

Page 17: Accessing Data

xv

IStatement.setTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522IStatement.setTimestamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522Class Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524Level.equals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526Level.getName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526Level.hashCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526Level.intValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527Class LogFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528LogFormatter.format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528Class Logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530Logger.config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531Logger.fine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531Logger.finer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531Logger.finest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531Logger.getHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532Logger.getLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532Logger.getName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532Logger.isLoggable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532Logger.info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532Logger.log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533Logger.setHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533Logger.setLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533Logger.severe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533Logger.warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534Class LoggingErrorHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535LoggingErrorHandler.error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536Class LogManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537LogManager.createLogger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538LogManager.getLogger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539Class LogRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540LogRecord.getLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540LogRecord.getMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541LogRecord.getMillis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541LogRecord.getThrown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541LogRecord.setLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541LogRecord.setMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541LogRecord.setMillis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542LogRecord.setThrown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542Class OdaException . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543OdaException.getCause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545OdaException.getErrorCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546OdaException.getNextException . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546OdaException.getSQLState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546

Page 18: Accessing Data

xvi

OdaException.initCause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .546OdaException.setNextException . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .547Class SimpleFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .548SimpleFormatter.format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .548Class SortSpec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .549SortSpec.addSortKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .550SortSpec.getSortColumn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .551SortSpec.getSortColumns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .551SortSpec.getSortKeyCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .552SortSpec.getSortMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .552SortSpec.getSortOrder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .552SortSpec.toString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .553Class StreamHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .554StreamHandler.close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .555StreamHandler.finalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .555StreamHandler.flush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .555StreamHandler.isLoggable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .555StreamHandler.publish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .556StreamHandler.setFormatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .556StreamHandler.setOutputStream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .556Class StringSubstitutionUtil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .557StringSubstitutionUtil.getDelimitedStringCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .557StringSubstitutionUtil.substituteByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .560StringSubstitutionUtil.substituteByName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .561

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565

Page 19: Accessing Data

A b o u t A c c e s s i n g D a t a u s i n g A c t u a t e e . R e p o r t D e s i g n e r P r o f e s s i o n a l xvii

A b o u t A c c e s s i n g D a t au s i n g A c t u a t e e . R e p o r t

D e s i g n e r P r o f e s s i o n a l

Accessing Data using Actuate e.Report Designer Professional provides information about using Actuate e.Report Designer Professional to access data for your reports. This manual explains the general concepts for accessing data and the procedures for accessing data from a variety of standard sources. It also provides information and a reference guide for creating your own data drivers to access additional data sources.

Accessing Data using Actuate e.Report Designer Professional includes the following chapters:

■ About Accessing Data using Actuate e.Report Designer Professional. This chapter provides an overview of this guide.

■ Part 1. Using Actuate e.Report Designer Professional data access technology. This part describes the general concepts for accessing data and also describes how to migrate a report to a production data source and how to access data from a text file.

■ Chapter 1. Accessing a data source. This chapter explains data access concepts, including data access terms and how to optimize data access tasks. It also provides information and procedures for sorting data, filtering data to limit the returned rows, and working with data from multiple sources.

■ Chapter 2. Migrating reports and reusing report components. This chapter provides information and procedures for reusing data and other components using configuration files. It also provides information and procedures for migrating a report from using development to production data connections without recompiling the report design.

■ Chapter 3. Modifying data processing. This chapter provides information and procedures for customization of Actuate e.Report Designer Professional’s default data access processing.

Page 20: Accessing Data

xviii A c c e s s i n g D a t a

■ Chapter 4. Displaying data rows. This chapter provides information and procedures for accessing the output of Actuate Query as data for your report.

■ Chapter 5. Accessing data in a comma-separated values (CSV) text file. This chapter provides information and procedures for accessing data from text files.

■ Part 2. Accessing data in a database or ODBC data source. This part provides information and procedures for accessing data from a database or ODBC data source.

■ Chapter 6. Connecting to a database or ODBC data source. This chapter provides information and procedures for connection to a database or ODBC data source.

■ Chapter 7. Creating a database or ODBC query. This chapter provides information and procedures for creating a query to access data from a database or ODBC data source.

■ Chapter 8. Filtering data. This chapter provides information and procedures for providing parameters to enable users to filter data from a database or ODBC data source.

■ Chapter 9. Maintaining a database or ODBC query. This chapter provides information and procedures for tuning a query and keeping a query synchronized to a database or ODBC data source.

■ Chapter 10. Accessing data using a stored procedure. This chapter provides information and procedures for accessing data from database stored procedures.

■ Part 3. Accessing SAP data. This part provides information, procedures, and reference guides for accessing data from SAP BW and SAP R/3 systems.

■ Chapter 11. Connecting to an SAP data source. This chapter provides information and procedures for connecting to an SAP data source.

■ Chapter 12. Accessing SAP BW data. This chapter provides information and procedures for accessing data from SAP BW.

■ Chapter 13. Accessing SAP R/3 data. This chapter provides information and procedures for accessing data from SAP R/3.

■ Part 4. Accessing data using Actuate Information Object technology. This part provides information, procedures, and reference guides for accessing data in Actuate Information Objects.

■ Chapter 14. Accessing an Actuate Information Object. This chapter provides information and procedures for accessing data from information objects created in Actuate Information Object Designer.

■ Chapter 15. Actuate SQL reference. This reference chapter describes the differences between Actuate SQL and ANSI SQL-92.

Page 21: Accessing Data

A b o u t A c c e s s i n g D a t a u s i n g A c t u a t e e . R e p o r t D e s i g n e r P r o f e s s i o n a l xix

■ Part 5. Using Actuate open data access technology. This part provides information, procedures, and reference guides for creating your own drivers to access additional types of data sources.

■ Chapter 16. Creating a custom data driver. This chapter provides information and procedures for creating your own custom data driver, including a description of the ODA configuration file schema.

■ Chapter 17. Configuration file XML schema reference. This chapter provides a description of the ODA configuration file schema.

■ Chapter 18. Custom data driver XML reference. This chapter provides a reference guide for the XML elements to use in your custom data driver to describe the structure of your data source.

■ Chapter 19. Custom data driver Java reference. This chapter provides a reference guide for the Java interfaces and Java classes required for creating a custom data driver.

Page 22: Accessing Data

xx A c c e s s i n g D a t a

Page 23: Accessing Data

P a r t

1Part 1Using Actuate e.Report Designer

Professional data access technology

Page 24: Accessing Data
Page 25: Accessing Data

C h a p t e r 1 , A c c e s s i n g a d a t a s o u r c e 3

C h a p t e r

1Chapter 1Accessing a data source

This chapter contains the following topics:

■ About accessing data for reports

■ About data access terms and relationships

■ Connecting to the data source from a report design

■ Specifying the data to retrieve from a data source

Page 26: Accessing Data

4 A c c e s s i n g D a t a

About accessing data for reportsDesigning a report involves the following tasks:

■ Plan the report

■ Start a new report design

■ Access data

■ Lay out the report

■ Format the contents of the report

■ Customize the page layout

■ Preview and test the report

This guide focuses on accessing data from report designs using Actuate e.Report Designer Professional. For more information about other report development tasks, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. Although you do not need an understanding of all of the issues that are discussed in Developing Actuate Basic Reports using Actuate e.Report Designer Professional, consider reading Part 1, “Getting started,” to gain an understanding of the report design process before you use the information in this book.

This chapter defines data access terms and provides general information about creating components to access data. After familiarizing yourself with these general concepts, consider reading the chapters about reusing components, migrating reports to production environments, modifying the default data processing, and displaying data rows before formatting a report. Other chapters discuss how to access data specifically from each of the following types of data sources:

■ Database and Open Database Connectivity (ODBC)

■ Information object

■ SAP BW

■ SAP R/3

■ Comma-separated values (CSV) text file

You also can access XML data by using Actuate Information Object Designer to create an information object that accesses data from XML files. Information objects can access and combine information from databases, SAP BW warehouses, and XML files.

Page 27: Accessing Data

C h a p t e r 1 , A c c e s s i n g a d a t a s o u r c e 5

About data access terms and relationshipsBefore a report can display data, it must obtain the data from a data source. Typically, the data source is a database. Other potential data sources include files, information objects, an SAP Business Information Warehouse, and so on. The computer that generates the report must have a local or network connection to the data source.

You obtain data from the data source using a data stream. Figure 1-1 shows how data flows from a data source, through a connection, to an Actuate report.

Table 1-1 describes the components that are involved in accessing data.

Figure 1-1 Data flow from data source to Actuate report

Data stream

Data source

Connection

Connection component

Data source

component

Data row component

ReportSection component

Data filter component

Table 1-1 Components of accessing data

Component Description

Connection Stores the information that the report needs to connect to the data source. A section can use a connection component in its own connection slot or a connection in the Connection slot of the data source component. If a data source component does not have its own connection, it uses the connection component that is defined above it. The connection component is also called a database connection component. You can use connection components to connect to databases and other types of data sources. Some types of data sources, such as text file, do not need a connection component. For example, e.Report Designer Professional opens a text file and processes its contents based on custom code and variables that identify the file and how to read the data.

(continues)

Page 28: Accessing Data

6 A c c e s s i n g D a t a

In addition to these components, the terms in Table 1-2 refer to components or groups of components:

Data filter Optional. Performs additional processing to put the data in the form that the report requires. Each filter passes a data row to the next filter in the data stream, if another filter exists. If there are no filters, the data row from the data source component is passed directly to the report. Filters are used to omit rows, sort rows, compute new values, perform lookups, or combine data from several sources.

Data row Consists of a set of variables that contain the data from the data source.

Data source Selects data from the data source and puts the data in data rows. For most types of data sources, the data source component uses a connection component to connect to the data source. For example, a data source component that accesses data from a database uses the connection component to the database. A text file is an example of a data source that does not need a connection component.

Section Receives data rows and displays them.

Table 1-1 Components of accessing data (continued)

Component Description

Table 1-2 Component terminology

Term Description

Data adapter A data source component or a data filter component. Data adapters collect, process, and deliver data rows to report sections.

Data component All types of data-related components that are available on Toolbox—Data. A data component can be a data connection component, data source component, data row component, or data filter component.

Data stream A group of components, including data adapters, that selects data from the data source and places the data in the data row structure that the report requires. A data stream contains a data source component, a data row component, and optionally one or more data filter components. The data stream can require a connection component, depending on the type of data source.

If the data stream requires a connection component, the data stream can use the connection component that is defined within the data stream, if one exists. If the data stream does not contain a connection component, the data stream can use the closest connection component above it. For example, if a report section contains the data stream, the data stream can use the report section’s connection component. For information about sections, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Page 29: Accessing Data

C h a p t e r 1 , A c c e s s i n g a d a t a s o u r c e 7

Connecting to the data source from a report designA connection is a communication link from a computer to a data source. A connection component establishes and maintains the connection between a data source and a report. e.Report Designer Professional uses the connection to:

■ Get lists of tables and columns from which you choose when you design a report.

■ Provide access to data for a report during report generation.

You can create report sections without a connection component in the following situations:

■ If the report section shares a connection with an outer report section. For more information about sharing a connection, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

■ If the report section does not use data or gets data from a type of data source that does not use a connection component. You can handle data from additional types of data sources by creating a custom data stream. For example, the method of data access from CSV files in e.Report Designer Professional uses a custom data stream.

To deploy report object executable (.rox) files using a connection, you must also define the connection on Actuate iServer. For more information about defining a database connection on Actuate iServer, see Configuring Actuate iServer.

Choosing where to place a connection componentThe data source component uses the connection component that is closest to it in the report structure. If a data source component does not contain its own connection, e.Report Designer Professional searches upward in the report structure until it finds a connection. A connection in a data source takes precedence over a connection in a section. A section of a report design can have its own connection component or inherit the connection component of an enclosing section. Sequential, conditional, and parallel sections access data indirectly through the enclosing section.

One way to work with a database connection is to place the connection in the data source component. Use this technique when a report uses a single data source component or if each data source component in the report requires a different connection. If you publish the data source component, the connection and data source components are published together.

Place a connection component in a report section or group section if multiple data source components can or must share the connection. For example, if you have two report sections that both require the same data source, you can create a report section that encloses both of them and specify the connection only in the

Page 30: Accessing Data

8 A c c e s s i n g D a t a

enclosing report section. This approach can increase performance, because the data source only opens and closes one connection. You also can use this approach if your data source restricts the number of concurrent connections.

Creating a connection componentThe connection component stores data source-specific information that is needed to access the data source server, such as server name, user name, and password. Each of these items is a property of the connection component. For example, the user name is set in the UserName property. After you create a connection component, you can delete or modify it like any other component. For more information about components and properties, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Actuate e.Report Designer Professional provides connection components for DB2, ODBC, Oracle, SAP BW, SAP R/3 and information object connections. For some types of data sources, such as Oracle, you must install a database client or other software on your system so that your computer can access the data source. For more information about creating connections for a specific type of data source, see the one or more chapters specifically about that data source.

How to create a connection component

1 From the toolbox, select Data, as shown in Figure 1-2.

Figure 1-2 The data tools

2 Drag a database connection component from Toolbox—Data and drop it in a Connection slot, in Report Structure, as shown in Figure 1-3.

Figure 1-3 Adding a connection component

3 In Select Component, select the type of connection to create, as shown in Figure 1-4, then choose OK.

Page 31: Accessing Data

C h a p t e r 1 , A c c e s s i n g a d a t a s o u r c e 9

If you have already chosen a data source component, only connection types that are compatible with that data source component appear in this list.

Figure 1-4 Selecting the type of connection

Component Properties appears, displaying the properties that are available for the selected type of connection. Figure 1-5 shows the properties that are available for an ODBC connection.

Figure 1-5 Properties for an ODBC connection

4 Type the connection properties that your data source server requires. For some properties, you can choose a value from a drop-down list.

If you do not specify the required connection properties for the connection component, Database Login appears and requests the connection properties when e.Report Designer Professional attempts to connect to the data source.

Specifying the data to retrieve from a data sourceTo specify the data that you want to retrieve from the data source, use a data source component. Actuate e.Report Designer Professional provides data source components for use with standard types of data sources, such as DB2, ODBC, Oracle, SAP, and information objects. For each of these types of data sources, e.Report Designer Professional provides an editor or wizard to specify the data to retrieve from the data source. You can then create a report design that uses some or all of the fields in the retrieved data. For better performance, limit the fields that are obtained by your data source component to just those fields that your report design requires. If you have data or connections that your organization needs to access frequently, consider using libraries and configuration files to facilitate reusability.

Page 32: Accessing Data

10 A c c e s s i n g D a t a

Page 33: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 11

C h a p t e r

2Chapter 2Migrating reports and

reusing report componentsThis chapter contains the following topics:

■ About migrating reports and reusing report components

■ Selecting an existing connection configuration file

■ Understanding e.Report Designer Professional connection configuration files

■ Using a connection configuration file to access data sources

■ Choosing a connection or data source component from a connection configuration file

Page 34: Accessing Data

12 A c c e s s i n g D a t a

About migrating reports and reusing report components

A report design can have an associated connection configuration file that e.Report Designer Professional loads when opening a report design. The file is an XML document that provides access to data connections, libraries, and report templates for use in report designs. You can standardize on a single e.Report Designer Professional connection configuration file for all projects or design a connection configuration file for each set of reports, such as the set of all financial reports for a company.

Connection configuration files enable migration of reports to a production environment. You can use a connection configuration file to specify which data connections to use in the design environment. You can use the same data connections or specify different connections for use when Actuate iServer runs the report. By specifying both design-time and run-time connections, you do not have to change the report design when migrating a report to a production environment.

Connection configuration files also support reuse of report components in multiple report designs, providing a mechanism for centralized control of the structure and format of report components. You can use e.Report Designer Professional connection configuration files to manage and set up easy access to libraries, report templates, and data components. You can place a library in a report design without using a connection configuration file but using a connection configuration file provides quick access to structural, data, and visual components for report building. For example, if all your reports use the same libraries, you can specify that e.Report Designer Professional automatically include these libraries in every report that you create. Alternately, you can create different connection configuration files for different purposes. For example, you can create separate connection configuration files for the Sales and Finance departments. Each connection configuration file can provide easy access to department-specific data streams, report templates, and libraries.

Using a connection configuration fileA connection configuration file is an XML file that you use to set data source connection settings that you want to use when a report is run on an Actuate iServer system. In e.Report Designer Professional, you can also use the file to configure other settings. The settings that you include in a connection configuration file can override the settings in a report. For example, you can develop a report using one data source, such as a test database. Then, you can create a connection configuration file to run the report with a different data source, such as the equivalent production database. To change or add connection

Page 35: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 13

information for a spreadsheet report, you create or modify an existing connection configuration file with the connection information.

You can use the same connection configuration file for every spreadsheet report that you run on Actuate iServer. e.Spreadsheet Designer, e.Report Designer Professional, and BIRT all use the same connection configuration file. Each entry in the file is specifically for a particular product.

Actuate iServer expects the file to be in UTF8 encoding, which allows a variety of special characters. You can also use a file with only ASCII characters.

There is no default location for the connection configuration file. To use a connection configuration file, you create the file and then specify its location using the ConnConfigFile parameter in Actuate Management Console. Set the ConnConfigFile parameter to the absolute path and name of your connection configuration file. If you have a cluster of iServers, each iServer in the cluster needs to have access to the file. The path can be a local absolute path on each machine and must be specified for each iServer in the server configuration. If you use a single copy of the file for a cluster, put the file in a shared location and then specify the path to that shared location for all iServers in the cluster.

When you run a report, Actuate iServer uses the data source connection information in the connection configuration file specified in the ConnConfigFile parameter, if the file exists and the name of the data source is listed in the file. If the file does not exist or does not list the data source, then Actuate iServer uses the connection information from the definition of the data source in the spreadsheet report.

Selecting an existing connection configuration fileTo help new report users get started quickly, e.Report Designer Professional’s default report development environment includes a sample connection configuration file. Before you begin developing production reports, you should specify a connection configuration file appropriate for your development environment. If you do not replace or disable the default connection configuration file, all report designs that you create include a few Actuate-defined resources, such as a default connection component and sample libraries.

If your organization has created one or more connection configuration files, a report developer can select the appropriate connection configuration file by choosing Tools➛Options➛General and navigating to the file, as shown in Figure 2-1.

When you choose Refresh on Options—General, e.Report Designer Professional reads the connection configuration file. If there are errors in the file, Output displays error messages, as shown in Figure 2-2.

Page 36: Accessing Data

14 A c c e s s i n g D a t a

Figure 2-1 Navigating to the connection configuration file

Figure 2-2 Error message display

If there are no errors in the file, e.Report Designer Professional invokes this connection configuration file when opening this report design or running the report.

You do not need to specify a connection configuration file to use e.Report Designer Professional. If you prefer to start your report designs with a blank slate, you can navigate to Options—General and delete the path and file name in Configuration File.

Understanding e.Report Designer Professional connection configuration files

An e.Report Designer Professional connection configuration file can contain the following types of information:

■ The path along which to search for report design components

■ The database connections to use for a report design

Navigate to the connection configuration fileChoose Refresh to read the configuration file

Page 37: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 15

■ The database connections to use for running a report on Actuate iServer

■ The component and function libraries available to a report design

■ The component and function libraries to include in a report design

■ Templates on which to base report designs

■ The path to other connection configuration files that provide access to additional resources

You can use any text editor to create a connection configuration file, as long as the resulting file contains only the text you type. The connection configuration file is an XML document composed of declarations, elements, comments, and processing instructions. The best way to create this document is to make a copy of the sample connection configuration file and replace the contents of the file with information specific to your development environment. The sample connection configuration file has the following name and location under the Actuate home directory:

\eRDPro\Examples\ConfigurationFile\sample_configuration_file.xml

A connection configuration file consists of the root element <config> and one or more of the top-level elements, listed in any order. The <config> root element is required. The format of the file appears as follows:

<config><top-level element 1>...</top-level element 1>...<top-level element n>...</top-level element n>

</config>

The top-level elements are described in Table 2-1.

Table 2-1 Connection configuration file top-level elements

Top-level Element Description

Design Indicates which libraries, data connections, and template to make available to the report design. You can use only one Design element, which can specify multiple libraries, connections, and templates.

Include Optional element that specifies that another connection configuration file’s contents also should be read and used. You can use more than one Include element.

Runtime Optional element that specifies the data connections to use when Actuate iServer runs the report. You can use only one Runtime element, which can specify multiple data connections.

(continues)

Page 38: Accessing Data

16 A c c e s s i n g D a t a

Your Design element can specify as many libraries, templates, and connections as you need by using the second-level elements listed in Table 2-2.

For example, all of the top-level and Design elements are used in the following connection configuration file:

<Config><SearchPath>

<Location>\DesignResources</Location></SearchPath>

<Include>C:\Includes\StocksConfig.xml

</Include>

<Design><Library

Autoinclude="true"Alias="Financial Reports">

C:\LibraryFiles\Finance.rol

SearchPath Optional element that lists the location of the libraries to use with this connection configuration file. You can only use one SearchPath element, which can list the location of multiple library locations.

Table 2-2 Second-level elements in a Design element

Element within the Design element Description

Connection Optional element that specifies data connections to make available to the report design.

Library Optional element that identifies the libraries to make available to the report design. For information about using libraries and the syntax for using the Library element in a connection configuration file, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Template Optional element that identifies a template to make available to the report design. For information about the syntax for using the Template element in a connection configuration file, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Table 2-1 Connection configuration file top-level elements (continued)

Top-level Element Description

Page 39: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 17

</Library>

<Connection Type="ODBCConnection"Alias="Financial reporting resources"DefinedIn="C:\LibraryFiles\Stocks.rol"Description="For quarterly and weekly financial

reports."IsDefault="True"><Property

PropName="DataSource">ChartExamples

</Property></Connection>

<TemplateAlias="Finance Reports Template"Description="Template for Finance Department use.">

C:\Includes\FinanceTemplate.rod</Template>

</Design>

<Runtime><ConnectOptions

Type="ODBCConnection"><Property

PropName="DataSource">sfdata

</Property></ConnectOptions>

</Runtime></Config>

Any new blank report that uses this connection configuration file includes three libraries and a reference to the default connection, as shown in Figure 2-3.

Including another connection configuration file makes additional resources available to a report design. The Include element specifies other connection configuration files to include in the design. To include multiple connection configuration files, create an Include element for each file, as shown in the following example:

<Include>C:\Standard\APayableConfig.xml

</Include>

<Include>C:\Configuration\AReceivableConfig.xml

</Include>

Page 40: Accessing Data

18 A c c e s s i n g D a t a

Within each Include element, provide an absolute path or a path relative to the directory that contains the connection configuration file. Alternatively, you can provide an absolute or relative URL.

Figure 2-3 Blank report using the configuration file

Using a connection configuration file to access data sources

A report can use one or more connections to data sources of various types. e.Report Designer Professional uses a connection to a data source when:

■ A report designer creates or edits a query.

■ A report designer runs a report from e.Report Designer Professional.

■ A user runs a report on Actuate iServer.

Although you can define data connection and data source components for each report design or manually include a library containing these components, consider using a connection configuration file. If more than one report design uses the same data connection or data source components, using a connection configuration file can simplify the access and reuse of these components.

You also can use a connection configuration file to specify the use of one connection for use when designing a report and specify another connection of the

Library specified for automatic inclusion in the Library element within the Design element

Library specified within StocksConfig.xml, another configuration file incorporated using the Include element

Library that is included because it contains the default connection, ODBC

Reference to the default design connection, specified within the Connection element in the Design element

Page 41: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 19

same type for use when running the report. This capability enables migration from a development database to a production system without changing the report design files.

Choosing whether to place data connection and data source components in a libraryAlthough you can define a data connection in the connection configuration file directly, consider including a data connection in a library as part of your component reuse strategy. If a connection is included in a library, you can use the connection configuration file to provide report designs access to both the library and the data connection.

If you use a library, you can publish connection components separately or as part of a data source component. Typically, connection components are published separately for greater reusability. You can improve reusability of a published data source component by specifying fields in the tables that you expect report designs to need. To improve performance when you include that component in a report design, a report developer can modify it to retrieve only the fields that the report design requires. For information about creating libraries and the syntax for using the connection configuration file’s Library element, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Specifying a connection for use in developing a report designUse the Connection element in the connection configuration file’s top-level Design element to specify one or more connections for a report design. Use a separate Connection element for each connection. If you do not specify a corresponding connection in the connection configuration file’s Runtime element, then Actuate iServer uses the connection defined in the Connection element to run the report.

You can specify a connection using the parts of the Connection element, as shown in Table 2-3.

Table 2-3 Connection element parts

Part within the Connection element Description

Type element Specifies whether the report connects to an SAP, ODBC, or other type of data source. You can use class name, such as AcODBCConnection, or you can use another descriptive term, such as ODBC or TradesDB. You can specify multiple connections of the same type.

(continues)

Page 42: Accessing Data

20 A c c e s s i n g D a t a

If a connection is in a library, the string you use for Type must match the string that appears in Report Structure for the connection in the library. Typically, string mismatches result from using spaces inconsistently.

Alias element Optional element that defines the name of the component that creates the connection. The Design element can contain multiple entries for the same connection type, such as ODBC, but each entry must have a different alias. The alias appears in the Name column on Report Wizard—Choose Database.

Description element Optional element that provides a brief explanation of the connection’s purpose. The description appears in the Description column on Report Wizard—Choose Database.

DefinedIn element Optional element that indicates a library that contains the connection. The path you specify in DefinedIn is relative to the directory that contains the connection configuration file.If the library that contains this connection is not in either the SearchPath element or the Library element, e.Report Designer Professional uses the DefinedIn path to include the library in the report design. If the library is not in the SearchPath, Library, or DefinedIn element, you must include the required library when you build a report that uses the connection.

IsDefault element Optional element that indicates whether the connection is the default connection for blank report designs. If you set IsDefault to True for a connection, then a newly created blank report has that connection by default. If you set more than one default connection, the last connection in the connection configuration file becomes the default connection.

Table 2-3 Connection element parts (continued)

Part within the Connection element Description

Page 43: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 21

The following code example shows how to specify an ODBC connection that is part of a library:

<Design><Connection

Type="ODBCConnection"Alias="Financial reporting resources"DefinedIn="C:\LibraryFiles\Stocks.rol"Description="For quarterly and weekly financial reports."IsDefault="true"><Property

PropName="DataSource">stocktrades

</Property></Connection>

</Design>

You can include a connection without reference to a library by omitting DefinedIn, as shown in the following example:

<Design><Connection

Type="ODBCConnection"Alias="Customer Service database"Description="For quarterly and weekly service level

reports."<Property

PropName="DataSource">custserv

</Property></Connection>

</Design>

Property element Defines one or more properties of the data source. The properties vary according to the type of data source. For example, an ODBC connection requires a DataSource property. For a list of the properties of each type of connection, see AcDBConnection, AcDB2Connection, AcMSSQLConnection, AcODAConnection, AcODBCConnection, AcOracleConnection, and AcSAPConnection in Programming with Actuate Foundation Classes.

Table 2-3 Connection element parts (continued)

Part within the Connection element Description

Page 44: Accessing Data

22 A c c e s s i n g D a t a

To externalize an AcAisConnection, you must specify the path to the library where AcAisConnection is defined. The library path depends on the installation and is specified in the DefinedIn attribute of the connection element. Set the Autoinclude attribute for the Library element to true.

AcAisConnection is defined in the library AcAISDataSource.rol. For the default installation, the path is C:\Program Files\Actuate10\oda\ais\AcAISDataSource.rol.

This example specifies an AIS connection to an iServer hosted on viper at port 8000:

<Design> <Library

Autoinclude="true" Alias="My Connections">

C:\Program Files\Actuate10\oda\ais\AcAISDataSource.rol

</Library><Connection

Type="AcAisConnection"Alias="AIS_viper"DefinedIn="C:\Program Files\Actuate10\oda\ais\

AcAISDataSource.rol" Description="Connects to AIS on viper"IsDefault="False"> <Property

PropName="ServerUri">http://viper:8000/

</Property><Property

PropName="Volume">viper

</Property><Property

PropName="UserName">administrator

</Property><Property

PropName="Password" /> </Connection>

</Design>

Specifying a connection for use in running a reportYou can use one set of connections while designing a report and a different set when Actuate iServer runs the report. If you do not set up a different set of connections for running the report, then Actuate iServer uses the design

Page 45: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 23

connections. This is useful for migrating a report design from a development environment to a production environment without recompiling the report design.

You must use the same type of data source for report generation as for report design. For example, you cannot migrate from an ODBC data source to an SAP data source.

To specify a different connection for Actuate iServer to use in running a report, you must specify the connection in the connection configuration file’s Runtime element and use the data connection’s ConfigKey property to identify the appropriate run-time connection specified in the Runtime element. The report design’s connection’s ConfigKey property identifies which connection specified in the Runtime element should be used by Actuate iServer to run the report. If you do perform these steps, then Actuate iServer uses the design connection to run the report.

To run the report on Actuate iServer using a connection configuration file, you also must set a path to the connection configuration file using Actuate iServer’s Connection configuration file for connections parameter, ConnConfigFile. When you set this parameter, Actuate iServer uses the connection configuration file to run reports that require the file. If you do not set this parameter, a database error occurs for reports that require the connection configuration file. For more information about the connection configuration file for Connections parameter, see Configuring Actuate iServer.

Specifying connections in the Runtime element for use when running the reportThe Runtime element of a connection configuration file specifies information about the connections for Actuate iServer to use for report generation. Use this element when you want to use different connections when designing the report than you use when Actuate iServer runs the report. A connection configuration file has one Runtime element, which can specify multiple connections. Within the Runtime element, you can use one or more ConnectOptions elements. Each ConnectOptions element specifies information needed for the connection, using the parts of the ConnectOptions element listed in Table 2-4

In the connection configuration file’s Runtime element, use a ConnectOptions element for each connection, as shown in the following example:

<Runtime><ConnectOptions

Type="ODBCConnection"><Property

PropName="DataSource">finapps

</Property></ConnectOptions>

</Runtime>

Page 46: Accessing Data

24 A c c e s s i n g D a t a

.

Setting the ConfigKey property to specify using a different connection when running a reportBy setting a connection component’s ConfigKey property in e.Report Designer Professional, you can preset the use of a different connection when Actuate iServer runs the report. By using ConfigKey, you can migrate a report design from a development environment to a production environment without recompiling the code.

Set the ConfigKey property of the report design’s connection component to match the Type property of a connection in the Runtime element. Be sure that you use the same type of connection for designing the report and running the report. For example, if the report design’s connection is an ODBC connection, be sure to specify another ODBC data source in ConfigKey. Do not change the DataSource property for the connection. The ConnectOptions element of the Runtime element specifies the data source. Figure 2-4 shows a ConnectOptions element and a ConfigKey element that references it.

Table 2-4 Parts of the ConnectOptions element

Part within the ConnectOptions element Description

Type element Specifies whether the report connects to an SAP, ODBC, or other type of data source. You can use appropriate class name, such as AcODBCConnection, or you can use another descriptive term, such as ODBC or TradesDB.

If a connection is in a library, the string you use for Type must match the string that defines the connection in the library. Typically, string mismatches result from using spaces inconsistently.

Property element Defines one or more properties of the data source. The properties vary according to the type of data source. For example, an ODBC connection requires a DataSource property.

For a list of the properties of each type of connection, see AcDBConnection, AcDB2Connection, AcMSSQLConnection, AcODAConnection, AcODBCConnection, AcOracleConnection, and AcSAPConnection in Programming with Actuate Foundation Classes.

Page 47: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 25

Figure 2-4 A ConnectOptions element and a corresponding ConfigKey property

Choosing a connection or data source component from a connection configuration file

If you specify a library in a connection configuration file that contains a data source component, a report developer can pick the data source component from a list of predefined data sources in the report wizard. If you specify a connection component in a connection configuration file, a report developer can pick the connection from a list of predefined databases and other types of data sources. The list of connections contains connection components that are specified directly or as part of a data source component. If you modify a data source that a component in a library references, the data source component is subclassed from the component in the library.

How to use a connection component that is specified in a connection configuration file

1 In Report Structure, as shown in Figure 2-5, select a report section, connection, or data source slot.

Figure 2-5 ReportStructure

2 Choose Tools➛Database Connection.

On Database Connection, select Choose from a list of predefined databases, as shown in Figure 2-6, then choose Next.

Database Connection—Choose Database lists the connections that are specified through the connection configuration file, as shown in Figure 2-7.

3 Select a connection, then choose Next.

<Runtime><ConnectOptions

Type="AcODBCConnection"><Property

PropName="DataSource">SalesData

</Property></ConnectOptions>

</Runtime>

Page 48: Accessing Data

26 A c c e s s i n g D a t a

Figure 2-6 Choosing to use a list of predefined databases

Figure 2-7 Connections listed in the connection configuration file

Connection properties that are relevant for the type of connection that you selected appear in Database Connection—Properties. For example, Figure 2-8 shows the connection properties for an ODBC data source.

4 If necessary, modify the connection information by typing a value or choosing from a drop-down list. After completing modifications to connection information, choose Finish.

Report Structure displays the selected connection component in the Connection slot, as shown in Figure 2-9.

Page 49: Accessing Data

C h a p t e r 2 , M i g r a t i n g r e p o r t s a n d r e u s i n g r e p o r t c o m p o n e n t s 27

Figure 2-8 Connection properties for an ODBC data source

Figure 2-9 Report Structure with a connection component

Page 50: Accessing Data

28 A c c e s s i n g D a t a

Page 51: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 29

C h a p t e r

3Chapter 3Modifying data processingThis chapter contains the following topics:

■ About modifying data processing

■ Modifying handling of a connection component

■ About data adapters, data source components and data filters

■ Sorting data

■ Filtering data

■ Working with data from multiple sources

Page 52: Accessing Data

30 A c c e s s i n g D a t a

About modifying data processingTypically, e.Report Designer Professional’s default functionality is sufficient for a report developer’s data access needs. For information about this default functionality, see Chapter 1, “Accessing a data source.”

e.Report Designer Professional also supports customization of its default data access functionality. This chapter provides additional information about the data components and describes techniques to modify standard data processing. This chapter assumes an understanding of data access terms and relationships, as described in “About data access terms and relationships” in Chapter 1, “Accessing a data source.”

e.Report Designer Professional is an object-oriented program using classes written in Actuate Basic. Each report design component is a representation of a class. You can supplement or override the default functionality by using object-oriented programming to modify these classes. These classes reside in the Actuate Foundation Class library and some of them are represented by icons in e.Report Designer Professional.

For more information about setting component properties, subclassing components, referencing components, and copying components, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. For more information about Actuate Basic, see Programming with Actuate Basic. For more information about Actuate Foundation Classes, see Programming with Actuate Foundation Classes.

Modifying handling of a connection componentTypically you only set the properties for a connection component and determine where to place the component. For information about placing a component to improve performance or support reuse, see “About data access terms and relationships” in Chapter 1, “Accessing a data source.”

If desired, you can also customize the methods for the connection component. If you placed the connection in a data stream, the data adapter instantiates the connection by calling NewConnection() and opens it by calling OpenConnection(). You can override NewConnection() to customize the selection of a connection. You can override OpenConnection() to customize the connection before opening it.

If you placed the connection in a section, the section’s Start() method instantiates the connection and passes it to the data source. If desired, you can customize the Start() method.

Page 53: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 31

About data adapters, data source components and data filters

A data adapter can be a data source component or a data filter component. A data source component retrieves data from an input source, such as a database and creates data rows. A data filter component sorts, filters, or performs other computations on a data row.

Data sources, data filters, and data rows are transient objects. The Factory deletes them after they retrieve, process, and deliver all data rows to a report.

Combining data adapters to form a data streamA data stream has the following characteristics:

■ A data stream must have at least one data source. It can have multiple data sources. If a report uses data from multiple input sources, there must be a data source for each input source.

■ A data stream can have any number of data filters.

Figure 3-1 shows a data stream configuration that retrieves data from a single input source, instantiates a data row, and passes the data to a report section.

Figure 3-1 Data stream configuration with a single input source

In Figure 3-2, the data stream retrieves data from a single input source, instantiates a data row, filters the data, instantiates a data row for the filtered data, and passes the filtered data to the report section.

The data stream in Figure 3-3 uses a single input source and multiple data filters. Each time data is filtered, the data stream instantiates a new data row.

Figure 3-4 shows a configuration that uses multiple input sources, for example from different databases, and a multiple input data filter.

Data source

Data row

Section

Input source

Data

Data stream

Page 54: Accessing Data

32 A c c e s s i n g D a t a

Figure 3-2 Data stream configuration with a single input source and a filter

Figure 3-3 Data stream configuration with a single input source and multiple data filters

Figure 3-4 Data stream configuration with multiple input sources and a multiple input data filter

Data source

Data row 1

Data filter

Data row 2

Data stream

Input source

Data

Section

SectionData source

Data row 1

Data filter Data filter

Data row 2 Data row 3

Data stream

Input source

Data

Data source

Data row 1

Data row 2

Data row 3

Data row

Data source

Data source

Multiple-input data

filter

Data stream

Section

Input source

Data

Input source

Data

Page 55: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 33

Instantiating data adaptersThe section instantiates the data adapter that provides data rows to it. If a data stream consists of multiple data adapters, each data adapter instantiates the component that delivers data rows to it. The order in which you set up component references in Report Structure determines the order in which data adapters instantiate.

For example, consider the report design shown in Figure 3-5.

Figure 3-5 Report design

In this report design:

■ The report section instantiates MemoryDataSorter.

■ MemoryDataSorter instantiates SingleInputFilter.

■ SingleInputFilter instantiates the data source, SqlQuerySource.

Figure 3-6 shows the order of instantiation of these components and the direction of data flow.

Figure 3-6 Order of instantiation and the direction of data flow

Customizing a data stream by modifying data adapter methodsTypically you do not need to customize a data stream as e.Report Designer Professional provides rich support for a variety of data source types. If you do want to customize a data stream, you can modify the methods used by the data source components or data filter components. Data source components and data filter components follow a common protocol defined by the abstract base class AcDataAdapter.

Report section SqlQuerySourceMemoryDataSorter SingleInputFilterReport section

Order of instantiation

Report section SqlQuerySourceMemoryDataSorter SingleInputFilterReport section

Direction of data flow

Page 56: Accessing Data

34 A c c e s s i n g D a t a

Adding code for additional data stream tasksYou can add code to perform additional tasks when starting data access, fetching each row, and finishing data access. Table 3-1 describes the methods used for starting to access a data source, finishing data access, and fetching rows.

To change a data row after the data adapter populates it with data from the input record, override the data row’s OnRead() method. e.Report Designer Professional calls OnRead() after the data row gets its data. For more information about data rows, see “About data rows,” later in this chapter.

For an example of customizing these methods, see Chapter 5, “Accessing data in a comma-separated values (CSV) text file.”

Accessing data in non-sequential orderBy default, e.Report Designer Professional fetches rows in sequential order. Typically, an input source supports only sequential access to data. A SQL database, for example, returns a set of records based on your query and sends one input record at a time to the data source sequentially.

Sometimes, however, your report requires random access to data. For example, a report can use the same data multiple times for both tabular and chart formats. A

Table 3-1 Methods for starting to access a data source, fetching rows, and finishing access to a data source

Method Description

Start() Opens the data adapter. If the input source is a spreadsheet, text file, Start() opens the file.If the input source is any other type of input source, Start() opens a cursor. If the input source is a stored procedure, Start() also formats the procedure call for the data source. If the input source is a R/3 data, Start() also processes the RFM export parameters. If the input source is an SAP BW BEx Query Cube data source that uses a MDX statement, Start() also obtains the MDX statement text. You can override this method to perform a task such as opening a different data source from which the data stream gets data.

Fetch() Retrieves a single row. To retrieve all rows, the data adapter calls Fetch() repeatedly until there are no more rows. Fetch() returns Nothing after it retrieves all rows. You can override this method to populate the variables in a data row with the retrieved data row or to provide custom filtering.

Finish() Closes the data adapter. You can override this method to perform a task such as closing a file you opened in Start().

Page 57: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 35

data filter can also require multiple passes over a set of rows for sorting or calculating custom aggregations.

To support random access, AcDataAdapter defines the methods shown in Table 3-2.

e.Report Designer Professional provides a data filter class, AcDataRowBuffer, that implements the random access methods. You can use this class in a data stream to create a data filter that processes rows in any order.

Using data filters to process rowsA data filter component can compute new values, perform custom lookups, select rows, sort rows, and join data from several data sources. Unlike data source components, data filters are optional. Typically, you use a data filter to process data from a non-SQL database or data that originates from several different external sources.

Use a data filter for a single data source only to process the data rows in ways that the data source does not provide. For example, do not use a sort filter to perform a sort that your data source can do. If your data source does not support returning rows in the row order your report requires you can add a filter to specify that the Actuate software performs the sorting.

A data filter receives data rows from one or more data adapters, processes the data, then passes it to the next data adapter or to the report section. There are two abstract classes of data filters:

■ AcSingleInputFilter, which accepts input from one data adapter

■ AcMultipleInputFilter, which accepts input from multiple data adapters

You implement the processing algorithm on data rows in the Fetch() method.

Table 3-2 Methods that support random access

Method Description

CanSeek() True if the data adapter supports random access

GetPosition() Returns the position of the next row to fetch

Rewind() Moves the fetch position to the beginning of the input set

SeekBy() Moves the fetch position by a given amount relative to the current position

SeekTo() Moves the fetch position to a given location

SeekToEnd() Moves the fetch position to one unit past the end of the input set

Page 58: Accessing Data

36 A c c e s s i n g D a t a

Table 3-3 describes the methods for working with a data filter.

For examples of creating a data filter, see “Filtering data” and “Working with data from multiple sources,” later in this chapter.

About data rowsA data source component creates a data row instance for each input record it retrieves. A data filter component creates a data row instance for each input record it allows to pass through, possibly modifying the input record first. A data row consists of variables, each corresponding to a single field or column of the input record. The list of variables defines the data that you can include in the report.

If you use Query Editor or Textual Query Editor to write a SQL query, the data source creates the data row. Other data sources, such as SAP, also automatically create the data row. If you use a custom data source or a custom data filter, you must define a custom data row that works with the data source or filter.

A data row component is a class you work with when you are designing a report. A data row object is an instance of that class that is instantiated to hold the data coming from the data source when you run the report. When you run the report, the data source component instantiates a set of data row objects that contain the data retrieved from the database. In sum, each report design has one data row component, but as you run the report, it can process thousands of data row objects, or none, if no rows match the query. For more information about classes and instantiation, see Programming with Actuate Foundation Classes.

Actuate software creates, assigns values to, and uses data rows in the following sequence:

1 The data adapter instantiates a data row. If the data adapter is a data source, it instantiates a data row each time it retrieves an input record using Fetch(). If the data adapter is a data filter, it instantiates a data row after processing one or more data rows created by one or more data sources or another data filter.

2 The data adapter copies the input record’s column values to the data row’s variables, as shown in Figure 3-7. If a report uses a SQL query data source, the SetupDataRow() method of the SQL query source performs this task.

Table 3-3 Methods for working with a data filter

Method Description

Start() Instantiates and opens the input adapter, the data adapter that provides data rows.

Fetch() Retrieves a single data row and processes it. Optionally, the data filter creates a new data row.

Finish() Closes the input adapter.

Page 59: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 37

Figure 3-7 Copying the input record’s column values to the data row’s variables

3 A data control gets its value from the data row and typically displays it. The control’s SetValue() method retrieves from the data row the value of every column, variable name, or method name the control’s ValueExp property specifies. The build process generates the code in SetValue().

4 The code SetValue() generates uses the data row variable’s columns or methods to set the value of the control’s DataValue variable, as shown in Figure 3-8.

Figure 3-8 Setting the value of the control’s Data Value variable

For an example of how to create a custom data row and modifying a data row component, see “Accessing data from a CSV text file” in Chapter 5, “Accessing data in a comma-separated values (CSV) text file.”

Input recordColumns

Variables

Data row

The Factory generates CustomerName::SetValue by matching customers.customName with the variable name in the data row. When the report runs, e.Report Designer Professional generates the sub SetValue() method for the control. This method sets the value of the DataValue variable. That value is what the report design shows by default.

Page 60: Accessing Data

38 A c c e s s i n g D a t a

Table 3-4 describes how a control implements the core content-creation protocol.

Table 3-4 Methods used to implement the core content-creation protocol for a control

Method Task

Start() Typically, a control needs only the default logic. The content of Start() depends on the type of control. Start() handles housekeeping tasks, such as recording sizing information. For some types of controls Start() performs additional types of preparation to display the control. For example, Start() for a graph control determines if the graph type involves a time series and handles special preparation of the x-axis labels if the graph is a pie chart.

BuildFromRow() Sets the control’s value, calling SetValue() as many times as necessary.

■ If a control, such as a line or label control, does not need the data row, BuildFromRow() returns FinishedBuilding.

■ If a control needs only one row, BuildFromRow() sets the value of the control with SetValue(), calls OnRow(), and returns FinishedBuilding.

■ If a control is an aggregate control, it uses multiple data rows, calling SetValue() and OnRow() for each row. BuildFromRow() returns ContinueBuilding.

SetValue() Sets the control’s value. e.Report Designer Professional generates this code during the build phase of creating the report executable (.rox) file.

■ If the control needs no data rows, SetValue() does nothing.

■ If the control uses a single data row, SetValue() sets the value of the control.

■ If the control uses multiple data rows, BuildFromRow calls SetValue() to construct the aggregate control’s value().

OnRow() Override this method to specify additional processing on the control using the data row.

Finish() For an aggregate control, performs final calculations. For other controls, Finish() does nothing.

Page 61: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 39

Creating a computed fieldTypically a field’s value is the value of a field in the data source. A computed field is a field whose value is computed from an expression, often involving one or more fields in the data source. For example, if you have fields in the data source providing the type of item, the number of those items ordered and the cost per item, you could have a computed field that calculates the total cost for that type of item.

You can create a computed field using the following techniques:

■ Create the computed field as a control. Use this technique if you can use a simple expression to compute the value and only need the computed value in a single control. For more information about creating the computed field as a control, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

■ Create the computed field as part of the data source query. The query editors for some types of data sources support creating a computed field. Use this technique if a query editor for your data source supports creating computed fields, especially if you need the computed field in multiple controls or report designs. For more information about creating a computed field in a query editor, see the chapter about accessing data from your data source.

■ Create a computed data row variable and use it like a data field. Use this technique if you don’t have a query editor for your data source that supports creating a computed field and either you need more than a simple expression to compute the value or you need the computed value in a multiple controls or report designs. This section describes how to create a computed data row variable.

A computed data row variable contains a value that is the result of an expression, instead of data stored in the data source. Typically, the expression uses one or more fields in the data source. For example, you can create a data row variable for the number of days an order is late by subtracting the DueDate field’s value from the current date. The computed data row variable appears in the Field List with the data source fields. By creating this variable as a computed data row variable, a report developer can treat the variable as if it is a data source field.

To create a computed data row variable, perform the following steps in this order:

■ Create the data source component and its data row component.

■ Add a variable to the data row to store each computed value. To add a variable, choose New on the Variables page for the data row component.

■ Override the OnRead() method of the data row to compute the new values. The data adapter calls OnRead() after it has created a data row. OnRead() sets the data row values.

Page 62: Accessing Data

40 A c c e s s i n g D a t a

The following code overrides the data row’s OnRead() method to calculate values for the ExtendedCost and DaysLate variables:

Sub OnRead()Super::OnRead() 'Set the values of predefined data row valuesDim ExtendedCost As DoubleExtendedCost = Cost * QuantityDaysLate = Date() - DueDateIf DaysLate < 0 Then

DaysLate = 0End If

End Sub

The data source calls OnRead() once for each data row immediately after the row receives data from the input record. The call to the OnRead() method of the superclass is not necessary but it is a good programming technique.

Accessing other types of data sourcesYou can specify a connection component for many types of data sources such as various databases. You can also create a custom data source.

How to create a custom data source

1 Create a blank report.

1 Choose File➛New➛Blank Report.

Choose OK.

The blank report appears in the design perspective.

2 Choose File➛Save As.

Save As opens.

3 Name the file and place it in a directory.

2 Create a custom data source.

1 In Report Structure, right-click the data stream component and choose Properties.

The Properties page for the component appears.

2 Choose Class.

3 In Super Class, type

AcDataSource

3 Create any specialized variables you need for your data source.

Page 63: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 41

For example, you can create variables to identify the data source. You can also provide these variables as parameters if you want users to be able to specify their values.

4 Define the data row variables.

Create a variable for each column or field retrieved from the data source.

5 Create controls to display the data in the report.

You can choose your data row variables from Fields.

6 Override the data stream’s Start(), Fetch() and Finish() methods.

Use Actuate Basic to specify the actions needed to start using your data source, fetch individual rows, and then finish using your data source.

7 Specify whether your custom data source can handle dynamic sorting.

If your custom data source can handle queries requesting dynamic sorting, override AcDataAdapter::CanSortDynamically() to return True.

You can now run, view, and publish the report. If you will use the data source for other reports, consider publishing your custom data stream to a library.

For an example of creating a custom data source, see Chapter 5, “Accessing data in a comma-separated values (CSV) text file.” For more information about using libraries, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. For more information about CanSortDynamically(), see “Sorting data,” later in this chapter.

Sorting dataMost reports require data to be sequenced in a particular order. For example, in a sales report you can sort orders alphabetically by customer name. The customers, in turn, you can sort by city. The set of column or field names that determines sort order is called the sort key.

By default, e.Report Designer Professional builds the desired row sorting from the group sections in the report. You can supplement or override this default sorting for your report in the following ways, depending on the sorting capabilities of your data source:

■ Rely on your data source to sort the rows before delivering them to e.Report Designer Professional.

Use this technique if your query to the data source returns the data rows in the proper order. The technique for specifying the sort order for your query depends on the type of data source. For example, with a database query, you can add an ORDER BY clause to specify sorting for your query. If the data

Page 64: Accessing Data

42 A c c e s s i n g D a t a

source produces the data rows in the right sequence for your report, set the report section’s sort property to Presorted.

■ Request sorting by e.Report Designer Professional after the rows are retrieved from the data source.

You can use the sort filter, AcDataSorter, to sort data from custom data sources that cannot perform sorting. Do not use this technique for databases and other data sources that can perform dynamic sorting. Typically data sources are very efficient at sorting.

If you do need internal sorting, specify the desired sorting criteria within the sort filter. The sort filter sorts data using the virtual memory management services of the Actuate iServer System. Sort performance depends on the memory available to store the file in memory. Internal sorting for files that contain more than 10,000 records can adversely affect report generation performance.

■ Use the data source’s sorting capability, if available.

When developing a report, if you don’t know if the data source can perform dynamic sorting, then let the report section’s sort property use the default value AutoSort. If the sort property is set to AutoSort, the Factory calls the method CanSortDynamically to determine whether the data source can sort itself. If it can sort itself, database utilities sort the data source. Otherwise, e.Report Designer Professional instantiates a Memory Data Sorter filter to sort the data internally. For information about CanSortDynamically, see Programming with Actuate Foundation Classes.

Specifying the desired sort order for sorting within the data sourceFor custom data sources, to specify a sort order, you change the data stream component’s methods, as described in “Accessing other types of data sources,” earlier in this chapter.

For other data sources, you can specify how you want your data source to sort values in several ways, listed in order of precedence:

■ Group section’s sort key

The dominant sort criteria is provided by a group section’s sort key, if any. Each group section contains a sort key that e.Report Designer Professional uses to create the ORDER BY clause for the section’s query. For information about setting group section sort keys, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. For information about overriding the automatic sorting provided by group sections, see “Avoiding sorting by the group section sort key,” later in this chapter.

■ OrderBy property of the section component

Page 65: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 43

You can provide additional sorting instructions through the OrderBy property of the section component. If you also have group sections with sort keys, the sort keys are prepended in order before the code you put as the value of the OrderBy property. Thus the value you use for the OrderBy clause specifies the sorting of rows within the innermost group of your report.

Using the OrderBy property does not require modification of the query. Thus it can be used even for read-only queries from a library and queries specified in methods. You can also use it for data streams that do not contain a query, such as a stored procedure or a flat file.

If you specify a sort order using the report wizard or Sorting and Grouping—Sorting, e.Report Designer Professional handles the sorting by modifying the OrderBy property. You also can specify the OrderBy property directly. For more information about using the OrderBy property to sort data, see “Specifying the desired sort order using the OrderBy property,” later in this chapter.

■ Sorting criteria in the query

If you use a query to access your data source, you can change the query to specify that the data source sort the data before sending it to e.Report Designer Professional. The procedures for specifying sorting in a query depend on the type of data source. For more information about specifying sorting in the query, see the chapter about that type of data source.

Avoiding sorting by the group section sort keyGroup sections contain a sort key. e.Report Designer Professional adds this sort key to the ORDER BY clause for queries. Typically you do not override this functionality.

If you do not want the sort key added to your ORDER BY clause, you can specify that the data is presorted. Use this functionality when:

■ The query from a read-only library requires no modification.

■ The query performs specialized sorting, which e.Report Designer Professional should not modify.

You can also modify the default behavior of how group sections sort keys by modifying the query sent to the data source. For information about changing the query sent to the data source, see the appropriate chapter for that data source:

■ Chapter 7, “Creating a database or ODBC query.”

■ Chapter 12, “Accessing SAP BW data.”

■ Chapter 13, “Accessing SAP R/3 data.”

■ Chapter 14, “Accessing an Actuate Information Object.”

Page 66: Accessing Data

44 A c c e s s i n g D a t a

How to use presorted data

1 Right-click the report section component in Report Structure and choose Properties.

The Properties page for the component appears.

2 Choose Advanced properties.

The Properties page displays the advanced properties.

3 For the Sorting property, select Presorted from the drop-down list, as shown in Figure 3-9.

Figure 3-9 Selecting the type of sorting

Specifying the desired sort order using the OrderBy propertyYou can sort data with the OrderBy property.

Sorting data with the OrderBy property does not change the ORDER BY clause of the SQL SELECT statement, if any. e.Report Designer Professional uses the value of the OrderBy property to the specify the sorting of rows within the innermost group produced by the ORDER BY clause.

Use the OrderBy property when:

■ The query is from a library, so e.Report Designer Professional cannot modify it.

■ The query is defined as text in a method, so e.Report Designer Professional cannot modify it.

■ The report design uses a data stream that is not a query, for example a flat file or a stored procedure.

If you specify a sort order using the report wizard or Sorting and Grouping—Sorting, e.Report Designer Professional modifies the OrderBy property accordingly. For more information about sorting and grouping data in a report design, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to sort data using the OrderBy property

1 Right-click the report section component in Report Structure and choose Properties.

Page 67: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 45

The Properties page for the component appears.

2 Choose All properties.

The Properties page displays all properties for the component.

3 In OrderBy property, type a column name or a list of column names separated by commas. Alternatively, select a column from the drop-down list, as shown in Figure 3-10.

Figure 3-10 Selecting a column to sort

Specifying the desired sort order for sorting internallyThis section describes how to specify sorting when you must sort the rows within e.Report Designer Professional. You create a data filter that sorts data rows by overriding a method. Use the technique described in this section only when sorting within the data source is not feasible. For more information about sorting within the data source, see “Specifying the desired sort order for sorting within the data source,” earlier in this chapter.

How to create a sort filter

1 If your report design already has a data source, move it to Scratch Pad.

2 Place a data adapter in DataStream.

3 Select Disk-based Data Row Sorter from the list of data adapters that appears.

4 Move the data source from Scratch Pad to the Input slot of the filter, as shown in Figure 3-11. The data source becomes the input source for the filter. The filter is the data adapter that provides a report section with data rows.

Figure 3-11 A data source component in the input slot of the filter

5 Override the filter’s Compare() method to specify how to sort the rows. Compare() takes two rows as arguments and returns one of the following values:

Page 68: Accessing Data

46 A c c e s s i n g D a t a

■ A positive number if the first row goes after the second row

■ 0 if both rows are the same

■ A negative number if the first row goes before the second row

Call the CompareKeys() method to compare field values. CompareKeys() performs data type-independent comparisons. For a descending sort order, negate the value CompareKeys() returns.

In the following example, Compare() compares rows by their state and customer ID:

Function Compare( row1 As AcDataRow, row2 As AcDataRow ) As Integer

Dim cust1 As AcCustomerRowDim cust2 As AcCustomerRow

Set cust1 = row1Set cust2 = row2

' Compare the state. CompareKeys() is a predefined methodCompare = CompareKeys( cust1.State, cust2.State )If Compare <> 0 Then

Exit FunctionEnd If

' Compare the customer id. Compare two integers bysubtracting them

Compare = cust1.ID - cust2.IDEnd Function

Filtering dataIf possible, limit the data returned from your data source by providing filter conditions to the data source. You can use a query, stored procedure code, and other techniques, depending on the type of data source. If limiting data returned from the data source is not feasible, there are two techniques to conditionally filter out a row from a set of input records received by e.Report Designer Professional.

■ Exclude rows by customizing your data source component.

■ Exclude rows by creating a data filter component.

If you encapsulate the filter code in a data filter, you can use the data filter in other data streams. If you publish the filter to a library, you can use the same filter in other report designs.

Page 69: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 47

How to exclude rows by customizing your data source

1 Create the data source component.

2 If desired, create one or more parameters for users to specify values that the columns in the rows must match.

3 Override the data source’s Fetch() method to specify which rows to retrieve.

In the following example, the Fetch() method of the data source calls Fetch() for the base class to get each row. As each row returns, Fetch() verifies that the State column contains the correct value. If it the value is correct, Fetch returns the row. This process repeats until Fetch() retrieves all rows:

Function Fetch() As AcDataRowDim row As CustomerRowDo

Set row = Super::Fetch()If row Is Nothing Then

Exit FunctionEnd if' Test state against value entered by userLoop until row.State = StateParam Set Fetch = row

End Function

How to exclude rows by creating a select data filter

1 If your report design already has a data source, move the data source to Scratch Pad.

2 Drag a data filter component from Toolbox—Data and drop it in DataStream, as shown in Figure 3-12.

Figure 3-12 Adding a data filter

Select Component appears.

3 Select Single Input Filter from the list.

4 Move the data source from Scratch Pad to the Input slot of the filter. The data source becomes the input source for the filter, as shown in Figure 3-13.

Page 70: Accessing Data

48 A c c e s s i n g D a t a

The filter is the data adapter that provides the report section with data rows.

Figure 3-13 A data source in the input slot of the filter

5 Override the filter’s Fetch() method to specify which rows to retrieve.

In the following example, the data filter’s Fetch() method calls the input source’s Fetch() method to retrieve the row. The InputAdapter variable stores a reference to the input source. As each row returns, Fetch() verifies that the State column contains the requested value. If the value is present, Fetch() returns the row. This process repeats until Fetch() retrieves all rows:

Function Fetch() As AcDataRowDim row As DataRow

DoSet row = InputAdapter.Fetch()If row Is Nothing Then

Exit FunctionEnd if

Loop until row.State = "CA"Set Fetch = row

End Function

Working with data from multiple sourcesIf you need to combine data from multiple data sources to create data rows for a single report section, use a multiple input filter or an Actuate information object.

If you purchase the Actuate Data Integration Option and Information Object Designer, you can create an information object that combines the input from each source. Then, in e.Report Designer Professional you can access the information object as a single data source. For information about accessing information objects, see Chapter 14, “Accessing an Actuate Information Object.”

You also can combine input from multiple rows using filters. For general information about data filters, see “Using data filters to process rows,” earlier in this chapter. To retrieve data from multiple sources, use AcMultipleInputFilter and override its methods to indicate how to retrieve and process the data. AcMultipleInputFilter accepts input from any number of data adapters, processes

Page 71: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 49

the data, and passes it to the next data adapter or to the report. To pass any rows from the source data adapters to the report section, you must override the Fetch() method of the multiple input filter.

There are two ways to customize AcMultipleInputFilter to process data from two or more input adapters:

■ Creating a merge filter to combine the rows of the data sources

A merge filter combines the data rows from two or more input adapters to produce output data rows that can include columns from each input adapter.

■ Creating a union filter to process the data sources sequentially

A union filter processes all the data rows from one input adapter before processing data rows from the next input adapter.

You can use the multiple input filter as the input data source of a sort filter. This technique supports sorting the combined set of data rows.

How to create a multiple input filter

1 Remove the data stream component from the report, if one exists.

2 Drag a data filter component from Toolbox—Data and drop it in DataStream, as shown in Figure 3-14.

Figure 3-14 Adding a data filter

Select Component appears.

3 Select Multiple-Input Filter. Choose OK.

4 Place a data source into the Input slot of the multiple-input filter.

5 Place another data source into the multiple-input filter.

The new data source appears as a second Input slot for MultipleInputFilter. Add additional data sources as needed. The multiple-input filter gets its data from the data sources you added.

6 Override the multiple-input filter’s methods to code a union or merge filter algorithm.

Page 72: Accessing Data

50 A c c e s s i n g D a t a

Creating a merge filter to combine the rows of the data sourcesUse a merge filter to extract and handle rows from each data source before moving to the next row. You can combine the columns from the input data rows to make a merged output row. You can merge data from multiple data sources or from separate queries to a single data source. This technique emulates a query that the data source cannot support. For example, you can use this technique to emulate joining two tables even if the data source does not have a required relationship to join the tables.

For example, consider how to design a report in which data from two tables must appear in each row. Rows in the report design appear in the following two columns:

■ Customers provides customer IDs and names.

■ Orders provides order IDs, ship dates, item codes, item price, quantity, and extended price.

To get data from these two tables, the report uses two SQL query data sources. A multiple-input filter creates a new data row by merging the data rows retrieved by each data source.

Figure 3-15 shows the report design.

Figure 3-15 Report design with a multiple-input filter

Figure 3-16 shows a portion of report generated from the design described in the preceding example. Each row contains:

■ Customer number and name from CustomerDataSource

■ Order number, Ship Date, Item Code, Price, Quantity, and Extended Price from OrderDataSource.

This filter accepts input from two data sources (input adapters)

The filter creates a new data row that merges data from the two input adapters

This data source is the second input adapter that gets and sends order data to the filter

This data source is the first input adapter that gets and sends customer data to the filter

Page 73: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 51

Figure 3-16 Generated report with columns from each data source

How to merge rows from several data sources

1 Create a multiple-input filter component and several data sources, as specified in steps 1 to 5 of “How to create a multiple input filter,” earlier in this chapter.

2 Drag a data row component to the data row slot of the multiple-input filter. Creating the data row also creates a read-only variable for the row number.

3 Define public instance variables for each field from the data sources.

1 Right-click the data row component for the filter component and choose Properties.

Properties—Properties for the component appears.

2 Choose Variables.

Properties—Variables for the component appears.

3 Choose New Variable.

Class Variable appears.

4 Type the name of the variable. Typically this is the same name as the data field name.

5 Select the data type of the variable from the drop-down list. Use the Actuate Basic data type that maps to the data source data type.

6 Choose OK.

7 Repeat steps 3 to 6 for the other data source fields.

OrderDataSourceCustomerDataSource

Page 74: Accessing Data

52 A c c e s s i n g D a t a

Figure 3-17 shows the variables for this example.

Figure 3-17 Variables for each field

4 Override the filter’s Start() method to create a input adapter for each data source and get a row from the first data source:

Function Start( ) As BooleanStart = Super::Start( )Set CustomerQuery = InputAdapters.GetAt( 1 )Set OrderQuery = InputAdapters.GetAt( 2 )Set CustomerInRow = CustomerQuery.Fetch( )

End Function

5 Override the filter’s Fetch() method to retrieve one row of data from the second input adapter that matches the row from the first input adapter, create a new data row with the merged data, and pass the data row to the report. This process continues until there are no more rows to retrieve:

Function Fetch( ) As AcDataRowDim OutRow As CustomerOrderDataRowDim OrderInRow As OrderDataRow

If CustomerInRow Is Nothing ThenExit Sub

End IfSet OrderInRow = OrderQuery.Fetch( )If OrderInRow Is Nothing Then

Exit SubEnd If ' Loop until we find a matching pair of rows. While (CustomerInRow.customers_custId <>

OrderInRow.orders_custId)While (CustomerInRow.customers_custId <

OrderInRow.orders_custId) ' Advance through Customers. Set CustomerInRow = CustomerQuery.Fetch( ) If CustomerInRow Is Nothing Then

Exit Sub End If

Page 75: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 53

While (OrderInRow.orders_custId < CustomerInRow.customers_custId)

' Advance through Orders. Set OrderInRow = OrderQuery.Fetch( ) If OrderInRow Is Nothing Then

Exit Sub End If

Wend Wend

' If we get here, we found a matching pair of rows. ' Create and populate a new output row. Set OutRow = New CustomerOrderDataRow OutRow.CustId = CustomerInRow.customers_custId OutRow.CustomName = CustomerInRow.customers_customName OutRow.OrderId = OrderInRow.orders_orderID OutRow.ForecastShipDate =

OrderInRow.orders_forecastShipDate OutRow.ItemCode = OrderInRow.items_itemcode OutRow.Quantity = OrderInRow.items_quantity OutRow.Price = OrderInRow.items_pricequote OutRow.ExtPrice = OrderInRow.extprice

' Process the output row. AddRow( OutRow )

' Return the output row. Set Fetch = OutRow

End Function

Creating a union filter to process the data sources sequentiallyA union filter processes all rows in a data source before moving to the next data source in the filter. For example, in the report design shown in Figure 3-18, the multiple-input filter processes all the data from the first data source, then all data from the second data source.

Figure 3-18 Report Structure that includes a union filter

This data source is the first input adapter that gets and sends historical order data to the filter

This data source is the second input adapter that gets and sends live order data to the filter

This filter accepts input from two data sources (input adapters)

Page 76: Accessing Data

54 A c c e s s i n g D a t a

Figure 3-19 shows part of the generated report. The report displays all the data from the first data source, then all data from the second source.

Figure 3-19 Report output showing the data from one input source followed by the data from the second input source

How to access multiple data sources sequentially

1 Create a multiple-input filter component and several data sources, as specified in steps 1 to 5 of “How to create a multiple input filter,” earlier in this chapter.

2 Drag a data row component to the data row slot of the multiple-input filter. Creating the data row also creates a read-only variable for the row number.

3 Define public instance variables for each field from the data sources.

1 Right-click the data row component for the filter component and choose Properties.

Properties—Properties for the component appears.

2 Choose Variables.

Properties—Variables for the component appears.

3 Choose New Variable.

Class Variable appears.

4 Type the name of the variable. Typically this is the same name as the data field name.

5 Select the data type of the variable from the drop-down list. Choose the Actuate Basic data type that maps to the data source data type.

6 Choose OK.

7 Repeat steps 3 to 6 for the other data source fields.

Figure 3-20 shows the variables for this example.

Historical order data

Live order data

Page 77: Accessing Data

C h a p t e r 3 , M o d i f y i n g d a t a p r o c e s s i n g 55

Figure 3-20 Variables for each field

4 Override the filter’s Start() method to create an input adapter for each data source and get a row from the first data source.

Function Start( ) As BooleanStart = Super::Start( )Set HistoricalQuery = InputAdapters.GetAt( 1 )Set LiveQuery = InputAdapters.GetAt( 2 )Set HistoricalInRow = HistoricalQuery.Fetch( )

End Function

5 Override the filter’s Fetch() method to retrieve each row of data from the first input adapter and pass it to the report. When the first input adapter retrieves all rows, retrieve rows from the second input adapter.

Function Fetch( ) As AcDataRowDim OutRow As OrderDataRowDim LiveInRow As LiveDataRow

' Assumption:' All live data is newer than all historical dataIf HistoricalInRow Is Nothing Then

Set LiveInRow = LiveQuery.Fetch( )If LiveInRow Is Nothing Then

Exit Sub

Else' Assign output row with live row valuesSet OutRow = New OrderDataRowOutRow.OrderId = LiveInRow.orders_orderIDOutRow.ForecastShipDate =

LiveInRow.orders_forecastShipDateOutRow.ItemCode = LiveInRow.items_itemcodeOutRow.Quantity = LiveInRow.items_quantityOutRow.Price = LiveInRow.items_pricequoteOutRow.ExtPrice = LiveInRow.extprice

End If

Page 78: Accessing Data

56 A c c e s s i n g D a t a

Else' Assign output row with historical row valuesSet OutRow = New OrderDataRow

OutRow.OrderId = HistoricalInRow.orders_orderIDOutRow.ForecastShipDate =

HistoricalInRow.orders_forecastShipDateOutRow.ItemCode = HistoricalInRow.items_itemcodeOutRow.Quantity = HistoricalInRow.items_quantityOutRow.Price = HistoricalInRow.items_pricequoteOutRow.ExtPrice = HistoricalInRow.items_extprice' Get the next rowSet HistoricalInRow = HistoricalQuery.Fetch( )

End If

' Process the output row.AddRow( OutRow )

' Return the output row.Set Fetch = OutRow

End Function

Page 79: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 57

C h a p t e r

4Chapter 4Displaying data rows

This chapter contains the following topics:

■ About displaying data rows

■ Modifying an ROD file to display data rows

■ Specifying the columns to display data rows

■ Modifying font attributes for displaying data rows

Page 80: Accessing Data

58 A c c e s s i n g D a t a

About displaying data rowsYou can view the data rows in your report section in a simple format, even if you have not designed a report layout. Using this capability, you can see the data that your report receives from the data source without any formatting. The procedure for displaying data rows depends on the type of data source:

■ Database or ODBC queries

If you are using a graphical database or ODBC query, see “Previewing the rows that a database or ODBC query returns” in Chapter 7, “Creating a database or ODBC query.”

■ Information object

If you are using an information object as your data source, see “Displaying information object query output” in Chapter 14, “Accessing an Actuate Information Object.”

■ All other data sources

This chapter discusses the procedures for displaying data rows from all other data sources that e.Report Designer Professional supports.

Using this technique, you can examine the data that is returned from your data source or constructed programmatically. For more information about data rows, see Chapter 1, “Accessing a data source.”

e.Report Designer Professional displays the data rows in columns and rows. This format provides a single row of output for each data row. Any sorting and grouping that is defined in the ROD does not affect the data rows in this display format. By default, the labels for the columns show the table name and column name from the data source. e.Report Designer Professional truncates the table name and column name if the total length exceeds the length of the data row variable. Figure 4-1 shows the default data row display format.

Figure 4-1 Default data row display format

Page 81: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 59

You display data rows by creating a report object design (.rod) file in which the ReportType property setting is InformationObject. When you choose Build and Run, e.Report Designer Professional creates a data object executable (.dox) file. This file is like a report object executable (.rox) file, except that it contains data without formatting.

To display data rows:

1 Create or open the ROD file that contains the data row component to display.

You can use an existing report design or create a new one that accesses your data source or programmatically generates data rows. If you create a new report, you must specify the data source component, but creating a report layout is not necessary. For more information about accessing data sources, see Chapter 1, “Accessing a data source.”

2 Modify the ROD file to display data rows.

To display data rows, you modify an ROD file to set its ReportType property to InformationObject. For more information about setting the ReportType property value, see “Modifying an ROD file to display data rows,” later in this chapter.

3 Determine which columns to include and their order.

For more information about adding, deleting and modifying the columns in data rows, see “Specifying the columns to display data rows,” later in this chapter.

4 Modify the font attributes, if necessary.

For more information about specifying the font attributes, see “Modifying font attributes for displaying data rows,” later in this chapter.

5 Build and run the report object design (.rod) file to generate a data object executable (.dox) file. If Requester appears, make your selections and choose OK.

e.Report Designer Professional displays the data rows. Use the scroll bars, if necessary, to see all data row variables and all data rows.

Modifying an ROD file to display data rowsTo display data rows, set the ReportType property of the Report component to InformationObject. You can create a new report with this property value or modify an existing report to have this value. All report formatting, grouping, and sorting information is preserved in the ROD even though it is not used to display data rows. To later generate and display formatted report output, set the ReportType property to FormattedReport. For information about the effect of

Page 82: Accessing Data

60 A c c e s s i n g D a t a

setting the ReportType property to ActuateQueryTemplate, see Chapter 14, “Accessing an Actuate Information Object.”

The first section component must be a report section. Displaying data rows uses the data source that is in the first report section’s DataStream slot. If the ROD contains additional nested report sections, the information about the additional report sections remains in the ROD, but e.Report Designer Professional ignores them. If you later set the ReportType property to FormattedReport, the generated report object instance (.roi) file contains all report sections.

If the first section is a conditional section, group section, parallel section, or sequential section, you must remove the first section from the report design before you can display data rows. You can only display data rows from a report section. You can also use this method to view a report section that is nested within another report section. You can use Scratch Pad to save the original component. For more information about Scratch Pad, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to display data rows for an existing ROD when the first section component is a report section component

1 In Report Structure, select the report component.

Choose View➛Properties.

The Properties page for the component appears.

2 In ReportType, select InformationObject from the drop-down list, as shown in Figure 4-2.

Figure 4-2 Selecting InformationObject

3 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

e.Report Designer Professional generates the data object executable file, runs it, and displays the data rows in <Filename>—Report Viewer.

How to display data rows when you need to display a section component that is not the first one in an ROD

1 Choose View➛Scratch Pad.

Scratch Pad appears, as shown in Figure 4-3.

Figure 4-3 Scratch Pad

Page 83: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 61

2 Replace the first section component with a report section component.

1 Drag the first section component from Report Structure and drop it in Scratch Pad, as shown in Figure 4-4.

Figure 4-4 Moving the first section component

2 In Scratch Pad, expand the section component until you see the report section for which you want to display data rows.

3 Drag the report section from Scratch Pad and drop it in the report component, as shown in Figure 4-5.

Figure 4-5 Moving the desired report section

Report Structure looks like the one in the Figure 4-6.

Figure 4-6 Report Structure with the desired report section as the first section component

3 Choose View➛Properties.

The Properties page for the component appears.

4 In ReportType, select InformationObject from the drop-down list, as shown in Figure 4-7.

Figure 4-7 Selecting InformationObject

5 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

Page 84: Accessing Data

62 A c c e s s i n g D a t a

6 If desired, replace the report section component with the original section component.

1 Drag the report section component from Report Structure and drop it in Scratch Pad to return it to its original place within the section component, as shown in Figure 4-8.

Figure 4-8 Returning the report section component

2 Drag the original section from Scratch Pad and drop it in the first Content slot in the report component, as shown in Figure 4-9.

Figure 4-9 Returning the original section

Specifying the columns to display data rowsEach data row consists of a set of variables that contain the data from the data source. You can modify the data source variables in the data rows. You can add or delete computed data row variables. You also can change the order of the data row variables. For a definition of data rows, see Chapter 1, “Accessing a data source.” For more information about processing data rows, see Chapter 3, “Modifying data processing.”

Changes that you make to the data row variables affect how the data rows appear when you display data rows. If you add or delete the data row variables, these changes affect the fields that are available to the report and their properties. Modifying the data row variables changes the default attributes of the fields. These changes also show when you display data rows. When you display data rows, e.Report Designer Professional displays each data row variable as a column. Changing the order of the data row variables changes the order of the corresponding columns when you display data rows. The data row variable’s attributes control the column label and the column length for that variable.

Page 85: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 63

Changing the order of columnsFor any ROD, you can use Data Row Editor to display the data row component for a report object design (.rod) file.

In Figure 4-10, Data Row Editor displays the available data row variables for an ROD.

Figure 4-10 Available data row variables

If the ReportType property is InformationObject, you can also use Data Row Editor to change the order in which data row variables appear as columns when you display the data rows. The default behavior displays data source table names and column names in alphabetical order.

How to change the order in which columns appear when e.Report Designer Professional displays data rows

e.Report Designer Professional displays data row variables as columns in the order in which they appear, from top to bottom, in Data Row Editor.

1 Expand the DataStream component, as shown in Figure 4-11.

Figure 4-11 The DataStream component

2 Right-click the DataRow component and choose Data Row Editor.

Data Row Editor displays the available data row variables, as shown in Figure 4-12.

Page 86: Accessing Data

64 A c c e s s i n g D a t a

Figure 4-12 Available data rows

3 Select a data row variable, then use the up and down arrows to reorder the variable. Figure 4-13 shows the Data Row Editor after you move customers_address to the third position and customers_city to the fourth position.

Figure 4-13 Reordered data row variables

4 Choose Close.

5 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

e.Report Designer Professional generates the data object executable file, runs it, and displays the data rows in <Filename>—Report Viewer.

Figure 4-14 shows the columns, reordered as specified in Data Row Editor.

Page 87: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 65

Figure 4-14 Report Viewer, showing the reordered columns

Modifying, adding, and deleting columnsYou can use Column Editor to modify a data row variable or add a computed data row variable to the data row component. Data row variables that you add using Column Editor appear in Data Row Editor. e.Report Designer Professional also displays the new data row variables as columns when it displays the data rows.

In Column Editor, you also can modify some attributes of existing variables. The attributes you can modify vary depending on whether the column is a computed field. Figure 4-15 shows Column Editor displaying the attributes for a data row variable.

Figure 4-15 Attributes for a data row variable

Variables that you add to the data row component using Column Editor also appear in Data Row Editor. You can use Data Row Editor to delete a variable you

Page 88: Accessing Data

66 A c c e s s i n g D a t a

add using Column Editor. Table 4-1 describes the column attributes that can appear in Column Editor.

Table 4-1 Column Attributes

Column attribute Description Action

Variable name

Name of data row variable. Editable for computed data row variables.

Display name

Optional column heading that appears instead of the default heading when displaying data rows.

Editable. Column Editor does not support using the following characters in Display name:

\ / : ? "

Table.col Name of the column in the data source. This value only appears if e.Report Designer Professional retrieves the value from the data source.

Not editable.

Data type Actuate Basic data type of the data row variable. For computed data row variables, there is no default data type. For other data row variables, e.Report Designer Professional sets the data type.

Editable if the data row variable is computed or if the original data source data type has more than one potential mapping to Actuate Basic data types. Changing the data type affects the control type for all controls that use the data row variable.

Native data type

Data type that is specified in a data source.

e.Report Designer Professional maps the native data type to an Actuate Basic data type. For example, a Double in a data source can map to Actuate Basic data type Double, Integer, Currency, or String.

Format Data format. Editable. For example, to display a date as the day of the week, month, day, and four-digit year, select Long Date from the drop-down list.

Width Column display width in number of characters. e.Report Designer Professional uses this value and the font size to calculate the column width.

If the columns appear too large or too small, adjust this value. If you set this attribute value too low, the column truncates characters.

Column can be used as custom filter

This attribute is not used in displaying data rows. For information about the historical use of this field, see the Actuate support web site.

None.

Page 89: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 67

For more information about Actuate Basic expressions, see Programming with Actuate Basic.

How to modify a column

1 Expand the DataStream slot, as shown in Figure 4-16.

Figure 4-16 The DataStream slot

2 Right-click the DataRow component and choose Data Row Editor.

Data Row Editor appears, displaying the available columns.

3 Select a column, as shown in Figure 4-17.

Figure 4-17 Selecting a column

Expression Actuate Basic expression for a computed data row variable.

Type an expression that applies to a row. For example, you can type the following Actuate Basic expression:

[items_quantity] * 2

This field does not support aggregate expressions, such as:

Sum( [items_quantity] )

e.Analysis option

This attribute is not used in displaying data rows. For information about the historical use of this field, see the Actuate support web site.

None.

Table 4-1 Column Attributes (continued)

Column attribute Description Action

Page 90: Accessing Data

68 A c c e s s i n g D a t a

4 Choose Modify. Column Editor appears. For the customers_contact_first column that appears in Figure 4-18, the Variable name, Table.col, Data type, Native Data Type, and Expression fields are not editable.

Figure 4-18 Column Editor, showing attributes for a column

5 Modify the available fields and options as desired. Figure 4-19 shows the display name and width properties that are modified for the customers_contact_first column.

Figure 4-19 Modifying the display name and width properties

Page 91: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 69

6 Choose OK. Data Row Editor appears as shown in Figure 4-20, showing the new display name and width for the customers_contact_first variable.

Figure 4-20 Data Row Editor, showing a new display name and width for the variable

7 Repeat steps 3 through 5 for each column that you want to modify. Figure 4-21 shows the display name and length modified for multiple data row variables.

Figure 4-21 Data Row Editor, showing modified display name and lengths

8 Choose Close.

9 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

e.Report Designer Professional generates the data object executable file, runs it, and displays the data rows in <Filename>—Report Viewer.

Figure 4-22 shows the effect of changing the display names and widths of several columns.

Page 92: Accessing Data

70 A c c e s s i n g D a t a

Figure 4-22 Report Viewer, showing the new display names and widths

How to add a column to a data row component

1 Expand the DataStream component.

2 Right-click the DataRow component and choose Data Row Editor.

Available columns appear in Data Row Editor, as shown in Figure 4-23.

Figure 4-23 The available columns

3 Choose Add.

4 On Column Editor, provide values for the available fields and select options.

Figure 4-24 shows an example of specifying a variable.

Choose OK.

The column appears in Data Row Editor. By default, the new variable is added to the bottom of the list, as shown in Figure 4-25.

5 Repeat steps 3 and 4 for any additional columns that you want to add.

6 Choose Close.

Page 93: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 71

Figure 4-24 Setting attributes for a variable

Figure 4-25 Data Row Editor, showing the new variable

7 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

e.Report Designer Professional generates the data object executable file, runs it, and displays the data rows in <Filename>—Report Viewer. Figure 4-26 shows the additional data row variable.

The new data row variable appears to the right of all existing data row variables. You can reorder the data row variables, as described in “Changing the order of columns,” earlier in this chapter.

Page 94: Accessing Data

72 A c c e s s i n g D a t a

Figure 4-26 Report Viewer, showing the new variable

How to delete a column

You can delete columns that you added to the data row.

1 Expand the DataStream component.

2 Right-click the DataRow component and choose Data Row Editor.

Data Row Editor displays the available columns, as shown in Figure 4-27.

Figure 4-27 The available columns

3 To delete a column, select the column. If the column can be deleted, the Delete button is enabled, as shown in Figure 4-28.

Choose Delete.

The column is deleted from Data Row Editor.

4 Choose Close.

5 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

Page 95: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 73

e.Report Designer Professional generates the data object executable file, runs it, and displays the data rows in <Filename>—Report Viewer. The displayed data row does not include the deleted column.

Figure 4-28 Data Row Editor, with the Delete button enabled for the selected column

Modifying font attributes for displaying data rowsIn a report object design (.rod) file in which the ReportType property setting is InformationObject, the formatting options are limited. To modify these fonts, you set property values in the Properties page for the report component. You can modify the settings of the font properties that appear in Table 4-2.

How to change the font properties for data rows

1 In Report Structure, right-click the report component and choose Properties.

The Properties page for the component appears.

2 Choose Expert Properties.

Properties displays the advanced properties for the report component.

Table 4-2 Font properties

Font property Text affected

DataFont Data that is retrieved from the data source

LabelFont Display names for columns

PageDecorationFont Page number and date in the footer

TitleFont Title for displaying data rows

Page 96: Accessing Data

74 A c c e s s i n g D a t a

3 Expand Auto Contents, as shown in Figure 4-29.

Figure 4-29 Auto Contents group of attributes

4 In the Auto Contents group, to set font properties, expand one of the following groups:

■ DataFont

■ LabelFont

■ PageDecorationFont

■ TitleFont

Figure 4-30 shows the expanded LabelFont group.

Figure 4-30 LabelFont group of attributes

5 Set the font attribute values.

6 Choose Report➛Build and Run. If Requester appears, make your selections and choose OK.

e.Report Designer Professional generates the data object executable file, runs it, and displays the data rows in <Filename>—Report Viewer. Figure 4-31 shows the result of setting Bold to True.

Page 97: Accessing Data

C h a p t e r 4 , D i s p l a y i n g d a t a r o w s 75

Figure 4-31 Report Viewer, showing the labels in bold font

Page 98: Accessing Data

76 A c c e s s i n g D a t a

Page 99: Accessing Data

C h a p t e r 5 , A c c e s s i n g d a t a i n a c o m m a - s e p a r a t e d v a l u e s ( C S V ) t e x t f i l e 77

C h a p t e r

5Chapter 5Accessing data in a

comma-separated values(CSV) text file

This chapter contains the following topics:

■ Accessing data from a CSV text file

■ Creating a custom data source

■ Creating variables to identify which text file to use

■ Defining data row variables

■ Displaying text file data in a report design

■ Specifying processing of the data

■ Running and viewing the report

Page 100: Accessing Data

78 A c c e s s i n g D a t a

Accessing data from a CSV text fileThis chapter describes how to access CSV data from a text file. The CSV text file also can have commas embedded in a data value if the data value is enclosed by double quotes in the text file.

To retrieve CSV data from a text file, complete the following tasks in this order:

■ Create a custom data source.

For information about creating a custom data source, see “Creating a custom data source,” later in this chapter.

■ Create variables to identify which text file to use.

For information about creating variables to identify a text file, see “Creating variables to identify which text file to use,” later in this chapter.

■ Define data row variables for the fields in the data.

For information about defining data row variables, see “Defining data row variables,” later in this chapter.

■ Set up display of the data in your report design.

For information about displaying the data in your report design, see “Displaying text file data in a report design,” later in this chapter.

■ Specify how to process the data.

For information about specifying how to process the data, see “Specifying processing of the data,” later in this chapter.

To see the results of running the report design that accesses CSV data, see “Running and viewing the report,” later in this chapter.

For more information about data component terms and relationships, see “About data access terms and relationships” in Chapter 1, “Accessing a data source.” For more information about data streams, data source components, and data row components, see “About data adapters, data source components and data filters” in Chapter 3, “Modifying data processing.” For more information about subclassing and modifying components, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Creating a custom data sourceCreate the custom data source by changing the superclass of the data stream to AcDataSource from the Actuate Foundation Classes library. For more information about AFC classes, see Programming with Actuate Foundation Classes.

Page 101: Accessing Data

C h a p t e r 5 , A c c e s s i n g d a t a i n a c o m m a - s e p a r a t e d v a l u e s ( C S V ) t e x t f i l e 79

How to create a custom data source

1 In Report Structure, right-click the DataStream component, and choose Properties.

2 Choose Class.

3 On Class, in Super class, as shown in Figure 5-1, type

AcDataSource

Figure 5-1 Creating a custom data source

Creating variables to identify which text file to usee.Report Designer Professional requires the following information to connect to a text file:

■ The file number that the operating system uses to identify the text file

■ The name of the text file

To provide the data stream with this information, create variables to hold these values.

How to define a custom data source for your text file

In this example, the channel variable holds the file number and the DataInputFile variable holds the file name.

1 In Report Structure, select DataStream—DataSource.

2 In Properties, choose Variables.

3 Choose New.

4 On Class Variable , define Channel as shown in Figure 5-2, using the following values, then choose OK.

■ Name: Channel

■ Type: Integer

Page 102: Accessing Data

80 A c c e s s i n g D a t a

■ Storage: Instance

■ Visibility: Public

Figure 5-2 Creating the Channel variable

5 On Class Variable, repeat steps 1 through 4, using the following values, to define DataInputFile then choose OK.

■ Name: DataInputFile

■ Type: String

■ Storage: Static

Selecting Static ensures that the variable is available to the entire report.

■ Visibility: Parameter

You define DataInputFile as a parameter so users can enter a file name when they run the report.

6 In Variables, select DataInputFile. Choose Ellipsis.

7 On Parameter Properties, set the default value for DataInputFile to the full path name of your text file. For example, type

C:\TextFile.txt

8 Select Required. Selecting Required ensures that the user must supply a value for DataInputFile.

Parameter Properties appears as shown in Figure 5-3.

Page 103: Accessing Data

C h a p t e r 5 , A c c e s s i n g d a t a i n a c o m m a - s e p a r a t e d v a l u e s ( C S V ) t e x t f i l e 81

Figure 5-3 Parameter Properties

Choose OK.

Defining data row variablesFor many types of data sources, e.Report Designer Professional defines variables for the data row automatically. For a CSV text file, you must define data row variables that correspond to the columns in your text file.

How to define data row variables for your text file

1 In Report Structure, expand DataStream—DataSource, and select DataRow.

The Properties page for the component appears.

2 Choose Variables.

3 Choose New.

Class Variable appears.

4 Specify the name and type of one of the fields in your text file. This variable’s data type must correspond exactly to a field in the text file. Set Storage to Instance and Visibility to Public, as shown in Figure 5-4.

Page 104: Accessing Data

82 A c c e s s i n g D a t a

Figure 5-4 Creating the FirstField variable

Choose OK.

5 Repeat steps 1 through 4 for the other fields in your text file.

Figure 5-5 shows the settings for a text file that contains two string fields, FirstField and SecondField, and an integer field, Figures.

Figure 5-5 Variables for a text file that contains three fields

6 Choose View➛Fields.

Fields appears as shown in Figure 5-6, displaying the variables that you defined.

Figure 5-6 Fields, displaying the variables

Page 105: Accessing Data

C h a p t e r 5 , A c c e s s i n g d a t a i n a c o m m a - s e p a r a t e d v a l u e s ( C S V ) t e x t f i l e 83

Displaying text file data in a report designAfter you create data row variables, you can lay out the report. The field list includes the data row variables that you defined. You select these variables and place them in your report design to display the text file data.

How to display text file data in a report design

1 In Layout, click in the content frame.

2 Drag the data row variables that you created from Fields, and drop them in the frame.

3 Resize and align the controls in the frame as needed.

4 Add any desired formatting for your report, such as text labels, dividing lines, and a report title, as shown in Figure 5-7.

Figure 5-7 Formatting the report

For more information about laying out a report, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

Specifying processing of the dataTo process CSV data from the text file, you override the Start( ), Fetch( ), and Finish( ) methods of the customized data stream component. These methods are inherited from its superclass, AcDataSource.

How to open a text file, retrieve rows, and close the file

This procedure adds code to open and close a text file. You could add error handling code to Function Start( ) As Boolean to handle an incorrect file name. This procedure also adds code to retrieve CSV data from a text file. Data values that are surrounded by double quotes can have embedded commas.

1 Right-click DataStream—DataSource, and choose Properties.

2 On the Properties page for the component, choose Methods.

Page 106: Accessing Data

84 A c c e s s i n g D a t a

3 On the Methods page for the component, double-click Function Start( ) As Boolean.

DataSource::Start appears, displaying the following code:

Function Start( ) As BooleanStart = Super::Start( )

End Function

4 In DataSource::Start, modify Start( ) to open the text file.

Above the following code:

End Function

insert

Channel = FreeFile( )Open DataInputFile For Input As Channel

5 In Properties—Methods, double-click Function Fetch( ) As AcDataRow.

DataSource::Fetch appears, displaying the default code for the method.

6 In DataSource::Fetch, modify Fetch( ) to retrieve the rows.

Change the following code:

Set Fetch = Super::Fetch()

to:

Dim row As DataRowIf EOF (Channel) Then

Exit FunctionEnd IfSet row = New DataRowInput #Channel, row.FirstField, row.SecondField, row.FiguresSet Fetch = rowAddRow( Fetch )

7 In Properties—Methods, double-click Sub Finish( ).

DataSource::Finish appears, displaying the default code for the method.

8 In DataSource::Finish, modify Finish( ) to close the text file.

Above the following code:

End Sub

insert

Close #Channel

Page 107: Accessing Data

C h a p t e r 5 , A c c e s s i n g d a t a i n a c o m m a - s e p a r a t e d v a l u e s ( C S V ) t e x t f i l e 85

Running and viewing the reportAfter you set up a report that uses data from a text file, you can run the report to access and display the data. To run the report, you choose Report➛Build and Run. Requester displays a prompt for the data input file, as shown in Figure 5-8. If you do not change the value for the data file path name, the report accesses the default file.

Figure 5-8 Prompting for the data input file name

The report output shows the data from the text file, as shown in Figure 5-9.

Figure 5-9 Report output, showing the data from the text file

You can also add custom filters to sort the data or limit which rows appear. For more information about using custom filters to sort data, see “Sorting data” in Chapter 3, “Modifying data processing.” For more information about using custom filters to limit which rows appear, see “Filtering data” in Chapter 3, “Modifying data processing.”

Page 108: Accessing Data

86 A c c e s s i n g D a t a

Page 109: Accessing Data

P a r t

2Part 2Accessing data in a database or

ODBC data source

Page 110: Accessing Data
Page 111: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 89

C h a p t e r

6Chapter 6Connecting to a database

or ODBC data sourceThis chapter contains the following topics:

■ About database and ODBC connections

■ Preparing to access data using a database or ODBC driver

■ Defining a database or ODBC connection

■ Creating a query data source

■ About AFC support for database and ODBC connections and queries

Page 112: Accessing Data

90 A c c e s s i n g D a t a

About database and ODBC connectionsTo access data from an ODBC data source, you use a query. To access data from a database, you use a SQL query or a stored procedure. This chapter describes how to connect to a database or ODBC data source and retrieve data using a query.

To connect to a database or ODBC data source, perform the following steps in this order:

■ Gather the necessary information and set up access to the data source. For more information about performing this step for a database data source, see “Using a native database driver,” later in this chapter. For more information about performing this step for an ODBC data source, see “Using an ODBC driver,” later in this chapter.

■ Define a database or ODBC connection. For information about this topic, see “Defining a database or ODBC connection,” later in this chapter.

■ Create a query data source. For more information about creating a query data source, see “Creating a query data source,” later in this chapter.

For information about accessing data using a stored procedure, see Chapter 10, “Accessing data using a stored procedure.” For more information about creating a query, see Chapter 7, “Creating a database or ODBC query.”

Preparing to access data using a database or ODBC driver

To access your database or ODBC data source, you must know the table and column structure of your data. You also need to know the joins that apply to your data source. If you do not know this information, obtain a database schema diagram from your data source administrator. For more information about joins and schemas, refer to the documentation for your database or ODBC data source.

You must ensure that your computer has access to the database or ODBC data source. How you access your data source determines what information you must provide to e.Report Designer Professional to create the connection. For information about using an ODBC driver, see “Using an ODBC driver,” later in this chapter. For information about using a native database driver, see “Using a native database driver,” later in this chapter.

Using an ODBC driverOpen Database Connectivity (ODBC) is an interface that allows an application to access data in any ODBC-compliant RDBMS. Since ODBC is such a mature technology, it is the main data access mechanism for Actuate reports. If your

Page 113: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 91

reports do not use ODBC connectivity yet, then you should plan to migrate your reports to use ODBC.

For more information about Actuate’s support bulletin regarding support for database drivers, consult the release notes for supported product information. For more information about using a native database driver to connect to a data source, see “Using a native database driver,” later in this chapter.

Preparing to access data using an ODBC driverIn addition to knowing your data structure, to access your data source using an Open Database Connectivity (ODBC) database driver, you must know:

■ The ODBC data source name. Before you use an ODBC connection, you must create an ODBC data source using the ODBC administrator utility that comes with your ODBC driver software. For information about how to set up the data source, see your ODBC documentation. The data source name can be a user data source name (DSN), a system DSN, or a file DSN.

■ The user name and password, if your ODBC driver requires this information.

■ The connection string for your ODBC data source. The connection string includes any other information the connection requires. The contents of this string depend on which driver you use with your ODBC data source. For example, the connection string can include the name of a Microsoft Excel file.

If the data source name is a file DSN, the connection string is the name of the data source, preceded by FILEDSN=. For example, if the file DSN is MYDATA, the connection string you use in e.Report Designer Professional is: FILEDSN=MYDATA.

If you are using the ODBC driver included with e.Report Designer Professional to access an Oracle database and want to access NCHAR and NVARCHAR fields, add the following phrase to the connection string:

EnableNcharSupport=1

For information about the connection string for your database driver, see your ODBC driver documentation. For information about setting properties, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. For information about supported ODBC connections, consult the release notes for supported product information.

Configuring an ODBC driverThe e.Report Designer Professional installation configures several sample ODBC data sources as user DSNs. If you are not the user who installed e.Report Designer Professional or you want to access an additional ODBC data source, you must configure the ODBC data source.

Page 114: Accessing Data

92 A c c e s s i n g D a t a

A localized e.Report Designer Professional installation does not install and configure a localized database. To use a localized database, such as a Japanese version of sfdata.mdb, you must configure the localized database as an ODBC data source.

If you use an ODBC driver and want to use parameters in the SELECT statement, SQL-92 imposes limitations on where you can place a parameter in the SELECT statement. For more information about these limitations, see:

http://msdn.microsoft.com/library/default.asp?usr=/library/en-us/odbc/htm/odbcstatement_parameters.asp

How to configure an ODBC data source

With ODBC data, users who have the same drivers installed can share file DSNs. To make a data source accessible to all users on a computer, configure it as a system DSN. The following procedure explains how to configure an ODBC data source as a system DSN on Microsoft Windows. For more information about configuring an ODBC data source, see your operating system documentation.

1 Open Control Panel:

■ In Windows 2000, choose Start➛Settings➛Control Panel.

■ In Windows XP, choose Start➛Control Panel.

2 Choose Administrative Tools➛Data Sources (ODBC).

ODBC Data Source Administrator—User DSN appears as shown in Figure 6-1, displaying a list of ODBC data sources.

Figure 6-1 List of ODBC data sources

3 Choose System DSN.

Page 115: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 93

ODBC Data Source Administrator—System DSN appears as shown in Figure 6-2, displaying a list of system data sources. The list includes system data sources that were configured during the e.Report Designer Professional installation.

Figure 6-2 List of system data sources

4 Choose Add.

Create New Data Source appears as shown in Figure 6-3, displaying a list of ODBC drivers that are installed and available.

Figure 6-3 List of ODBC drivers

5 Select Microsoft Access Driver (*.mdb). Choose Finish.

6 On ODBC Microsoft Access Setup, specify data source information:

Page 116: Accessing Data

94 A c c e s s i n g D a t a

1 In Data Source Name, type the name of the data source. Optionally, type a description.

ODBC Microsoft Access Setup looks like the one in Figure 6-4.

Figure 6-4 ODBC Microsoft Access Setup

2 In Database, choose Select.

3 On Select Database, in Directories, navigate to the directory that contains the data source, as shown in Figure 6-5.

Figure 6-5 Navigating to the directory with the data source

4 In the list that appears below Database Name, select the data source. Choose OK.

7 On ODBC Microsoft Access Setup, choose OK.

8 On ODBC Data Source Administrator—System DSN, choose OK.

Using a native database driverStarting in Actuate 8 SP1, Actuate has integrated best-in-class ODBC drivers in Actuate e.Report Designer Professional and Actuate iServer. Developed by the leading vendor of ODBC drivers, DataDirect, these drivers provide customers with an out-of the-box ODBC connectivity mechanism for the latest Oracle, DB2,

Page 117: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 95

and MS SQL Server releases at no additional cost. Actuate recommends that you use ODBC drivers for your reports.

For any native database connection type, such as Oracle, you must install a database client before you can connect to the database server. You must also define the database connection on the server before you can successfully deploy a report object executable (.rox) file. For more information about defining an Actuate iServer database connection, see Configuring Actuate iServer.

The native database driver that you use determines the type of information that you must provide to e.Report Designer Professional. For details about a particular connection type, see the documentation for the database. Table 6-1 shows the information that you must provide e.Report Designer Professional and any optional information that you can provide for each type of database server.

For more information about defining the connection properties for a database or ODBC connection, see “Defining a database or ODBC connection,” later in this chapter.

Defining a database or ODBC connectionTo define a connection for a database or ODBC data source, choose Tools➛Database Connection or perform the steps in the following procedure. If you do not supply the required connection property values by setting them for

Table 6-1 Required and optional connection information

Database server type

Required connection information Optional connection information

DB2 ■ Data source name■ Password, if required for

your user account■ User Name

MS SQL ■ Password, if required for your user account

■ User name

Server name. If not supplied, e.Report Designer Professional uses a locally defined server as the default server.

Oracle ■ Database interface, such as acorcl90

■ Host string, such as oran9i■ Password, if required for

your user account■ User name

Page 118: Accessing Data

96 A c c e s s i n g D a t a

the connection component, Database Login appears and requests the property values when e.Report Designer Professional connects to the data source.

How to define a connection

1 In Report Structure, ensure that a connection slot and its associated DataStream slot are empty, as shown in Figure 6-6. If necessary, right-click an existing connection or data source component and choose Delete.

Figure 6-6 An empty connection slot and DataStream slot

2 Open the toolbox. Select Data to see the data tools, as shown in Figure 6-7.

Figure 6-7 The data tools

3 Drag a database connection component from Toolbox—Data and drop it in Connection, as shown in Figure 6-8.

Figure 6-8 Adding a connection component

Select Component appears, displaying all connection types that are compatible with your data source component, if any. If you have not chosen a data source component, e.Report Designer Professional displays all possible connection types.

Page 119: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 97

4 In Select Component, select the type of connection, as shown in Figure 6-9. For an ODBC connection, select ODBC Connection. For a native database driver, select the type of database.

Figure 6-9 Selecting an ODBC connection

Choose OK.

Component Properties appears, as shown in Figure 6-10.

Figure 6-10 Component Properties

5 Select the data source from the drop-down list, and type the values for the connection properties that your data source server requires, as specified in “Preparing to access data using a database or ODBC driver,” earlier in this chapter.

Alternatively, you can choose OK, right-click the connection component in Report Structure, and choose Properties. You can then set the connection property values on the Properties page for the component.

Creating a query data sourceA query data stream always includes at least two components, a query data source and a data row, as shown in Figure 6-11. You see these components in Report Structure when you build a report.

Page 120: Accessing Data

98 A c c e s s i n g D a t a

Figure 6-11 A query data stream with a data source and a data row

The query data source component contains a SQL query, which it uses to retrieve data from the data source. Before you create the query, the report design must have a query data source component.

If you start a new report design using a report wizard or a blank report, e.Report Designer Professional adds the data stream components to the report design, including a graphical query data source component. You can use this graphical query data source component or delete it. You can also add additional graphical or textual query data source components to a report design. If you create a query graphically and later convert it to a textual query, the conversion replaces the original graphical query data source component with a textual one.

To add query data source and data row components to a report design, use the toolbox. You can also use an existing query data source or data row from a library or from another report design. For more information about adding a component to a report, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to add query data source and data row components to a report design using the toolbox

To add a query data source or a data row component to a report design, use the toolbox.

1 Ensure that the report design contains a database connection. For more information about defining a connection, see “Defining a database or ODBC connection,” earlier in this chapter.

2 Drag a database source component from Toolbox—Data and drop it in the report section’s DataStream slot, as shown in Figure 6-12.

Figure 6-12 Adding a database source component

Select Component appears, as shown in Figure 6-13.

Page 121: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 99

Figure 6-13 Selecting a data source type

3 Choose how to create your query:

■ To create your query graphically, select SQL Query Data Source (Graphical). The data source appears in Report Structure and looks like the one in Figure 6-14.

Figure 6-14 A graphical SQL query data source

■ To create your query using SQL code, select SQL Query Data Source (Textual). The data source appears in Report Structure and looks like the one in Figure 6-15.

Figure 6-15 A textual SQL query data source

Choose OK.

4 Drag a data row component from Toolbox—Data and drop it in the query data source component’s DataRow slot. Figure 6-16 shows the data row component with a graphical query data source.

Figure 6-16 A graphical query data source with a data row component

Page 122: Accessing Data

100 A c c e s s i n g D a t a

About AFC support for database and ODBC connections and queries

The Actuate Foundation Class AcConnection establishes the protocol for connecting, disconnecting, and generating error messages if a connection fails. Database and ODBC connections all use classes that are derived from AcDBConnection, which derives from AcConnection.

Table 6-2 lists an ODBC data source and the databases to which you can connect. The table also lists the Actuate Foundation Classes that support connecting to each data source. These classes define variables, such as user name and password, that are necessary for establishing a connection. For more information about these classes, see Programming with Actuate Foundation Classes.

To access data in a database or ODBC data source, you typically use a SQL query data source. The SQL query data source assembles the SQL SELECT statement that you created using the graphical or textual query editor and sends the statement to the database or ODBC data source.

To communicate with the database or ODBC data source, the data source uses statements (AcDBStatement) and cursors (AcDBCursor). A statement provides a way to execute a SQL SELECT statement. The result of a SELECT statement is typically a set of records. When a SQL SELECT statement returns table data, a cursor manages the retrieval of data rows. It also tracks the row position in the record set as the database or ODBC data source sends each row to the data source.

As shown in Figure 6-17, the report section, data source, connection, statement, and cursor interact in the following ways:

■ A report section owns, instantiates, and deletes a data source. If the connection is in a report section, the report section owns the connection.

■ The data source instantiates and deletes a statement or cursor. The data source calls the connection’s Prepare( ) method to instantiate a statement. Then, the data source calls the statement’s AllocateCursor( ) method to instantiate a cursor. If the connection is in the data source, the data source instantiates and deletes the connection.

Table 6-2 Data sources and their corresponding connection classes

Data source Connection class

DB2 AcDB2Connection

MicrosoftSQL AcMSSQLConnection

ODBC AcODBCConnection

Oracle AcOracleConnection

Page 123: Accessing Data

C h a p t e r 6 , C o n n e c t i n g t o a d a t a b a s e o r O D B C d a t a s o u r c e 101

■ The data source uses the connection.

■ The statement uses the connection.

■ The cursor uses the statement.

Figure 6-17 Interaction between the report section, data source, connection, statement, and cursor

For more information about Actuate Foundation classes, see Programming with Actuate Foundation Classes.

Report section

SQLQuery Data

Source

DB Statement

DB Cursor

Class uses another class

Class instantiates and owns another class

Connection

Page 124: Accessing Data

102 A c c e s s i n g D a t a

Page 125: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 103

C h a p t e r

7Chapter 7Creating a database or

ODBC queryThis chapter contains the following topics:

■ About creating database and ODBC queries

■ Creating a query

■ Creating a query graphically

■ Creating a query by writing a SQL SELECT statement

■ Converting a graphical query to a textual query

■ Previewing the rows that a database or ODBC query returns

■ Changing the properties of a result column

■ Specifying sorting

Page 126: Accessing Data

104 A c c e s s i n g D a t a

About creating database and ODBC queriesA query is a SQL SELECT statement that specifies the data to retrieve from a data source. To access data from an ODBC data source, you use a query. To access data from a database, you use a query or a stored procedure. This chapter describes how to create a query.

To access data from your database or ODBC data source, perform the following steps in this order:

■ Gather the necessary information and set up access to the data source. For information about performing this step, see “Preparing to access data using a database or ODBC driver” in Chapter 6, “Connecting to a database or ODBC data source.”

■ Define a database or ODBC connection. For information about performing this step, see “Defining a database or ODBC connection” in Chapter 6, “Connecting to a database or ODBC data source.”

■ Create a query data source. For information about performing this step, see “Creating a query data source” in Chapter 6, “Connecting to a database or ODBC data source.”

■ Create a query. For information about creating a query, see “Creating a query,” later in this chapter.

To support users specifying additional filter conditions for a report, you can provide parameters in your query. For more information about adding parameters to your query, see Chapter 8, “Filtering data.”

To improve performance of an existing query, you can view the SQL that the query uses and tune it in your data source. If the tables or columns in your data source change, you must synchronize the query with the new table and column definitions in the data source. For more information about tuning and synchronizing queries, see Chapter 9, “Maintaining a database or ODBC query.”

Creating a queryWhen you use e.Report Designer Professional, you do not need a detailed understanding of the SQL language. You can use Query Editor to select tables, columns, and other query options. Actuate e.Report Designer Professional writes the SQL SELECT statements as you make selections in Query Editor. In most situations, you create SQL queries using Query Editor.

You also can write your own SQL SELECT statements using Textual Query Editor. Write your own SQL SELECT statements only if you want to use an existing SQL statement, if you prefer using SQL directly, or if you want to tune your SQL

Page 127: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 105

SELECT statement to obtain better performance from your data source. Textual Query Editor supports writing SQL SELECT statements, modifying them, and viewing related information. When you use Textual Query Editor, e.Report Designer Professional supports creating the data row and binding the columns. You also can override AFC methods to specify your SQL SELECT statement. For more information about writing SQL, refer to a SQL manual or the documentation for your database or ODBC data source.

Even if you are comfortable writing SQL code, consider creating a query graphically first. You later can convert a query that you define graphically to a textual query. You cannot convert a textual query to a graphical query.

A textual query and an equivalent graphical query return the same results when accessing most types of databases. Some databases, such as DB2, have characteristics that cause different results for queries in which a user provides values to filter the results of the query. Textual queries are filtered by Actuate iServer, while graphical queries push the condition into the WHERE clause and rely on the database to filter the results. String comparison in Actuate iServer is case-sensitive and does not ignore trailing spaces. String comparison on some databases such as DB2 is not case-sensitive and ignores trailing spaces. For example, a DB2 database accepts “ABC” as equal to “abc ” while Actuate iServer considers them not equal. A similar issue occurs in Oracle databases, because Oracle pads the value in CHAR data type columns with blank spaces to fill the fixed length of a column. Actuate iServer does not consider “ABC” equivalent to “ABC ”, but Oracle’s string comparison for CHAR data types ignores trailing spaces.

To ignore trailing spaces in a textual query, use TRIM( ) or an equivalent SQL function that is understood by the database to trim the trailing spaces from values before comparing them. To replicate case-insensitivity in a textual query, use UPPER( ), LOWER( ) or a similar SQL function that is understood by the database to convert the case of values before comparing them.

e.Report Designer Professional uses the sections in your report design to determine a default sort order. You can modify or override this default functionality.

You can change the default data type or display length for the columns that your query returns. You also can add a reference name if you plan to use the name of a column in customized code and want a simpler or clearer name.

Creating a query graphicallyTo create a query graphically, you perform the following procedures:

■ Opening Query Editor and Database Browser

Page 128: Accessing Data

106 A c c e s s i n g D a t a

■ Using tables, views, and synonyms

■ Selecting and modifying columns and creating computed fields

You can also choose to perform any of the following optional procedures:

■ Summarizing data from multiple rows

■ Adding conditions to a query

■ Viewing the generated SQL SELECT statement

■ Previewing the rows that a database or ODBC query returns

■ Changing the properties of a result column

■ Specifying sorting

Opening Query Editor and Database BrowserWhen you create a query graphically, you create the query in Query Editor and select tables for the query using Database Browser. You can also see and select views, system tables, and synonyms in Database Browser, depending on which type of data source you use. For example, you can view synonyms in an Oracle database.

Database Browser shows a graphical representation of the tables and views that you can access through the connection. Synonyms in data sources provide alternate names for tables and views. When Data Browser displays synonyms, it also displays the name of the table or view for which the synonym was defined.

How to open Query Editor and Database Browser

1 Ensure that the report design contains a connection and a graphical query data source.

2 Choose View➛Data.

If you do not have an open connection, e.Report Designer Professional attempts to connect to the data source using the connection properties that are defined in the connection component. If e.Report Designer Professional is unable to connect, Database Login appears, as shown in Figure 7-1.

Figure 7-1 Database Login

Page 129: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 107

3 In Database Login, type the required login credentials, then choose OK.

Query Editor and Database Browser appear.

The upper part of Query Editor is empty, and the lower part contains no values, as shown in Figure 7-2.

Figure 7-2 Lower part of Query Editor

Database Browser shows the available tables, views, and synonyms, as shown in Figure 7-3.

Figure 7-3 Available tables, views, and synonyms

How to specify inclusion of data source and owner information in table names

If your data source supports a hierarchical naming structure, you can specify whether the data source and owner names appear as part of table names in Query Editor by choosing SQL➛Column Qualifiers.

Columns

Tables

ServerData sourceor schema

Page 130: Accessing Data

108 A c c e s s i n g D a t a

How to specify the display and content in Database Browser

To specify the display and content in Database Browser, choose Tools➛Options➛Query Editor, and make your selections:

■ In Tables and Views, specify whether to display tables, views, or both tables and views in Query Editor.

■ Select Show tables and views to see both tables and views.

■ Select Show tables only to see only tables.

■ Select Show views only to see only views.

■ In Names, specify whether synonym names or the underlying base table or view names appear in Database Browser:

■ Select Base names to display only the underlying base table or view names for synonyms.

■ Select Synonyms to display only the synonym name.

■ Select Base names and synonyms to display both the synonym name and the base table or view name for the synonym.

■ Select Show system objects to display accessible data source objects that the user did not build.

■ In Owner pattern match, if the owner name must match a pattern, type a value.

Use a wildcard character (*) to match any character. For example, if you type ma* in Owner pattern match, Database Browser displays the owners whose names begins with ma.

■ In Table or view pattern match, if the table or view name must match a pattern, type a value.

Use a wildcard character (*) to match any character. For example, if you type sale* in Owner pattern match, Database Browser displays the tables and views whose names begins with sale.

■ In table or view name qualification, specify whether Database Browser displays synonym names or the underlying base table or view names:

■ Select table to display only the names of tables and views.

■ Select owner.table to display the names and owners of tables and views.

■ Select qualifier.owner.table to display the names, owners, and another qualifier for tables and views. The third qualifier is defined by the source database.

Page 131: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 109

Using tables, views, and synonymsAfter opening Query Editor, select the data source tables, views, and synonyms that provide the information for the report. For the rest of this chapter, the term tables also includes views and synonyms that are used in place of tables. As you choose tables, Actuate e.Report Designer Professional writes the FROM clause of the SQL SELECT statement.

You can use the same table multiple times. For example, you can use a table of address data to obtain both a Ship To address and a Bill To address in the same data row.

How to select a table

1 In Database Browser, expand nodes by choosing the plus icons until you see the table that you want to use.

If desired, you can preview the columns and data in the table before choosing to use this table.

2 Drag the table from Database Browser and drop it in the upper part of Query Editor.

Figure 7-4 Adding a table

The table appears in Query Editor, as shown in Figure 7-4.

If you experience poor performance when you drop tables in Query Editor, or if your data source contains more than 100 tables, disable the automatic generation of joins. To disable the automatic generation of joins, choose SQL➛Auto Joins.

3 If you drag and drop a table that is already in Query Editor, Alias Name appears, as shown in Figure 7-5.

Figure 7-5 Alias Name, showing a default alias

4 To assign the default alias name, choose OK.

Page 132: Accessing Data

110 A c c e s s i n g D a t a

Alternatively, if you do not want to use the default alias, type an alternate name for the table before choosing OK.

How to preview the columns and data in a table

1 Right-click the name of a table in Database Browser or in the upper part of Query Editor, and choose Preview Table Data.

Preview Table Data appears, as shown in Figure 7-6.

Figure 7-6 Previewing the columns and data in a table

The status bar on the bottom left lists performance statistics. For long-running queries, you can use these statistics to help tune your query.

2 Expand the width of any truncated columns by clicking on the right border of the column label.

3 If you want to keep the first column or first several columns visible while you scroll through the rest of the data, select the left margin of the first column’s label, and drag it to the last column that you want to remain visible. Figure 7-7 shows the results of freezing the first two columns then scrolling horizontally.

4 If you want to keep the first row or first several rows visible while you scroll through the rest of the data, select the top margin of the first row, and drag it to the last row that you want to remain visible. Figure 7-8 shows the results of freezing the first seven rows then scrolling vertically.

Page 133: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 111

Figure 7-7 Freezing the first two columns

Figure 7-8 Freezing the first seven rows

How to delete a table from Query Editor

To delete a table from the upper pane of Query Editor, select the table, and press Delete.

How to change the format and names of the tables

After you add a table to a query, you can indicate how table references appear in the SQL code that Actuate e.Report Designer Professional generates.

1 In the upper pane of Query Editor, double-click the table.

Page 134: Accessing Data

112 A c c e s s i n g D a t a

Query Editor—Table Property appears, as shown in Figure 7-9.

Figure 7-9 The table properties

2 Modify the following table properties as desired:

■ In Alias, type a name to use for the table or view.

■ In Name qualification, select the desired format for the table or view name.

3 Choose Close.

Creating table joinsA join is a SQL query operation that uses the values in the join fields to match records in different tables that belong together. For example, to view the customer names and addresses with all of their open orders, join the customer and order tables on the customer ID field, which is a field that both tables include. The result set contains combined customer and order records where the customer IDs are equal. The join ensures that the query correctly associates the orders with the names and addresses of the customers. For more information about joins and join fields, refer to the documentation for your database or ODBC data source.

When you add more than one table to a SQL query, e.Report Designer Professional creates joins to link related tables if it can determine the columns on which to join the tables. When you create a query, view the joins that e.Report Designer Professional creates for your data source, and ensure that they match the structure of your data source schema. If necessary, create or delete joins. As you create or delete joins, Actuate e.Report Designer Professional changes the WHERE clause of the SQL SELECT statement for your query.

About the automatic generation of joinsTo determine where to create a join, e.Report Designer Professional applies the following criteria in this order:

■ Any relationship information, or metadata, that is available in the data dictionary of a data source. For example, a data dictionary can contain the

Page 135: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 113

information that one of the tables has a foreign key that maps to the other table’s primary key.

■ Matching column names and types for an ODBC driver that does not support relationship metadata. For example, e.Report Designer Professional matches column names and types to create automatic joins for the sample Sfdata.mdb Microsoft Access database.

For more information about joins, primary keys, and foreign keys, refer to the documentation for your database or ODBC data source.

Creating and deleting joins manuallyThe type of join you can create depends on the type of data source. Table 7-1 describes the types of joins that Query Editor supports.

How to create a join manually

1 In Query Editor, drag the primary key column name from a table and drop it on the foreign key column name in another table, as shown in Figure 7-10.

Figure 7-10 Creating a join manually

Table 7-1 Types of joins that Query Editor supports

Type of join Returns

Inner join Only records from two tables where the values of the joined fields have a specified relationship, such as equal to or greater than

Left outer join All records from the table on the left side of the join even if the other table does not have a record with the specified relationship, such as equal to or greater than

Right outer join All records from the table on the right side of the join even if the other table does not have a record with the specified relationship, such as equal to or greater than

Primary key Foreign key

Page 136: Accessing Data

114 A c c e s s i n g D a t a

If your primary key requires more than one column to establish a unique value, repeat step 1 to drop additional column names on the same foreign key. For example, in a data source of parts from several manufacturers, the part ID alone is not necessarily unique. Several manufacturers can use the same number. To establish a unique key in these cases, use both the part ID and the manufacturer name.

2 Change the type of join, if desired:

1 Double-click the join operator icon, shown in Figure 7-11.

Figure 7-11 Join operator icon

Join Property appears.

2 On Join Property, select an operator from the drop-down list, as shown in Figure 7-12.

Figure 7-12 Selecting a join operator

3 In Type of join, select one of the options:

❏ Inner

❏ Left outer

❏ Right outer

Join operator icon

Page 137: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 115

Choose Close.

How to delete a join

Select the join line or join operator, as shown in Figure 7-13, and press Delete.

Figure 7-13 Join operator and join line

Modifying the generated FROM clause for a queryAfter you select tables for a query, e.Report Designer Professional generates a FROM clause for the query to request data from those tables. It also refers to these tables in other clauses of the SQL SELECT statement. For example, after you choose columns from a table, e.Report Designer Professional creates a SELECT clause that identifies each column in table.column format.

If you know SQL, you can replace the automatically generated FROM clause with your own FROM clause. Typically, report developers and data architects use the default FROM clause. If you choose to customize the FROM clause, you can use several techniques:

■ Customize the FROM clause in the query editor.

This section explains this technique. You can change the format and names that identify tables or edit the entire FROM clause for the SQL SELECT statement.

■ Convert the graphical query to a textual query, and change the SQL code.

■ Override the ObtainSelectStatement method.

For more information about the ObtainSelectStatement method, see Programming with Actuate Foundation Classes. For an example of overriding the ObtainSelectStatement, see “Viewing the SQL SELECT statement that e.Report Designer Professional sends to the data source” in Chapter 9, “Maintaining a database or ODBC query.”

How to edit or replace the FROM clause for a graphical query

1 In Query Editor, choose SQL➛Custom From Clause.

Join operator icon

Join line

Page 138: Accessing Data

116 A c c e s s i n g D a t a

2 On Custom FROM Clause, select Use custom FROM clause. In the available field, type the FROM clause.

In Figure 7-14, two static parameters, :[OrderHeader.DateOrdered] and :[OrderHeader.DateShipped] support users specifying values when they run the report.

Figure 7-14 Two static parameters

Choose OK.

Selecting and modifying columns and creating computed fieldsYou can write a query to select all columns or only some of the columns from each table. You also can create a computed field. As you select columns, e.Report Designer Professional writes the SELECT clause of the SQL SELECT statement and declares variables in the data row. After you select or create columns, you can change the order of the columns in the data row.

Selecting columns from a tableYou select columns to include in a query using Query Editor. The following procedure describes how to select columns using Query Editor.

How to select columns for a query

1 In Query Editor, choose Columns.

Query Editor—Columns appears.

2 Select columns using one of the following methods:

■ In Column Name, use the drop-down list to select a column.

■ Drag the column from the upper part of Query Editor and drop it in Column Name.

You can select and drag multiple columns. To select all columns, drag the asterisk (*), as shown in Figure 7-15. This technique selects all columns that are

Page 139: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 117

in the table when the report object executable (.rox) file runs, which can differ from the columns that now appear in Query Editor.

Figure 7-15 Selecting all columns

How to specify that the query only returns distinct rows

In some cases, a query can return multiple rows that have the same values. For example, a query that returns only the customer name and phone number from a table that contains order information will have duplicate rows if a customer ordered more than once. To display only unique rows, you can specify that the query returns only rows that have distinct values.

To display only rows that have distinct values, in Query Editor, choose SQL➛Distinct.

How to view the data in a column

Right-click the name of a column in Database Browser or in the upper part of Query Editor, and choose Preview Column Data.

Preview Data appears, as shown in Figure 7-16.

How to delete a column

To delete a column using Query Editor, choose Columns, select the column name, and press Shift+Delete.

Page 140: Accessing Data

118 A c c e s s i n g D a t a

Figure 7-16 Viewing the data in a column

Creating a computed fieldTypically a field’s value is the value of a field in the data source. A computed field is a field whose value is computed from an expression, often involving one or more fields in the data source. For example, if you have fields in the data source that provide the type of item, the number of those items that were ordered, and the cost per item, you could use a computed field to calculate the total cost for that type of item.

You can create a computed field as a control, as a data row variable, or in a query editor. This section describes how to create a computed field as part of the data source query.

You can use a formula on one or more columns to specify a computed field. For example, to return the extended price for an item in a sales order, you might use the following computation:

[items.price] * [items.quantity]

How to create a computed field using Query Editor—Columns

1 In Query Editor, choose Columns.

Query Editor—Columns appears.

2 In Column Name, type a name for the computed field.

When you select another field, Query Editor inserts the following text at the beginning of the name that you typed:

<Computed>.

Page 141: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 119

3 In Formula, type the expression that computes the value of the field, as shown in Figure 7-17. For more information about the syntax to use, see “Using QBE to specify a condition,” later in this chapter.

To use expression builder to create the expression, choose Ellipsis.

If the expression evaluates to a string, the string must not exceed 1021 characters. If the string exceeds 1021 characters, e.Report Designer Professional displays an error.

Figure 7-17 Computing the value of the Amount field

If you are planning to use aggregate rows in the query, use one of the aggregate functions: Sum( ), Min( ), Max( ), Ave( ), First( ), Last( ), or Count( ). For more information about aggregate functions, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

4 In Actuate Type, select a data type from the drop-down list.

You do this step last step, because changing a formula causes Actuate e.Report Designer Professional to reset the Actuate Type to Variant.

Changing the order of columns or the data type of a columnYou can specify the order of columns in a query by choosing them in the desired order or by changing the order after you create the query. You can also modify the Actuate Basic data type of the column.

How to change column order or data type

1 In Query Editor, choose Columns.

2 On Query Editor—Columns, to change the order in which the columns appear, select a column name and choose the up arrow or down arrow to move the column.

3 To change the Actuate Basic data type of a column in the report’s data row, complete one of the following tasks:

■ Double-click the column name in the upper part of Query Editor.

In Column Property, the Database Type field displays the data type of the column in the data source.

In Actuate Basic Type, select an Actuate Basic data type, as shown in Figure 7-18.

Page 142: Accessing Data

120 A c c e s s i n g D a t a

Figure 7-18 Selecting an Actuate Basic data type

■ In Query Editor—Columns, click a field under Actuate Type, and select a data type from the drop-down list, as shown in Figure 7-19.

Figure 7-19 Selecting a data type

Summarizing data from multiple rowsTo summarize a group of retrieved data rows, create an aggregate row. An aggregate row is a single row that combines the data from a group of rows when those rows have one or more columns in common. For example, you can group all rows for a particular customer and create one aggregate row that contains the total number and average dollar amount of that customer’s orders. You also could group items by category and display the average price for items in that category. For more information about aggregate functions, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

As you write an aggregate expression on Query Editor—Columns, e.Report Designer Professional adds it to the SELECT clause of the SQL SELECT statement. As you select columns for aggregate rows on Query Editor—Group By, e.Report Designer Professional writes the GROUP BY clause of the SQL SELECT statement.

To create an aggregate row, you must complete the following tasks in this order:

■ Specify the grouping column and one or more aggregate expressions on Query Editor—Columns. Query Editor—Columns must contain only the group column and aggregate expressions. The SQL language does not permit the

Page 143: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 121

inclusion of any other columns unless they are from another table and do not conflict with the grouping. For more information about including additional columns, see a SQL manual or the documentation for your database or ODBC data source.

■ Ensure that your data is sorted by the grouping column. Summarizing data does not sort the results. Your query must sort the records by the grouping column for summarization to return the proper results. One method of sorting is to specify sorting by the grouping column on Query Editor—Order By. For more information about the need for sorting when summarizing data, see a SQL manual or the documentation for your database or ODBC data source. For more information about sorting in e.Report Designer Professional, see “Sorting data” in Chapter 1, “Accessing a data source” and “Specifying sorting for a textual query,” later in this chapter.

■ Select a grouping column on Query Editor—Group By. The query returns only one row for each different value in the grouping column.

How to summarize data

1 In Query Editor, choose Columns.

Query Editor—Columns appears.

2 Select the grouping column by dragging a column from the upper part of Query Editor and dropping it in Column Name.

You can choose additional columns if you also choose them in Query Editor—Group By and if using all of the columns together to group records does not cause a SQL error.

3 Set up the aggregate expression:

1 In Column Name, type a name for the aggregate expression.

2 In Formula, type the expression that computes the value of the column. Use one of the aggregate functions, such as Sum( ), Min( ), Max( ), Ave( ), First( ), Last( ), or Count( ).

If you want more room to type the expression, choose Ellipsis to open expression builder.

If the expression evaluates to a string, the string must not exceed 1021 characters. If the string exceeds 1021 characters, e.Report Designer Professional displays an error.

3 In Actuate Type for the aggregate expression, select a data type from the drop-down list.

Do not select a data type until you define a formula. e.Report Designer Professional sets the data type of a column to Variant when you define a formula.

Page 144: Accessing Data

122 A c c e s s i n g D a t a

4 Repeat steps 2–3 for any additional aggregate expressions that you want to display.

5 In Query Editor, choose Group By.

If the Group By tab is hidden:

1 Choose Tools➛Options.

Options—Design Editor appears.

2 Choose Query Editor.

Options—Query Editor appears.

3 Select Enable Group By and Having editors.

Choose OK.

4 In Query Editor, choose Group By.

Query Editor—Group By appears.

6 In Available Columns, select the grouping column for the aggregate rows.

You can select additional columns for grouping if Query Editor—Columns also contains the columns and if using all of the columns together to group records does not cause a SQL error.

7 Choose the left arrow.

The column names appear in Group By, as shown in Figure 7-20.

Figure 7-20 Selecting grouping columns

How to remove a grouping column for summarized data

1 In Query Editor, choose Group By.

Query Editor—Group By appears.

2 In Group By, select the column name. Press Shift+Delete.

3 Choose Columns.

Query Editor—Columns appears.

4 Select the column name. Press Shift+Delete.

Page 145: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 123

5 If the deleted column was the only grouping column, delete any computed fields that contain aggregate expressions.

Adding conditions to a queryYou can impose two kinds of conditions on a query:

■ Conditions on row retrieval. To select data based on values in individual rows in the database or ODBC data source, use row retrieval conditions. Specify these conditions on Query Editor—Conditions. e.Report Designer Professional adds these conditions to the WHERE clause of the SQL SELECT statement that it generates. For more information about adding conditions on row retrieval, see “Putting a condition on row retrieval,” later in this chapter.

■ Conditions on aggregate rows. To select data based on values that are not known until after the query creates aggregate rows, such as total order amounts, use aggregate row conditions. Specify these conditions on Query Editor—Having. e.Report Designer Professional adds these conditions to the HAVING clause of the SQL SELECT statement that it generates. For more information about adding conditions on an aggregate row, see “Putting conditions on an aggregate row,” later in this chapter.

There are two ways to put conditions on row retrieval. You can use either or both of them in a single query:

■ Use SQL syntax to specify a condition that involves more than one column. You also can specify an OR or AND condition. For information about SQL syntax, see a SQL manual or the documentation for your database or ODBC data source.

■ Use Query by Example (QBE) expression syntax. Each condition that you specify using QBE can involve only one column. When you specify more than one condition using QBE syntax, all conditions must be True for a particular row to be returned. That is, you can specify only AND conditions. For more information about specifying conditions using QBE, see “Using QBE to specify a condition,” later in this chapter.

For information about enabling users to specify the value of a column as a condition, see Chapter 8, “Filtering data.”

For information about enabling users to specify an expression as a condition, see Chapter 8, “Filtering data,” later in this chapter.

About how e.Report Designer Professional applies conditionsWhen a query with both row retrieval and aggregate conditions runs, e.Report Designer Professional applies the conditions in the following order:

■ The query retrieves all rows that meet the row retrieval conditions, as shown in Figure 7-21.

Page 146: Accessing Data

124 A c c e s s i n g D a t a

Figure 7-21 Filtering rows

For example, the query selects salary numbers for all departments within a division of the company.

■ The query groups those rows by the grouping columns and creates aggregate rows that summarize the groups, as shown in Figure 7-22.

Figure 7-22 Aggregating rows

For example, the query combines the salary numbers by department and creates rows that contain the average salary for each department.

■ The query applies the conditions for the aggregate rows that it created, as shown in Figure 7-23.

Figure 7-23 Filtering the aggregate rows

All rows that WHERE returned

All rows in table

All rows that WHERE returned

Aggregate rows that GROUP BY created

All rows in table

All rows that WHERE returned

Aggregate rows that GROUP BY created

Aggregate rows that HAVING returned

All rows in table

Page 147: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 125

For example, the query includes only those departments for which the average salary exceeds a particular amount.

Using QBE to specify a conditionActuate e.Report Designer Professional provides a simple Query by Example (QBE) syntax with which you can write an expression. e.Report Designer Professional translates the expression into SQL. QBE syntax applies only in a report that uses a query data stream. Use QBE syntax in the following situations:

■ To set conditions on row retrieval on Query Editor—Conditions

■ To set conditions on aggregate rows on Query Editor—Having

■ To choose values for ad hoc parameters on the Actuate Information Console Requester page

When you use QBE syntax, e.Report Designer Professional reads the QBE expression and adds the corresponding SQL code to the query. You can build a variety of expressions using QBE syntax, including the following types:

■ A single value, such as 10

■ A relational expression, such as >10

■ A range of values, such as 10–20

■ A list of values, expressions, or ranges that are separated by pipe symbols, such as 10|20–30|>50

■ A group of values, such as (abc|xyz), that can be combined in a Boolean expression, such as (abc|xyz)&bbb.

For information about QBE expressions and operators, see Working with Reports using Actuate Information Console.

Putting a condition on row retrievalYou can specify one or more conditions that a row must meet for a query to return that row. For example, rather than retrieving information about all customers, you can retrieve information about particular kinds of customers. As you put conditions on row retrieval, Actuate e.Report Designer Professional adds them to the WHERE clause of the SQL SELECT statement.

You can write a condition on row retrieval in QBE or SQL syntax. For more information about QBE syntax, see “Using QBE to specify a condition,” earlier in this chapter. A SQL expression can include any valid SQL syntax, including nested SELECT statements. For more information about SQL syntax, consult a SQL manual or the documentation for your database or ODBC data source.

You can also have users specify conditions when they run the report. For more information about having users specify conditions, see Chapter 8, “Filtering data.”

Page 148: Accessing Data

126 A c c e s s i n g D a t a

If you want users to type a single value to complete the expression when they run the report, create a SQL or QBE expression that uses a static parameter. For more information about static parameters, see Chapter 8, “Filtering data.”

How to put conditions on row retrieval using QBE

1 In Query Editor, choose Conditions.

Query Editor—Conditions appears.

2 On Query Editor—Conditions, click under Column Name, and select a column name from the drop-down list.

For example, in Column Name, choose items.pricequote.

3 In Query Expression, type a QBE expression for your condition. To have more space and help for creating a QBE expression, choose Ellipsis to open expression builder Ellipsis only appears when the cursor is in Query Expression.

For example, Figure 7-24 shows a QBE expression that selects data rows from which the value of items.pricequote exceeds 100.

Figure 7-24 A filter condition using a QBE expression

4 To view the results for the WHERE clause, choose SQL.

Query Editor—SQL appears.

5 To add more conditions, choose Conditions, and repeat steps 2–3.

How to delete a QBE row retrieval condition

1 In Query Editor, choose Conditions.

Query Editor—Conditions appears.

2 Select the column name. Press Shift+Delete.

How to put conditions on row retrieval using SQL

1 In Query Editor, choose Conditions.

Query Editor—Conditions appears.

2 In the bottom field, type a SQL expression for the condition.

Page 149: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 127

For example, specify in SQL that the value of items.pricequote must be greater than 100, as shown in the following code and Figure 7-25:

items.pricequote>100

Figure 7-25 Using Actuate SQL to specify a filter condition

3 To view the resulting WHERE clause, choose SQL.

Query Editor—SQL appears.

4 To add more conditions, choose Conditions, and repeat step 2.

How to delete a SQL row retrieval condition

1 In Query Editor, choose Conditions.

Query Editor—Conditions appears.

2 Select the SQL expression. Press Shift+Delete.

Putting conditions on an aggregate rowYou can set conditions that an aggregate row must meet. For example, rather than including aggregate rows for all customers, you can include only customers with order totals of more than $10,000. As you put conditions on aggregate rows, e.Report Designer Professional writes the HAVING clause of the SQL SELECT statement.

For more information about how to specify aggregate rows, see “Summarizing data from multiple rows,” earlier in this chapter. For more information about conditions, see “About how e.Report Designer Professional applies conditions,” earlier in this chapter.

You can write a condition on aggregate rows in QBE or SQL syntax. A SQL expression can include any valid SQL syntax, including nested SELECT statements. For more information about SQL syntax, consult a SQL manual or your database or ODBC data source documentation. For more information about QBE syntax, see “Using QBE to specify a condition,” earlier in this chapter.

You can also have your users specify conditions when they run the report. For more information about having users specify conditions, see Chapter 8, “Filtering data.”

Page 150: Accessing Data

128 A c c e s s i n g D a t a

If you want users to type a single value to complete the expression when they run the report, create a SQL or QBE expression that uses a static parameter. For more information about static parameters, see Chapter 8, “Filtering data.”

How to put conditions on aggregate rows using QBE

1 In Query Editor, choose Having.

Query Editor—Having appears.

If Query Editor—Having is hidden, see “How to summarize data,” earlier in this chapter, for more information about displaying Group By and Having.

2 Click under Column or Aggregate, and select an aggregate column name from the drop-down list.

The drop-down list displays the grouping columns that are specified on Query Editor—Grouping and the aggregate columns that are specified on Query Editor—Columns. The aggregate column names are prefaced by <Computed>. to indicate that they are computed fields. For example, in Column or Aggregate, choose <Computed>.OrderTotal.

3 In Query Expression, type a QBE expression for your condition. To have more space and help for creating a QBE expression, choose Ellipsis to open expression builder.

For example, you can specify in QBE that the value of OrderTotal must be greater than 1000000, as shown in the following code and Figure 7-26:

>1000000

4 To view the resulting HAVING clause, choose SQL:

HAVING (items.pricequote * items.quantity) > '1000000'

5 To add more conditions, choose Having, and repeat steps 2–3.

Figure 7-26 An aggregate filter condition using a QBE expression

How to delete a QBE aggregate row condition

1 In Query Editor, choose Having.

Query Editor—Having appears.

Aggregate name QBE syntax

Ellipsis

Page 151: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 129

If Query Editor—Having is hidden, see “How to summarize data,” earlier in this chapter, for more information about displaying Group By and Having.

2 Select the column name. Press Shift+Delete.

How to put conditions on aggregate rows using SQL

1 In Query Editor, choose Having.

Query Editor—Having appears.

If Query Editor—Having is hidden, see “How to summarize data,” earlier in this chapter, for more information about displaying Group By and Having.

2 In the bottom field, at the bottom of Query Editor—Having, type a SQL expression for the condition.

For example, specify in SQL that the value of the sum of all price quotes, multiplied by the number of items in the order, must be greater than 1000000, as shown in the following code and Figure 7-27:

sum(pricequote * itemcount)>1000000

3 To view the resulting WHERE clause, choose SQL.

Query Editor—SQL appears.

4 To add more conditions, choose Having, and repeat step 2.

Figure 7-27 An aggregate filter condition using Actuate SQL

How to delete an aggregated row condition written in SQL

1 In Query Editor, choose Having.

If Query Editor—Having is hidden, see “How to summarize data,” earlier in this chapter, for more information about displaying Group By and Having.

2 Select the SQL expression. Press Shift+Delete.

Viewing the generated SQL SELECT statementA SELECT statement specifies which data to retrieve from the data source.

Page 152: Accessing Data

130 A c c e s s i n g D a t a

A SQL SELECT statement consists of parts called clauses. Table 7-2 shows the relationship between actions in Query Editor and clauses in the generated SQL SELECT statement.

For more information about how to perform these actions in Query Editor, see the corresponding section in this chapter or in Chapter 8, “Filtering data.”

How to view the SELECT statement

1 In Query Editor, choose SQL.

Query Editor—SQL appears.

2 Review the SQL SELECT statement that Actuate e.Report Designer Professional wrote in response to your choices in Query Editor. An example is shown in Figure 7-28.

Figure 7-28 The resulting SQL SELECT statement

Table 7-2 Relationship between Query Editor actions and SQL SELECT statement clauses

Action in Query Editor SQL SELECT statement clause

Using tables, views, and synonyms FROM and WHERE

Selecting and modifying columns and creating computed fields

SELECT

Putting a condition on row retrieval WHERE

Specifying sorting for a textual query ORDER BY

Summarizing data from multiple rows GROUP BY

Putting conditions on an aggregate row HAVING

Prompting the user to provide a specific value to filter results

FROM, WHERE, or HAVING

Filtering query results with user-supplied expressions

FROM, WHERE, or HAVING

Page 153: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 131

How to copy the SELECT statement to Clipboard

You can copy the SQL SELECT statement to Clipboard to edit it manually or to paste it elsewhere.

On Query Editor—SQL, select the text you want to copy. Choose Edit➛Copy.

Creating a query by writing a SQL SELECT statementTo create a query by writing SQL code, you perform the following procedures in this order:

■ Writing the SQL query

■ Preparing the query

■ Modifying the textual query, if desired

■ Accepting the textual query

The following sections describe each of these procedures.

Writing the SQL queryTo choose the data to include in the report, you write a query. A query is a SQL SELECT statement that specifies what data to retrieve from a data source.

The Textual Query Editor supports tab and new-line characters in the query string. This ability supports pasting query text directly from an external application, such as a database query tool. You can also include comments in your SQL query in the format that your database supports.

If you plan to use stored procedures that are provided by your database, use Stored Procedure Data Source Builder. For more information about working with stored procedures, see Chapter 10, “Accessing data using a stored procedure.”

For information about using parameters in a query, see Chapter 8, “Filtering data.”

How to write a query using Textual Query Editor

1 Create a textual query data source.

To write the SQL code for your query, you must have a textual query data source. For information about creating a query as a textual query data source, see “Creating a query data source” in Chapter 6, “Connecting to a database or ODBC data source.” For information about converting a graphical query data source into a textual query data source, see “Converting a graphical query to a textual query,” later in this chapter.

2 Choose View➛Data to open Textual Query Editor.

Page 154: Accessing Data

132 A c c e s s i n g D a t a

Textual Query Editor appears, as shown in Figure 7-29.

Figure 7-29 Textual Query Editor

3 In the upper part of Textual Query Editor, type the SQL SELECT statement.

If your data source login requires it, fully qualify the table name with the name of the data source. For example, to select all columns from the customers table of the Actest database, you can use the fully qualified name, Actest.customers, in the SELECT statement. You do not have to specify the data source name in subsequent clauses of the query, such as the WHERE clause.

To retrieve data for only those customers in Massachusetts, specify State in the WHERE clause of the SELECT statement, as shown in Figure 7-30.

Figure 7-30 A SQL SELECT statement

While editing your SQL code, you can use standard text editing functionality, such as copy and paste. You can access these commands and others on the context menu. Right-click in the upper part of Textual Query Editor to display the context menu, as shown in Figure 7-31.

Choose Undo to undo your editing of the SQL SELECT statement. Undo affects only the query that you type. It does not apply to any other Textual Query Editor function, such as Describe Query or Clear Query.

Page 155: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 133

Figure 7-31 Textual Query Editor’s context menu

You also can choose Clear Query to erase the entire SQL code. This also clears the lower half of Textual Query Editor, erasing any information about the query that you specified there.

If you want to preview the results of your query, choose Preview Data. For more information about previewing data in a database query, see “Previewing the rows that a database or ODBC query returns,” later in this chapter.

Preparing the queryChoose Describe Query to prepare the SQL SELECT statement. Describe Query sends the SQL SELECT statement to the connected data source server to describe the query’s result columns. If you use the select all character, which is an asterisk (*), in your SQL SELECT query, e.Report Designer Professional retrieves information for all columns in the table. It also updates the relevant information in the lower part of Textual Query Editor.

Actuate e.Report Designer Professional sends the SQL SELECT statement to your connected data source server. All data source connections return the result columns information to Textual Query Editor.

If e.Report Designer Professional cannot connect to the data source, Database Login appears, as shown in Figure 7-32.

Figure 7-32 Database Login

If Database Login appears, type the required information, and choose OK. If you provided connection information in the connection component properties for the report, e.Report Designer Professional provides that information for you. For more information about defining connection properties, see “Defining a database or ODBC connection” in Chapter 6, “Connecting to a database or ODBC data source.”

Figure 7-33 shows Textual Query Editor with the result column information.

Page 156: Accessing Data

134 A c c e s s i n g D a t a

Figure 7-33 Result columns

Modifying the textual queryCheck the properties in the lower part of Textual Query Editor, and modify them as necessary. You can modify this textual query in the following ways:

■ Changing the properties of a result column

■ Specifying sorting for a textual query

■ Prompting the user to provide a specific value to filter results

■ Filtering query results with user-supplied expressions

For more information about these optional steps, see the corresponding section, later in this chapter, or in Chapter 8, “Filtering data.”

Accepting the textual query1 Check the properties in the lower part of Textual Query Editor and verify that

they are appropriate.

For information about understanding and modifying Textual Query—Columns, see “Changing the properties of a result column,” later in this chapter. For information about understanding and modifying Textual Query—Static Parameters, see Chapter 8, “Filtering data.” For information about understanding and modifying Textual Query—Adhoc Conditions, see “Filtering query results with user-supplied expressions” in Chapter 7, “Creating a database or ODBC query.”

2 Choose OK to accept the query and its column and parameter properties.

Converting a graphical query to a textual queryTo modify a SQL SELECT statement that you created graphically in Query Editor, you must convert the graphical query to a textual query. You cannot undo this conversion.

If you use the FetchLimit property for a data source component, you can adjust its value after converting a graphical query to a textual query. FetchLimit controls

Page 157: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 135

the number of rows that e.Report Designer Professional returns from the data source. If you add a filtering condition, e.Report Designer Professional adds the condition to the graphical query before the SQL statement is sent to the data source. As a result, a graphical query only returns rows that passed the filtering condition. A textual query is sent to the database exactly as specified, and the filtering conditions are applied after fetching the rows. In the end, both types of queries fetch the same number of rows from the data source, but some rows that the textual query fetches may be eliminated by the filtering condition.

How to convert a graphical query to a textual query

1 In e.Report Designer Professional, choose View➛Data.

2 In Query Editor, choose SQL➛Edit SQL.

A warning, shown in Figure 7-34, reminds you that you cannot convert the query back to a graphical format.

Figure 7-34 Warning about converting a graphical query to a textual query

3 Choose OK.

Textual Query Editor opens and displays the query, as shown in Figure 7-35.

Figure 7-35 Textual Query Editor, displaying a converted graphical query

Page 158: Accessing Data

136 A c c e s s i n g D a t a

4 If two tables have the same column name, modify the default reference names as necessary. For more information about changing reference names, see “Changing the properties of a result column,” later in this chapter.

5 In Reference Names, add a reference name to the beginning of the list using the following format:

tablename.columnname

This change ensures that e.Report Designer Professional correctly identifies the table for each column when choose Describe Query to prepare the query. During conversion, this information is embedded in the column name in the following format:

tablename_columnname

For example, the customName column in the customers table appears as follows:

customers_customName

When you later choose Describe Query, the design tool queries the database or ODBC data source for the column names and replaces them on Textual Query Editor—Columns. The database or ODBC data source returns only the column names, not the table name, as metadata when e.Report Designer Professional describes the query. For example, the customers_customName entry in Column Name becomes customName. If you include a reference name using the tablename.columnname format, your query continues to associate the columns with their tables.

After you convert a query to a textual query, you can modify it as described in “Creating a query by writing a SQL SELECT statement,” earlier in this chapter.

Previewing the rows that a database or ODBC query returns

You can preview the results of a graphical or textual query without building and executing the report. Previewing the query enables you to determine whether you want to add any additional conditions to the query or modify the query in other ways.

You also can preview the data in a single table or column as you design the query. For information about previewing the data in a table, see “Creating a query by writing a SQL SELECT statement,” earlier in this chapter. For information about previewing the data in a table, see “How to specify that the query only returns distinct rows,” earlier in this chapter.

How to preview a database or ODBC query

1 If you have a graphical query, choose SQL➛Preview Data.

Page 159: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 137

If you have a textual query, choose Preview Data.

If the query uses any parameters, Specify Parameter Values appears.

If the query does not use parameters, Preview Query Data appears.

2 If the query uses parameters, specify the desired values for the parameters on Specify Parameter Values, as shown in Figure 7-36. When you are finished, choose OK.

Figure 7-36 Specifying the parameter values

An asterisk (*) indicates a required parameter. If the parameter has a default value, e.Report Designer Professional displays the default value for the parameter when you preview the query data for the first time. After the first time, e.Report Designer Professional displays the most recent parameter values for the query.

If you enter an invalid value for the parameter, e.Report Designer Professional tries to correct it. For example, if the parameter is for an integer field, e.Report Designer Professional corrects “123abc” to “123”. If e.Report Designer Professional cannot correct the value, it changes it to a blank value.

If a parameter value is blank, e.Report Designer Professional substitutes the default value, if one exists. e.Report Designer Professional runs the query.

Preview Query Data appears.

3 On Preview Query Data, shown in Figure 7-37, scroll horizontally and vertically to see the data returned from the query.

The status bar at the bottom left lists performance statistics. For long-running queries, you can use these statistics to help tune your query. For more information about tuning a query, see “Timing and optimizing data source queries” in Chapter 9, “Maintaining a database or ODBC query.”

Page 160: Accessing Data

138 A c c e s s i n g D a t a

Figure 7-37 Previewing the query data

4 Expand the width of any truncated columns by clicking the right border of the column label.

For more information about viewing the data, see “How to preview the columns and data in a table,” earlier in this chapter.

Changing the properties of a result columnYou can change the Actuate data type for query results using the graphical or textual query editor. You can also change the default display length or the reference name of query results using the textual query editor. You can change the display name for graphical and textual queries using the column editor.

Changing the data type of graphical query resultsYou can change how a data source type maps to an Actuate Basic data type for a graphical query. To change the data type of a column that you select for a query, change the value of Actuate Type for the column name on Query Editor—Columns.

If you select the same column more than once, the Actuate data type of that column changes for every occurrence. For example, Figure 7-38 shows the selection of a different data type for one of several identical column names.

Page 161: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 139

Figure 7-38 Selecting a data type for one of several identical column names

After you select a new Actuate data type, all of the identical column names have that data type, as shown in Figure 7-39.

Figure 7-39 The identical column names all have the new Actuate data type

Changing the display name of query resultsTo change the display name of a column in query results, use Data Row Editor.

How to change the display name of query results

1 Right-click the data row in Report Structure, and choose Data Row Editor.

Data Row Editor appears.

2 In Variable Name, select a column, as shown in Figure 7-40.

Figure 7-40 Selecting a column

Page 162: Accessing Data

140 A c c e s s i n g D a t a

Choose Modify.

Column Editor appears.

3 In Display name, type the desired display name, as shown in Figure 7-41.

Figure 7-41 Typing the display name

Choose OK.

Changing the data type, display length, and reference name of textual query resultsFor a textual query, you can modify the Actuate data type, display length, and reference name of the columns in rows that the textual query returns.

When you prepare the textual query to use your modified SQL SELECT statement using Describe Query, it obtains and calculates information about the result columns. For example, the textual query editor obtains a result column’s data type in the database and calculates a corresponding Actuate type. You find this information in Textual Query Editor on Textual Query—Columns, shown in Figure 7-42.

Figure 7-42 Result column information

Page 163: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 141

On Textual Query—Columns, you can view, but not modify, the values for the following fields:

■ Column name

Typically, Describe Query reports the name of the column. If Describe Query does not report a column name, e.Report Designer Professional assigns a name in the following format:

column<selectOrderNumber>.

For example, if the column is the second column that was selected, the assigned name is column2. If column names are duplicates, e.Report Designer Professional adds a unique number to the column name. For example, Address, Address_1, and Address_2.

■ DB type

Describe Query reports the column’s native data source data type. For example, the data type can be Number, Varchar, or Char.

You can modify several properties of a column:

■ Actuate Basic data type

After retrieving the data source type for a column, e.Report Designer Professional maps the column’s data source data type to an Actuate type, such as Double, String, or Integer. Use the Actuate type drop-down list to map the column to another Actuate type.

■ Display length for the column

e.Report Designer Professional displays the default display length, if any. e.Report Designer Professional uses the display length to determine the default size of the corresponding data control. You can modify the default display length by typing the desired number in the Display length field.

■ Reference name for the column, such as in the field list

For a new query, the default reference name is the same as the column name. You can specify several names by separating them by commas. e.Report Designer Professional uses the first name you provide in Reference Names as the display name of a data row variable elsewhere, for example in Fields. You can use the additional reference names in methods in a report.

A typical reference name change is to include the table name in the reference name, especially when two tables include the same column name. A typical use of a second reference name is to provide a shorter name for easy use in any code that you program for the report. For example, if the default reference name is ID, you could change it to employee.ID, empid. Your users see the table name with the column name and also the shorter name, empid, in Fields. You can use either name in your methods for the report.

Page 164: Accessing Data

142 A c c e s s i n g D a t a

Specifying sortingYou need to sort data in your query or for your query if the data is not already sorted in the data source and one of the following conditions is true:

■ You do not use group sections.

■ You use group sections, but you want to do additional sorting.

■ You wish to override the automatic sorting that the group sections provide.

For more information about sorting provided by group keys, see “Sorting data” in Chapter 3, “Modifying data processing.”

You can sort data in your query or for your query in several ways, which are described in the following list in order of precedence:

■ Group section’s sort key

The dominant sort criteria is provided by a group section’s sort key, if one is specified. Group sections can contain a sort key that e.Report Designer Professional uses to create an ORDER BY clause for queries. For more information about overriding the automatic sorting that the group sections provide, see “Overriding sorting by the group section sort key,” later in this chapter.

■ Order By property

You can provide additional sorting instructions using the OrderBy property. This approach does not require that you modify the query. You can use the Order by property for read-only queries from a library and queries that you specify in methods instead of in Query Editor or Textual Query Editor. For more information about sorting with an OrderBy property, see “Specifying the desired sort order using the OrderBy property” in Chapter 3, “Modifying data processing.”

■ ORDER BY clause in the query

You can change the query to specify that the data source sorts the data before it sends the data to e.Report Designer Professional. The procedures for specifying sorting in a query depend on whether the query is a graphical query or a textual query. For more information about sorting within a graphical query, see “Specifying data source sorting using a graphical query,” later in this chapter. For more information about sorting within a graphical query, see “Specifying sorting for a textual query,” later in this chapter.

A database can sort data so do not create a custom sort filter in e.Report Designer Professional for a database. A custom sort filter is more appropriate for sorting data from other types of sources, such as flat files. For more information about general sorting issues, see “Sorting data,” in Chapter 3, “Modifying data processing.”

Page 165: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 143

Specifying data source sorting using a graphical queryYou can change the order of the rows a query retrieves by specifying sorting for one or more columns in a graphical query. As you select columns for sorting using Query Editor, e.Report Designer Professional adds them to the ORDER BY clause of the SQL SELECT statement.

If your report includes group sections, the data source sorts by the group section sort key, then it sorts by additional columns that you specify in the graphical query. For information about overriding group section sorting, see “Overriding sorting by the group section sort key,” later in this chapter.

For an overview of how to handle sorting with data source queries, see “Specifying sorting,” earlier in this chapter. For more information about group sections, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to specify data sorting using Query Editor

1 In Query Editor, choose Order By.

Query Editor—Order By appears.

2 In Available Columns, select one or more columns as a sort key.

3 Choose the left arrow.

The column names appear in Order By.

4 To change the order of the columns in the sort key, in Order By, select the column name. Choose the up arrow or down arrow.

5 To sort a column in descending order, deselect Asc for that column, as shown in Figure 7-43.

Figure 7-43 Specifying data sorting

Select columnsAdd or remove column

Select ascending or descending alphabetical sort

Change column order in sort key

Page 166: Accessing Data

144 A c c e s s i n g D a t a

How to stop sorting by a particular column

To stop sorting by a column, select the column on Query Editor—Order By, and press Shift+Delete.

Specifying sorting for a textual queryIf your report includes group sections, e.Report Designer Professional sorts data primarily by the group section sort key, then it sorts by additional columns that you specify in the ORDER BY clause of your textual query. For information about overriding the automatic sorting that group sections provide, see “Overriding sorting by the group section sort key,” later in this chapter.

In Textual Query Editor, specify whether you want e.Report Designer Professional to:

■ Determine the necessary sorting, and add an appropriate ORDER BY clause to the query. Use the By Query option when you want e.Report Designer Professional to add a dynamic ORDER BY clause to the query at run time. This is the default sort option setting. For more information about editing SQL in Textual Query Editor, see “Changing the properties of a result column,” earlier in this chapter.

■ Assume that the data is sorted before it reaches e.Report Designer Professional. Use the Presorted option if your SQL query specifies sorting columns and order in an ORDER BY clause.

■ Rely on a sort filter. Use the By Filter option to use e.Report Designer Professional’s sort filter utility to sort the results data. Specify the sort option that you need by selecting an option from the Sort drop-down list in Textual Query Editor, as shown in Figure 7-44.

Figure 7-44 Selecting a sort option

For more information about sorting data in a report design, see “Sorting data” in Chapter 7, “Creating a database or ODBC query.”

Overriding sorting by the group section sort keyGroup sections contain a sort key. e.Report Designer Professional adds this sort key to the ORDER BY clause for a query. Typically, you do not override this functionality. If you do not want e.Report Designer Professional to add the sort key to the ORDER BY clause, you can specify that the data is presorted. Use this functionality when:

■ The query from a read-only library requires no modification.

Page 167: Accessing Data

C h a p t e r 7 , C r e a t i n g a d a t a b a s e o r O D B C q u e r y 145

■ The query performs specialized sorting, and you do not want e.Report Designer Professional to modify the sorting behavior that is specified in the query.

You can also modify the default behavior of how group section sort keys modify the query that is sent to the data source. For more information about customizing the effect of group section sort keys, see “Sorting data” in Chapter 3, “Modifying data processing.”

How to use presorted data

1 Right-click the report section component in Report Structure, and choose Properties.

The Properties page for the component appears.

2 For the Sorting property, choose Presorted from the drop-down list shown in Figure 7-45.

Figure 7-45 Indicating that the data is sorted in the data source

3 If you use a graphical query, go to Query Editor—Order By to provide the required row order. For more information about specifying sorting for a graphical query, see “Specifying data source sorting using a graphical query,” earlier in this chapter.

If you use a textual query, type the appropriate ORDER BY clause in Textual Query Editor. For more information about editing SQL in Textual Query Editor, see “Specifying sorting for a textual query,” earlier in this chapter.

Page 168: Accessing Data

146 A c c e s s i n g D a t a

Page 169: Accessing Data

C h a p t e r 8 , F i l t e r i n g d a t a 147

C h a p t e r

8Chapter 8Filtering data

This chapter contains the following topics:

■ About user-specified filtering in database and ODBC queries

■ Prompting the user to provide a specific value to filter results

■ Filtering query results with user-supplied expressions

Page 170: Accessing Data

148 A c c e s s i n g D a t a

About user-specified filtering in database and ODBC queries

When you build a query, you make the first pass at extracting certain data from the data source to use in your report. A report user can filter the data further if you create parameters that prompt the user to specify what to include in the report. You create one parameter for each question you want the user to answer. In a sales report, for example, you might create the following parameters: region, sales representative, customer name, customer credit rank, and customer purchase volume.

For each parameter, you can specify that the user needs to type the desired choice or select from a list of choices. If you want to provide a list, you can type the list of values or specify a query for e.Report Designer Professional to get the current list of values from the data in an information object column. With either type of list, you can enable the user to choose a parameter value directly or by choosing a corresponding display name for that parameter value.

The more parameters you create, the more control you give each user to generate specialized reports. Theoretically, you can create a parameter for each discrete piece of data but, for parameters to be effective and not overwhelming to the user, limit parameters to important fields. If you give the user control of what data appears in the report, consider also creating a parameter to prompt the user for a report title that describes the report’s contents. You can create a parameter to prompt for a report title. This section describes how to use parameters in queries. For general information about creating and using parameters, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

For databases and information objects, you can create two types of parameters for filtering data:■ A parameter that gives the user the option to specify an expression. For

example, you can create a parameter that asks the user to enter a customer state and enable the user to enter an expression, such as CA, !CA, CA|WA, or >M.

■ A parameter that prompts the user to provide a specific value. Using the customer state example, such a parameter requires the user to provide a specific value that exactly matches a state name in the data source, such as CA, OR, or WA.

Use parameters in a query to support users specifying filter conditions for a query. You can create parameters to support users specifying values or expressions to filter the results of the query.

Page 171: Accessing Data

C h a p t e r 8 , F i l t e r i n g d a t a 149

Prompting the user to provide a specific value to filter results

Create a parameter that prompts the user to provide a specific data value, instead of an expression, when it makes sense to limit the parameter to a single value. Examples of such requirements are minimum quantity and maximum quantity parameters.

This type of parameter is also suitable for answering questions such as the following:

■ What (one) state do you want information for?

■ What (one) invoice do you want to look at?

■ What (one) customer do you want information about?

You can use a static parameter to support users specifying the value of a column when they run reports. You can also have users specify values that are used in other parts of the SQL SELECT statement. When a user runs a report that contains static parameters, the viewing tool’s Requester page prompts the user for the value of each static parameter. The value is inserted into the SQL SELECT statement in place of the static parameter. You also can specify properties of the parameter, such as a default value, possible values, or that the parameter is required.

If you use the name of a parameter that does not yet exist, e.Report Designer Professional defines a local parameter. If you later define a parameter using the same name as the local parameter that e.Report Designer Professional defines, e.Report Designer Professional removes the local parameter. The parameter’s data type must be compatible with the data source column’s data type. A static parameter can be:

■ A local parameter

■ An inherited parameter

■ A global parameter

To use a static parameter, you perform the following steps in this order:

■ Use a static parameter to specify a condition or other part of SQL. You can use a simple call or SQL syntax to specify a condition that uses a static parameter. For more information about using a simple call to specify a condition that uses a static parameter, see “Using a simple call to a static parameter to specify a condition,” later in this section. For more information about using SQL syntax with a static parameter, see “Using SQL to specify a condition or other query clause,” later in this section.

Page 172: Accessing Data

150 A c c e s s i n g D a t a

■ If you use a textual query, prepare the textual query. For more information about preparing the textual query to use a static parameter, see “Preparing a textual query to describe a static parameter,” in this section.

■ Modify the parameter properties, as desired. For more information about modifying the parameter properties, see “Specifying a parameter’s property values,” in this section.

If you use an ODBC driver and want to use parameters in the SELECT statement, SQL-92 imposes limitations on where you can place a parameter in the SELECT statement. For more information about these limitations, see:

http://msdn.microsoft.com/library/default.asp?usr=/library/en-us/odbc/htm/odbcparameter_markers.asp

Using a simple call to a static parameter to specify a conditionTo create a parameter that requires the user to provide a specific data value, you use Query Editor—Conditions to enter an expression that defines what value the user must enter at run time. The following is an example of a simple expression that specifies selecting all records where the value is a specific state:

:State

The colon (:) indicates that State is a parameter for which the user provides a value, not a literal value for the query. e.Report Designer Professional creates a parameter called State.

The following is an example of a more complex expression that specifies selecting all records where the value is between quantity x and quantity y.

:QuantityMin - :QuantityMax

In this case, e.Report Designer Professional creates two parameters, QuantityMin and QuantityMax.

By default, when a user runs the report, the user sees the parameter names, such as State, QuantityMin and QuantityMax. You can change the parameter display names to make them more descriptive. You can also specify default values for parameters. If you do not specify a default value for a parameter that filters data in a column and the user does not enter any value for the parameter, the report is empty.

Figure 8-1 shows the definition of the State, QuantityMin, and QuantityMax parameters in the graphical query editor.

Figure 8-1 Definition of two parameters

Page 173: Accessing Data

C h a p t e r 8 , F i l t e r i n g d a t a 151

When a user runs the report, the Requester page provides a field in which the user can specify the state and the range of quantities to include in the report, as shown in Figure 8-2.

Figure 8-2 Requester page

Using SQL to specify a condition or other query clauseWhether you use a graphical query or a textual query, you can use SQL to specify a condition. For general information about using Query Editor to specify a condition in a graphical query, see “Adding conditions to a query” in Chapter 7, “Creating a database or ODBC query.” For general information about using a customized FROM clause, see “Modifying the generated FROM clause for a query” in Chapter 7, “Creating a database or ODBC query.”

You can include a condition in a textual query by adding a WHERE, HAVING, or other clause to a SQL SELECT statement. For more information about creating a SQL SELECT statement, see a SQL manual or the documentation for your database or ODBC data source.

You can use static parameters in your condition using the single colon syntax, as shown in the following example:

column <comparison op> :static_param

where

■ column is the name of the column.

■ <comparison op> is a comparison operator, such as one of the following symbols:

■ =

■ >

■ <

■ colon (:) specifies the location of a static parameter.

Page 174: Accessing Data

152 A c c e s s i n g D a t a

■ static_param is the name of the static parameter.

For example, the following SQL SELECT statement specifies the use of a static parameter called MyCity to populate the column:

select city from actest.offices WHERE city = :MyCity

A graphical query uses a static parameter that you specify in an expression at the bottom of Query Editor—Conditions or Query Editor—Having. Figure 8-3 shows a graphical query’s SQL condition that specifies the use of a static parameter called MyCity to populate the city column.

Figure 8-3 A SQL condition using a static parameter

Preparing a textual query to describe a static parameterIf you use a textual query, you must choose Describe Query after you type a condition with a static parameter. When you choose Describe Query to prepare and describe the query, Actuate e.Report Designer Professional provides information about the static parameter on Textual Query Editor—Static Parameters. For information about using Describe Query, see “Preparing the query” in Chapter 7, “Creating a database or ODBC query.”

Specifying a parameter’s property valuesYou can set the data type for a parameter in Textual Query Editor. You also can modify textual and graphical query parameters in the same way as any other parameter, by choosing Tools➛Parameters, selecting the parameter, and choosing Modify. The types of properties available varies by the data type and other choices that you make for the parameter on Parameter Properties. Some of the parameter properties you can set include:

■ Data type

■ Display name

■ Display length

■ Display style

■ Whether a user must supply a value

■ Whether the parameter is hidden from users

Page 175: Accessing Data

C h a p t e r 8 , F i l t e r i n g d a t a 153

This section includes instructions for changing the data type of a static parameter in Textual Query Editor. For information about changing the data type of an ad hoc parameter in Textual Query Editor, see “Modifying the property values of the ad hoc parameter,” later in this chapter. For information about using Parameter Properties to set any property values for any type of parameter, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to change the Actuate type for a static parameter in Textual Query Editor

To see the static parameter properties in the Textual Query Editor, choose Static Parameters. Figure 8-4 shows Textual Query Editor—Static Parameters after describing a query that uses a static parameter. The parameter name field contains the name that you used in your SQL code. Parameter names are not case-sensitive.

Figure 8-4 Selecting the Actuate data type for a parameter

The default Actuate type for a static parameter is String. To change the Actuate type, use the drop-down list. The parameter’s data type must be compatible with the data source column’s data type.

Filtering query results with user-supplied expressionsCreate a parameter that enables the user to specify a QBE (query by example) expression if you want to provide the flexibility to enter a value, a range of values, or other filtering conditions. This type of parameter is called an ad hoc parameter. Table 8-1 shows some examples of expressions a user can enter for a customer last name parameter, and the expected results.

Table 8-1 Examples of last name parameter expressions

Expression Gets these records

Atkins Customers with the last name, Atkins

A-M Customers with last names between A and M, excluding M.

Adams-Nelson Customers with last names between Adams and Nelson

>P Customers with last names starting with Q through Z

Peterman|Firelli Customers with the last name Peterman or Firelli

Page 176: Accessing Data

154 A c c e s s i n g D a t a

The flexibility available with this type of parameter is both an advantage and a disadvantage. The user needs to know how to construct valid expressions, and while Requester includes an expression builder to help the user build expressions, a novice report user can have trouble.

e.Report Designer Professional does not verify values that a user enters. If the user specifies an invalid expression or value, the report runs but it does not display any data. You should consider writing code to verify the values that users specify.

When a user runs a report that contains an ad hoc parameter, the viewing tool’s Requester page prompts the user for input. When the user types a value for the ad hoc parameter, the Requester page adds the ad hoc parameter’s corresponding conditional expression to the query’s WHERE clause.

Users can specify additional conditions using Query by Example (QBE) expressions. For more information about Query by Example expressions, see Working with Reports using Actuate Information Console.

Filtering a graphical query using a user-supplied expressionWhen you use an ad hoc parameter to allow or require a user to specify conditions that returned records must meet, you identify the name of a column, and the user supplies the condition for that column.

For information about using an ad hoc filter in a textual query, see “Filtering query results with user-supplied expressions,” later in this chapter.

How to support using an ad hoc expression to filter a graphical query

1 In Query Editor, chose Conditions.

2 On Query Editor—Conditions, in Column Name, type or select a column name, as shown in Figure 8-5.

Figure 8-5 Using an ad hoc expression to filter a graphical query

3 To indicate that an ad hoc expression completes the column, select Ad-Hoc.

4 If necessary, choose Ellipsis to change the parameter properties, such as data type, display name, display length, and display style. You can also specify whether a parameter is required or hidden. For more information about

Specify column name

Select to allow a user to enter conditions

Page 177: Accessing Data

C h a p t e r 8 , F i l t e r i n g d a t a 155

modifying parameter properties, see “Specifying a parameter’s property values,” earlier in this chapter.

Filtering a textual query using a user-supplied expressionWhen you use an ad hoc parameter to allow or require a user to specify conditions that returned records must meet, you identify the name of a column, and the user supplies the condition for that column.

To use an ad hoc parameter in the SQL code for a textual query, complete the following tasks in this order:

1 Include an ad hoc parameter in the query. For more information, see “Including an ad hoc parameter in a textual query,” later in this section.

2 Prepare the query to describe the parameter. For more information, see “Preparing a textual query to describe an ad hoc parameter,” later in this section.

3 Modify the property values of the parameter, if necessary. For more information, see “Modifying the property values of the ad hoc parameter,” later in this section.

For information about using ad hoc expressions in graphical queries, see “Filtering a graphical query using a user-supplied expression,” earlier in this chapter.

Including an ad hoc parameter in a textual queryYou can specify that e.Report Designer Professional insert the conditional expression for an ad hoc parameter in a SQL SELECT statement.

Examples of the required syntax follow:

<space>:?adhoc_param<space>

or:

<space>:?adhoc_param<end-of-statement>

You must use a leading space. The colon (:) and question mark (?) indicate an ad hoc parameter. The name of the ad hoc parameter is adhoc_param. A space follows an ad hoc parameter name, unless the parameter name is the last word in the SQL SELECT statement.

For example, the following SQL query specifies an ad hoc parameter that is called creditrank:

SELECT customname, creditrank from customers WHERE :?creditrank

Page 178: Accessing Data

156 A c c e s s i n g D a t a

Typically, the ad hoc parameter name is the same as the name of the column for which the user can specify a value. Parameter names are not case-sensitive. An ad hoc parameter cannot have the same name as a static parameter.

Preparing a textual query to describe an ad hoc parameterWhen you choose Describe Query to prepare and describe the query, Actuate e.Report Designer Professional provides information about the ad hoc parameter on Textual Query Editor—Adhoc Parameters. For information about using Describe Query, see “Preparing the query” in Chapter 7, “Creating a database or ODBC query.”

Modifying the property values of the ad hoc parameterYou can set the property values for an ad hoc parameter on Parameter Properties by choosing Ellipsis next to the ad hoc parameter on Textual Query Editor—Adhoc Conditions. You also can set the associated column name for an ad hoc parameter on Textual Query Editor—Adhoc Conditions. By default, e.Report Designer Professional fills in the parameter name as the name of the associated column. If you use a parameter name that is not the same as the name of the associated column, modify the value in Column Name appropriately.

Figure 8-6 shows a SQL SELECT query that specifies an ad hoc parameter. The lower part of the window displays the resulting values that appear on Textual Query Editor—Adhoc Conditions.

Figure 8-6 A SQL SELECT query that specifies an ad hoc parameter

For information about using Parameter Properties, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to change the name and data type of the column that is associated with an ad hoc parameter

On Textual Query Editor—Adhoc Conditions:

■ In Column Name, specify the column name to use with the ad hoc parameter. By default, the column name is the same as the parameter name.

■ In Expression Type, specify the Actuate Basic type of the column, as shown in Figure 8-7.

Page 179: Accessing Data

C h a p t e r 8 , F i l t e r i n g d a t a 157

e.Report Designer Professional uses these values to generate the appropriate syntax for the conditional expression that includes the ad hoc parameter.

Figure 8-7 Selecting the Actuate Basic type of a column

Page 180: Accessing Data

158 A c c e s s i n g D a t a

Page 181: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 159

C h a p t e r

9Chapter 9Maintaining a database or

ODBC queryThis chapter contains the following topics:

■ About maintaining database and ODBC queries

■ Timing and optimizing data source queries

■ Updating a query when the data source changes

Page 182: Accessing Data

160 A c c e s s i n g D a t a

About maintaining database and ODBC queriesTypically, after you create a database or ODBC query for a report design, you do not need to change it. You must, however, maintain the query if the data source structure changes. If your data source administrator deletes or renames tables and columns change, you must update your query to match. You can have e.Report Designer Professional determine whether the tables and columns have changed in the data source and synchronize your query to the modified data source. For information about synchronizing a query, see “Updating a query when the data source changes,” later in this chapter.

If you find that you need faster query performance for an existing query, you can time and tune the query. For information about tuning a query, see “Timing and optimizing data source queries,” later in this chapter.

Timing and optimizing data source queriesWhen you preview the data that a database query returns, the status bar on the bottom left lists performance statistics. For long-running queries, you can use these statistics to help tune your query.

You also copy the SQL statement your query sends to the data source and test its performance in a utility that your data source provides. Using the performance data and your knowledge of SQL, you can determine if you can optimize the SQL statement to provide the required results more efficiently. You can then modify the SQL statement in your query. To use this technique, you need to determine what SQL statement is sent to the data source. When you use a graphical query, you can view most of the information that you need on the SQL page of Query Editor. When you use a textual query, you type the SQL statement, but various features, such as parameters and sort keys, can modify the SQL statement.

For performance testing, capture the SQL statement as e.Report Designer Professional sends it to the data source as described in “Viewing the SQL SELECT statement that e.Report Designer Professional sends to the data source,” later in this chapter. To modify the SQL statement based on your testing, follow the procedures that are described in “Modifying the SQL code in a query to optimize the query,” later in this chapter.

For more information about the SQL page of Graphical Query Editor, see “Viewing the generated SQL SELECT statement” in Chapter 7, “Creating a database or ODBC query.” For information about creating a textual query, see “Creating a query by writing a SQL SELECT statement” in Chapter 7, “Creating a database or ODBC query.”

Page 183: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 161

Viewing the SQL SELECT statement that e.Report Designer Professional sends to the data sourceSort keys and conditions can modify the SQL code that appears in the upper part of Textual Query Editor or on Query Editor—SQL before the query is executed. For information about how the SQL statement can be modified by additional sort keys, see “Specifying sorting” in Chapter 7, “Creating a database or ODBC query.” For more information about how parameters in conditions can modify the SQL SELECT statement, see “Prompting the user to provide a specific value to filter results” and “Filtering query results with user-supplied expressions” in Chapter 8, “Filtering data.”

You can obtain the SQL SELECT statement that is sent to the data source by using the ObtainSelectStatement( ) method of the data source. For a graphical query, this method is part of the AcSqlQuerySource class. For a textual query, this method is part of the AcTextQuerySource class. For more information about AcSqlQuerySource and AcTextQuerySource, see Programming with Actuate Foundation Classes.

How to view the complete SQL SELECT statement that e.Report Designer Professional sends to the data source

1 In Report Structure, right-click the data stream component, and choose Properties.

2 On the Properties page for the component, choose Methods.

3 On the Methods page for the component, select Function ObtainSelectStatement( ) As String.

4 Choose Edit.

Method Editor appears, displaying the following code:

Function ObtainSelectStatement( ) As StringObtainSelectStatement = Super::ObtainSelectStatement( )

End Function

5 Above the following line:

End Function

type

ShowFactoryStatus(ObtainSelectStatement)

6 Choose Close.

7 On the Methods page for the component, choose Close.

8 Choose Report➛Build and Run.

9 On Requester, type desired values for any parameter.

Choose OK.

Page 184: Accessing Data

162 A c c e s s i n g D a t a

Report Viewer and Actuate Output appear.

Actuate Output contains the SQL SELECT statement that e.Report Designer Professional sent to the data source. You can copy this statement to test and tune it in your data source.

Modifying the SQL code in a query to optimize the queryAfter you extract the SQL SELECT statement from a query and tune it in your data source, you can incorporate the desired changes in the query in e.Report Designer Professional.

If you use a textual query, you change the SQL code directly. You can also change the sorting options. For information about editing the SQL in a textual query, see “Modifying the textual query” in Chapter 7, “Creating a database or ODBC query.” For information about modifying the sorting, see “Specifying sorting for a textual query” in Chapter 7, “Creating a database or ODBC query.”

If you want to programmatically override the statement that you input in Textual Query Editor, select the data source, and change the SelectStatement property of the AcTextQuerySource class. You can also modify the SetUpAdHocCondition( ) of the class to specify additional conditions for the query. For more information about AcTextQuerySource, see Programming with Actuate Foundation Classes.

If you use a graphical query, you can modify the performance by performing one or more of the following actions:

■ Modify the FROM clause of the query. For information about modifying the FROM clause of a graphical query, see “Modifying the generated FROM clause for a query” in Chapter 7, “Creating a database or ODBC query.”

■ Modify the conditions and summarization to change the WHERE, GROUP BY, and HAVING clauses. For information about specifying summarization in a graphical query, see “Summarizing data from multiple rows” in Chapter 7, “Creating a database or ODBC query.” For information about changing the conditions in a graphical query, see “Adding conditions to a query” in Chapter 7, “Creating a database or ODBC query.”

■ Modify the sorting to change the ORDER BY clause. For information about modifying sorting, see “Specifying sorting” in Chapter 7, “Creating a database or ODBC query.”

■ Modify the effect of group section sort keys on the ORDER BY Clause. For more information about customizing the effect of group section sort keys, see “Sorting data” in Chapter 3, “Modifying data processing.”

■ Convert a graphical query to a textual query, and edit it to include the desired optimizations. For information about converting a graphical query, see “Converting a graphical query to a textual query” in Chapter 7, “Creating a

Page 185: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 163

database or ODBC query.” For information about the differences between graphical and textual queries, see “Creating a query” in Chapter 7, “Creating a database or ODBC query.”

■ You can also override the ObtainSelectStatement method of the data stream to insert your own SQL statement. To override this method, replace the call to Super::ObtainSelectStatement( ) in the method with your own code. If you want to override only particular clauses, Table 9-1 describes the variables that you can override in AcSQLQuerySource.

Updating a query when the data source changesIf the data source changes, an existing query can refer to tables or columns that no longer exist or have changed. If you know that the data source changed, you can check a query and modify it as needed. Otherwise, you can discover and address the situation when the query produces a data source error. You also can send SQL statements from e.Report Designer Professional to update the database or other ODBC data source. For more information about updating a data source from e.Report Designer Professional, see “Sending SQL statements to change the data source,” later in this chapter.

If you use a textual query, you must know what changes to make to synchronize the query with the data source. With a textual query, synchronize only the items to which the query refers. For more information about maintaining a textual query, see “Updating a textual query when the data source changes,” later in this chapter.

If you use a graphical query, you can request that e.Report Designer Professional synchronize the query. e.Report Designer Professional synchronizes all tables and columns in the data source, even if the graphical query only uses a few of them. For more information about maintaining a graphical query, see “Updating a graphical query when the data source changes,” later in this chapter.

Table 9-1 Variables that you can override in AcSQLQuerySource

Variable SQL SELECT clause

Dim SelectClause As String SELECT clause

Dim FromClause As String FROM clause

Dim WhereClause As String WHERE clause

Dim GroupByClause As String GROUP BY clause

Dim HavingClause As String HAVING clause

Dim OrderByClause As String ORDER BY clause

Page 186: Accessing Data

164 A c c e s s i n g D a t a

Sending SQL statements to change the data sourceYou can create and send your own SQL statements to a database or ODBC data source. For example, you can send a SQL statement to update a record, drop a table, and so on by calling the statement’s Execute( ) method after Prepare( ). Use the statement’s Execute( ) method only to execute a statement that does not return data rows, such as UPDATE, DELETE, or DROP TABLE. To execute a SQL statement that returns rows, use a cursor.

How to execute a SQL statement that does not require a cursor

1 Establish the connection.

2 Prepare the SQL statement using the connection’s Prepare( ) method.

Prepare( ) returns a reference to the DB Statement object.

3 If the SQL statement accepts parameters whose values are provided later, use the statement’s BindParameter( ) method to bind the parameters to the values.

4 Execute the statement using the statement’s Execute( ) method.

Execute( ) returns True or False, depending on whether the statement runs successfully.

5 The Factory or custom code deletes the statement.

6 The Factory or custom code deletes the connection.

For more information about Actuate Foundation classes and the Factory, see Programming with Actuate Foundation Classes.

Updating a textual query when the data source changesThe only data source changes that affect a textual query are changes to the tables and columns that the SQL statement in the textual query uses. In a textual query, e.Report Designer Professional does not store additional information about the data source tables and columns.

Table 9-2 specifies the type of change to make to synchronize a textual query after a data source change.

Table 9-2 Types of changes required to synchronize a textual query with a changed data source

Object Change Query synchronization

Table Name Change the name of the table wherever it appears in the query.

Join columns Change the WHERE clause appropriately.

Page 187: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 165

For more information about maintaining a data source query, see “Updating a query when the data source changes,” earlier in this chapter. For more information about editing the SQL statement, see “Modifying the textual query” in Chapter 7, “Creating a database or ODBC query.” For more information about modifying the Actuate data type for columns, see “Changing the properties of a result column” in Chapter 7, “Creating a database or ODBC query.” For more information about modifying the Actuate data type for parameters, see “Specifying a parameter’s property values” in Chapter 8, “Filtering data.”

Updating a graphical query when the data source changesA report object design (.rod) file or report object library (.rol) file that has a graphical query stores the relevant structure of the data source, which is known as the database schema or data dictionary. The database schema evolves as the database design evolves. Therefore, a query in a report object design that originally addressed a certain set of tables and views in a data source can become out of sync with the database schema, and the data source to which it connects. e.Report Designer Professional displays and must synchronize all the tables and columns in the data source, even if the SQL SELECT statement that is generated by the graphical query uses only a few of them.

The query synchronization tools in e.Report Designer Professional help you work with the problem of data source changes by:

■ Displaying and analyzing the differences between the tables, views and columns that are defined in the query and those in the data source. You can

Column Name Change the name of the column wherever it appears in the query.

Datatype Make all other synchronization changes first, then describe the query. Next, change the Actuate data type on Textual Query Editor—Column. If your query uses a static parameter to specify the value for a parameter, change the Actuate data type of the static parameter on Textual Query Editor—Static Parameters. If your query uses an ad hoc parameter to specify the value for a parameter, change the Actuate data type of the ad hoc parameter on Textual Query Editor—Adhoc Conditions.

Table 9-2 Types of changes required to synchronize a textual query with a changed data source (continued)

Object Change Query synchronization

Page 188: Accessing Data

166 A c c e s s i n g D a t a

add, delete or rename tables, views and columns. You can also change the column data type.

■ Modifying tables, views, and columns to synchronize the query to the data source. Synchronization preserves all conditions, sorting, and other information in a query. The query synchronization process contains several updating features. For example, you can choose to accept an update, which adds new columns and changes column data types as necessary.

■ Verifying that a SQL statement has valid syntax. You also can choose to verify a SQL statement without synchronizing the query.

Synchronization does not change:

■ The data type of a control that the report uses to display a column. e.Report Designer Professional’s Factory checks for the compatibility of data columns and controls at report build time. The build process also checks for incompatible or deleted column types.

■ Customized and developer-defined methods. Synchronization does not report or update customized or developer-defined methods that refer to a parameter or row variable that changed as a result of synchronization.

When you synchronize a query, the following steps occur in this order:

■ Making a backup copy of your report file. Your report changes when you accept updates during synchronization. Consider making a backup copy of your file before you begin the synchronization process in case you want to undo any of your changes.

■ Ensuring that a query connects to the correct data source. For information about ensuring that a query connects to the correct data source, see “Ensuring that a query connects to the correct data source,” later in this chapter.

■ Updating the data dictionary during synchronization. For information about specifying that synchronization updates the data dictionary, see “Updating the data dictionary during synchronization,” later in this chapter.

■ Determining whether a graphical query and its data source are synchronized. For information about determining whether a graphical query and its data source are synchronized, see “Determining whether a graphical query and its data source are synchronized,” later in this chapter.

■ Synchronizing a graphical query. For more information about updating tables, views, and columns in a graphical query, see “Synchronizing a graphical query,” later in this chapter.

■ Verifying that synchronization is complete. For more information about verifying that synchronization is complete, see “Verifying that synchronization is complete,” later in this chapter.

Page 189: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 167

Ensuring that a query connects to the correct data sourceWhen you work with several versions of a data source, you can lose track of the one to which you are connected. For query synchronization to work effectively, the report design must refer to the correct data source. Ensure that you connect to the correct data source before you begin synchronization.

Some databases, such as Microsoft Access, are accessed using a data file. However, most databases, such as Oracle, are accessed using a connection to a database client. You connect to and install a database or ODBC data source that you access using a file differently from one that you access using a client.

How to ensure that you connect to the correct data source that you access using a client

If you access the database or ODBC data source using a client, Query Editor displays the qualified data source name, such as AcTestDB, in Database Browser, as shown in Figure 9-1.

Figure 9-1 Database Browser, displaying the qualified data source name

1 In Query Editor, right-click a table, and choose Properties.

Query Editor—Table Property appears.

2 Change the qualifier to the correct database or ODBC data source, if necessary.

3 Choose Apply.

How to ensure that you connect to the correct file-based data source

With a file-based data source, such as MS Access, ensure that the full path names match if:

■ You installed your version of e.Report Designer Professional in a nonstandard location.

■ You are unsure of the full path names of the database or ODBC data sources with which you are working.

To determine whether file paths match, complete the following steps:

1 In Query Editor, right-click a table, and choose Properties.

Query Editor—Table Property appears.

Compare the path name that appears at the top of Database Browser with the qualified path name that appears on Query Editor—Table Property. Database Browser displays the name of the connected data source and its installed location, as shown in Figure 9-2.

Page 190: Accessing Data

168 A c c e s s i n g D a t a

Figure 9-2 Database Browser, displaying the full path of the connected data source

2 If these path names do not match, complete the following steps:

1 On Query Editor—Table Property, change the file path to the correct path of the database or ODBC data source to which you want to connect, as shown in Figure 9-3.

Figure 9-3 Changing the file path

2 Choose Apply to initiate the table consistency check.

3 Choose Close.

Updating the data dictionary during synchronizationQuery synchronization examines the data dictionary that e.Report Designer Professional stores with the report object design (.rod) or report object library (.rol) file. The data dictionary is basically a copy of the database schema for the connected database or ODBC data source. The database schema of the connected data source can change while Query Editor is open. In this case, you must refresh the data dictionary with the database schema information. Refreshing the data dictionary while checking a query ensures that you have the correct data dictionary information.

How to set synchronization to refresh the data dictionary

1 In Query Editor, choose Tools➛Options.

Options—Design Editor appears.

2 Choose Query Editor.

Options—Query Editor appears.

3 Select Refresh Data Dictionary when checking a query, as shown in Figure 9-4.

Page 191: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 169

Figure 9-4 Indicating that you want e.Report Designer Professional to refresh the data dictionary when checking a query

Choose OK.

Determining whether a graphical query and its data source are synchronizedWhen you synchronize a query, e.Report Designer Professional reports any differences between the database schema and the graphical query’s information about the database schema.

How to determine whether a graphical query is synchronized

1 In Query Editor, choose SQL➛Synchronize Query.

The results depend on whether the query is synchronized:

■ If the query is not synchronized, Synchronize Query With Schema appears.

■ If the query is synchronized, e.Report Designer Professional displays the following message:

The query definition is synchronized with the database schema.

2 If the query is synchronized with the data source:

Page 192: Accessing Data

170 A c c e s s i n g D a t a

1 Choose OK.

If the query creates a valid SQL statement, e.Report Designer Professional displays the following message:

Statement is valid.

2 Choose OK.

3 If the query is not synchronized, Synchronize Query With Schema appears, as shown in Figure 9-5. On Synchronize Query With Schema:

1 Examine the list of tables from the FROM clause of the query that no longer appear in the database schema.

2 In Columns, examine the fully qualified names of tables and their columns that have changed. If a table has an alias, the table appears under each of its aliases.

Columns also displays the type of change that e.Report Designer Professional detects for the table or column during synchronization. The Old DB type column displays the column data type that is stored in the query, and the New DB Type column displays the data type that was detected in the database or ODBC data source.

Figure 9-5 Synchronization error messages

To synchronize the query, see the following section, “Synchronizing a graphical query.”

Page 193: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 171

Synchronizing a graphical queryIf Synchronize Query With Schema reports synchronization problems, complete the following steps to update the tables, columns, and views in a graphical query:

1 On Synchronize Query With Schema, choose Accept Update to update the new table definitions.

Columns that are not synchronized are highlighted and labeled in the upper part of the query editor, as shown in Figure 9-6.

Figure 9-6 Query Editor, highlighting an unsynchronized column in the items table and all columns in customers, a missing table

Information about the following synchronization issues appears on Actuate Output, as shown in Figure 9-7:

■ Items to which the query refers that have been modified

■ Tables and columns that are not found but to which the query refers

Figure 9-7 Actuate Output, showing synchronization issues

You can use the content of Actuate Output as a checklist to track the changes that you make to the query.

2 Double-click an item in Actuate Output. Either a message appears and advises you how to proceed, or the appropriate tool to make the necessary change appears, as described in the following list:

■ Table invalid or not found

Double-clicking this type of entry opens Query Editor—Table Property, as shown in Figure 9-8. On Query Editor—Table Property, rename the table in the query to match the table name in the database or ODBC data source.

Page 194: Accessing Data

172 A c c e s s i n g D a t a

Figure 9-8 Table properties

If the table is obsolete and does not need to be replaced, go to the table’s context menu, as shown in Figure 9-9, and remove the table.

Figure 9-9 The table’s context menu

■ Column not found

Double-clicking this type of entry opens Change Column Used in Query, as shown in Figure 9-10. On Query Editor—Change Column Used in Query, change the original column reference to a valid reference, or remove all references to the column from the query.

In the New column, a drop-down list displays all available valid names in the stored table definition of the data dictionary. Changing the column name fixes the query by replacing the original column name with the new

Page 195: Accessing Data

C h a p t e r 9 , M a i n t a i n i n g a d a t a b a s e o r O D B C q u e r y 173

column name. The new column name replaces the old column name on Query Editor—Columns and in the upper part of Query Editor.

Removing column references removes all references to the original column in the query, including from the query statement.

Figure 9-10 Change Column Used in Query

If the table that contains the problem column no longer exists in the database or ODBC data source, resolve the table problem before you change the column. Figure 9-11 shows sample output for when a table and its columns do not exist in the database or ODBC data source.

Figure 9-11 Actuate Output, indicating that a table is missing

■ Other issues

If a message appears instead of a tool, follow the instructions in the message to resolve the synchronization issue. For example, if e.Report Designer Professional cannot find a a particular column, it displays a message like the following message:

The column Year is defined in table C:\Projects\Chart\Examples\Database\ChartExamples.RegionalSales which cannot be found. Change the table property to reference the appropriate table or remove the table from the query.

Verifying that synchronization is completeAfter you complete the changes to the columns, tables, and views to eliminate synchronization errors, complete the following steps:

Page 196: Accessing Data

174 A c c e s s i n g D a t a

1 Verify that no tables or columns are highlighted in Query Editor.

Highlighting in Query Editor indicates that synchronization issues exist for the table or column.

2 Choose SQL➛Synchronize Query.

If the query’s stored table definition is synchronized with the data source, e.Report Designer Professional displays the following message:

The query definition is synchronized with the databaseschema.

If the query is synchronized, the synchronized processes verify that the SQL statement syntax is valid. e.Report Designer Professional passes SQL syntax verification to the connected database or ODBC data source server for processing. The server’s scope of syntax checking varies by vendor. If the SQL statement is not valid, e.Report Designer Professional displays an appropriate error message. When checking is complete, e.Report Designer Professional displays the following message:

Statement is valid.

Page 197: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 175

C h a p t e r

10Chapter 10Accessing data using a

stored procedureThis chapter contains the following topics:

■ About accessing a database using a stored procedure

■ Preparing to use a stored procedure to access a database

■ Designing a report that uses a stored procedure

■ Selecting a stored procedure

■ Working with data from a stored procedure

■ Using parameters with stored procedures

■ Ensuring that the stored procedure is synchronized with the database

■ Using Oracle stored procedures

■ Customizing access to handle specific databases or multiple result sets

Page 198: Accessing Data

176 A c c e s s i n g D a t a

About accessing a database using a stored procedureTo access data from a database, you use a query or a stored procedure. A stored procedure is a block of SQL statements that perform a specific task. An Actuate report can call a stored procedure in a database that supports stored procedures. Use of a stored procedure improves data access performance by reducing the amount of information that is sent over a network. You can use a stored procedure to execute any database task, such as modifying, inserting, or deleting records or exchanging data between the database and an Actuate report.

Actuate e.Report Designer Professional supports the automated stored procedure features of the following databases:

■ Databases that are accessed through ODBC, including Oracle, PeopleSoft, and Progress.

■ Oracle9i, Oracle 9.2, or Oracle 10g R1 databases that are used with an Oracle9i client

■ IBM DB2 databases

To access a database using a stored procedure, complete the following tasks in this order:

■ Create a report that accesses a stored procedure data source.

For information about creating a report that accesses a stored procedure data source, see “Designing a report that uses a stored procedure,” later in this chapter.

■ Select a stored procedure.

For information about selecting a stored procedure, see “Selecting a stored procedure,” later in this chapter.

■ Place data from the stored procedure in the report design.

For information about selecting a stored procedure, see “Working with data from a stored procedure,” later in this chapter.

■ If your procedure uses parameters, you might need to specify the type of parameter or specify a sample value.

For information about handling parameters for a stored procedure, see “Using parameters with stored procedures,” later in this chapter.

■ As part of the general maintenance of your report, periodically synchronize your stored procedure to verify that the definition of the stored procedure has not changed in the database.

For information about synchronizing a stored procedure, see “Ensuring that the stored procedure is synchronized with the database,” later in this chapter. You

Page 199: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 177

can work with a stored procedure by using the stored procedure tools in e.Report Designer Professional or by overriding an Actuate Basic method to customize accessing a stored procedure. This chapter discusses both techniques.

To access a stored procedure that returns a single result set, use Stored Procedure Data Source Builder. To process multiple result sets, you must override a method that modifies the SQL statement. For information about overriding a method to work with a stored procedure, see “Customizing access to handle specific databases or multiple result sets,” later in this chapter.

Preparing to use a stored procedure to access a database

Before using a stored procedure to access a database, you must:

■ Provide the database or ODBC connection.

To access data using a stored procedure or SQL query, e.Report Designer Professional requires the computer to have a database connection or a connection to an ODBC data source.

■ Define a database connection component.

Define a database connection component in e.Report Designer Professional to use the database or ODBC connection.

You need the following information:

■ The name of the data source

■ User name and password for the database login

■ Name of the stored procedure

■ Names of the stored procedure’s result fields that the report requires

With some types of databases, you also need the following information:

■ Whether a parameter is an input or output parameter

■ Whether the procedure is a user procedure or a system procedure, if you want to limit the procedures that are available for selection

Designing a report that uses a stored procedureA report that uses a stored procedure requires a connection to a data source that stores procedures. It also requires the StoredProcedureSource data stream. You can place this data stream in an existing report or you can insert it when you create a blank report.

Page 200: Accessing Data

178 A c c e s s i n g D a t a

How to design a report that uses a stored procedure

To build a new report that accesses and works with a stored procedure:

1 In e.Report Designer Professional, choose File➛New.

2 In Create New Report, select Blank Report. Choose OK.

3 Select the connection component, as shown in Figure 10-1.

Figure 10-1 The connection component

Right-click, and choose Properties.

Properties—Properties displays the properties for the connection.

4 Set the database connection properties, as shown in Figure 10-2. The type of database determines which properties are required.

Figure 10-2 Setting the database connection properties

Choose OK.

5 In Report Structure, right-click DataStream. Choose Delete.

DataStream is empty, as shown in Figure 10-3.

Figure 10-3 An empty DataStream slot

6 Drag a database source component from Toolbox—Data, and drop it in DataStream, as shown in Figure 10-4.

Page 201: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 179

Figure 10-4 Adding a database source component

7 In Select Component, select Stored Procedure Data Source, as shown in Figure 10-5.

Figure 10-5 Selecting Stored Procedure Data Source

Choose OK.

The stored procedure data source appears in the report design, as shown in Figure 10-6. This component connects to a data source that contains a stored procedure. You can add this component to an existing report or insert it in the report design when you build a blank report.

Figure 10-6 Report Structure, showing the stored procedure data source

You are now ready to select a stored procedure to use in your report.

Selecting a stored procedureAfter you set up the report design, you can select a stored procedure to create a stored procedure component.

Page 202: Accessing Data

180 A c c e s s i n g D a t a

How to select a stored procedure

1 In e.Report Designer Professional, right-click DataStream—StoredProcedureSource, and choose Data Source.

Database Login appears if the data source requires login information.

2 Type any required information, as shown in Figure 10-7.

Figure 10-7 Providing login information

Choose OK.

Stored Procedure Data Source Builder appears. If the database contains multiple stored procedures, Stored Procedure Data Source is blank, and Stored Procedure Browser also opens, as shown in Figure 10-8.

Figure 10-8 Stored Procedure Browser

You also can access Stored Procedure Browser by right-clicking DataStream—StoredProcedureSource and choosing Sample Parameter Values when Stored Procedure Data Source Builder is open.

3 If Stored Procedure Browser appears, double-click the name of the stored procedure that you want to use.

If the stored procedure uses parameters, Sample Parameter Values appears, as shown in Figure 10-9. Sample Parameter Values supports using a sample

Page 203: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 181

input value for a parameter with a stored procedure. You also can access this tool by right-clicking DataStream—StoredProcedureSource and choosing Sample Parameter Values when Stored Procedure Data Source Builder is open.

Figure 10-9 Sample Parameter Values

4 If Sample Parameter Values appears, choose OK.

The procedure appears in Stored Procedure Data Source Builder. This tool supports viewing and modifying details about the stored procedure.

In Figure 10-10, the stored procedure produces information that appears on the Result Columns page. Some stored procedures, however, are internal functions that do not return data to users.

Figure 10-10 Result Columns

Page 204: Accessing Data

182 A c c e s s i n g D a t a

If any of the stored procedure’s result columns have the same name, Actuate e.Report Designer Professional adds a suffix to each duplicate column name so that every column name is unique. For example, if two result columns have the name MYCOL, e.Report Designer Professional renames one of them MYCOL_1.

Changing the name of a stored procedure componentStored Procedure Name Editor, as shown in Figure 10-11, supports modifying the name of the stored procedure component. You access this tool by right-clicking DataStream—StoredProcedureSource and choosing Stored Procedure Name Editor when Stored Procedure Data Source Builder is open.

Figure 10-11 Stored Procedure Name Editor

If you edit the name, ensure that the stored procedure’s parameter and result columns are consistent with the new name.

Limiting which stored procedures are available for selectionWhen you select a stored procedure, you can select from a list of some or all of the stored procedures. A feature that is available on Options—Stored Procedure supports narrowing the list of stored procedures.

How to limit which stored procedures appear in the selection list

1 Choose Tools➛Options➛Stored Procedure, as shown in Figure 10-12.

2 On Stored Procedure, indicate whether you want to view and work with user procedures, system procedures, or both.

If your database cannot distinguish between user procedures and system procedures, these settings have no effect, and all stored procedures appear for selection.

3 To narrow the list of stored procedures, type a search expression for Stored procedure pattern match, such as:

"*Salary*"

Using this expression, Stored Procedure Browser lists only stored procedures with Salary in the name.

Page 205: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 183

Figure 10-12 Options—Stored Procedure

Working with data from a stored procedureAfter you build a report, access the stored procedure data source, and select a stored procedure, you can add data from the stored procedure to your report layout.

How to place data from a stored procedure in a report design

1 Select the frame in the Content slot of your report design to make it active.

2 Choose View➛Fields.

The controls from the stored procedure are now available to drag from the list and drop in the frame of the report design.

The list of controls in Fields matches the list in Result Columns in Stored Procedure Data Source Builder. Fields displays the controls in alphabetical order, as shown in Figure 10-13. Result Columns displays them in the order used in the stored procedure definition.

3 From Fields, drag the items that you want to appear in the report, and drop them in the Content frame.

Page 206: Accessing Data

184 A c c e s s i n g D a t a

Figure 10-13 Fields

4 Arrange controls in the frames. You typically place column headers and controls for totals in Before and After frames, as shown in Figure 10-14.

Figure 10-14 Arranging controls in the frames

5 Choose Report➛Build and Run.

If the stored procedure uses parameters, e.Report Designer Professional prompts the user to type an input parameter value, as shown in Figure 10-15. In this example, 3 is the value of the input parameter. After you supply the necessary input parameter values, choose OK.

Figure 10-15 Requester

The report appears, as shown in Figure 10-16.

Figure 10-16 The report output

Page 207: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 185

Using parameters with stored proceduresStored procedures can use input and output parameters. If your stored procedure uses parameters, you may need to perform the following tasks:

■ Specifying whether parameters are input or output parameters

■ Working with a sample value for an input parameter

Specifying whether parameters are input or output parametersIf you use ODBC, Actuate software sets parameters to the correct type, either input or output. Some vendors’ database systems do not provide information about whether a stored procedure parameter is an input or output type. If this is the case, UNKNOWN appears beside the parameter name on Stored Procedure Data Source Builder—Parameters, under Input/Output. If UNKNOWN appears, you must designate the parameter type in Stored Procedure Data Source Builder.

■ The parameter’s type determines how e.Report Designer Professional handles the variable for that parameter:e.Report Designer Professional generates the name of an input parameter variable. Typically, the name of the variable is the same as the parameter name in the stored procedure. Then, e.Report Designer Professional attempts to match the name of the input parameter variable to one of the following types of parameters:

■ A local parameter

■ An inherited parameter

■ A global parameter that you defined earlier

If there is no parameter definition, e.Report Designer Professional defines a local parameter. If the name of the input parameter variable conflicts with the name of a variable that is not a parameter, e.Report Designer Professional appends an underscore and a number to the name, such as MYPARAM_1.

■ e.Report Designer Professional stores an output parameter as a variable on the stored procedure component.

How to designate a parameter type

1 In Stored Procedure Data Source Builder, choose Parameters, and review the data.

2 In the Input and Output column for parameters that have an Input and Output designation of UNKNOWN, indicate whether the parameter is an input parameter, an output parameter, or both, as shown in Figure 10-17.

Page 208: Accessing Data

186 A c c e s s i n g D a t a

Figure 10-17 Indicating whether a parameter is an input parameter, output parameter, or both

The named field items that you specify as input parameters appear on Requester when a user runs the report, as shown in Figure 10-18.

Figure 10-18 Requester, showing the input parameters

Working with a sample value for an input parameterTo obtain and display information about the columns, Stored Procedure Data Source executes the stored procedure. Sometimes, a stored procedure returns different types of result sets according to input parameter values. To get the appropriate result set, Stored Procedure Data Source Builder displays a prompt for a parameter’s values if the stored procedure requires input parameter values.

How to specify a sample value for an input parameter

1 To determine whether the stored procedure uses parameters, choose Parameters in Stored Procedure Data Source Builder, as shown in Figure 10-19.

Page 209: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 187

Figure 10-19 Parameters for the stored procedure

If the report uses or requires parameters from the stored procedure, the following information is available on Stored Procedure Data Source Builder—Parameters:■ The name of the field from the stored procedure that uses a parameter■ Whether the parameter is an input or an output parameter■ The Actuate Basic type of the parameter, which can be any of the following

types:❏ CPointer❏ Currency ❏ Double❏ Date❏ Integer❏ String

If e.Report Designer Professional requires an input value for a stored procedure to determine the result column, e.Report Designer Professional displays Sample Parameter Values to enable you to specify that input value.

2 If Sample Parameter Values appears, as shown in Figure 10-20, type a parameter value, such as 3, in the Value column for each parameter.

Figure 10-20 Sample Parameter Values

Choose OK.

Page 210: Accessing Data

188 A c c e s s i n g D a t a

Ensuring that the stored procedure is synchronized with the database

A stored procedure in your database can change between the time of the original report design and when you run it in a report. It is a good practice to verify that the stored procedure that you use is current. Use Check Stored Procedure to determine whether the content of a stored procedure in your design is consistent with its definition in the database.

To verify whether a stored procedure is synchronized, edit the data source component. If prompted, log into the database. Select the stored procedure to verify and then choose SQL➛Synchronize Stored Procedure. If the stored procedure uses input parameters, Sample Parameter Values appears so you can specify values for the input parameters.

If the stored procedure does not use parameters, a message appears, indicating whether the stored procedure definition is consistent with the database’s definition of the stored procedure. appears. A message appears, indicating whether the stored procedure definition in e.Report Designer Professional is consistent with the database’s definition of the stored procedure.

Using Oracle stored proceduresStored Procedure Data Source Builder supports Oracle stored procedures and stored functions. Do not use Oracle stored procedures and stored functions that return parameters with Boolean, indexed table, or record data types. Oracle Call Interface does not support returning parameters with those data types. You must execute a stored procedure or stored function to determine the columns in the result set. To execute a stored procedure or stored function, enter sample values for the input parameters on Sample Parameter Values.

In some cases, a stored procedure or stored function returns different columns depending on the values of the input parameters and how the stored procedure or stored function is defined. The columns in the result set, therefore, might not correspond to the controls in your report design. Stored Procedure Data Source Builder supports a weak cursor-type definition if it always returns the same set of result columns. A weak cursor supports determining the return type when the report runs.

Page 211: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 189

Using Oracle data typesFor Oracle stored procedures, Actuate products support retrieving NCHAR and NVARCHAR2 data types with the following limitations:

■ NCHAR support includes the use of NCHAR data types in the result set but not for input, output, or input and output parameters.

■ You cannot use static or ad hoc parameters or conditions on an NCHAR database column.

■ Actuate supports NCHAR data types in its native Oracle DBMS module, not in its ODBC DBMS module.

You can use these data types with alternate character sets. They map to the Actuate String data type.

Accessing stored functionsA stored function is a stored procedure that returns a function value. The returned value can have any data type that Oracle supports, and it can be a cursor variable. If a stored function returns a cursor variable, Stored Procedure Data Source Builder can process the result set.

Identifying stored procedures and stored functionsThe Stored Procedure Browser displays the type and scope of each stored procedure and stored function. The following icon identifies a stored function:

A stored procedure or a stored function can be part of a packaged procedure. The procedure or function’s full name appears in Stored Procedure Browser as qualifier.package.procedurename, as shown in Figure 10-21.

Figure 10-21 Stored procedures and stored functions

Stored function

Stored procedure

Page 212: Accessing Data

190 A c c e s s i n g D a t a

The Oracle schema maps to the Actuate qualifier.

Processing additional cursors that a procedure or function returnsStored Procedure Data Source Builder supports only stored procedures and stored functions that return one result set, not multiple result sets. If a stored procedure or stored function uses multiple cursor parameters, e.Report Designer Professional and Actuate iServer processes the first cursor parameter and ignores the others. e.Report Designer Professional and Actuate iServer can process a cursor parameter other than the first if the cursor parameter’s result columns match the default set in Stored Procedure Data Source Builder. To process a cursor parameter other than the first, override AcStoredProcedureSource::OpenCursor( ), as shown in the following example. The cursor parameter name must not include a colon (:).

Sub OpenCursor( stmtText As String)CursorParameter = "MGRCURSOR"Super::OpenCursor( stmtText )

End Sub

Understanding how e.Report Designer Professional works with a stored functionThe report design in the following example uses the stored function REFCUR3.GETMGRDATA to retrieve data from the EMP table in the SCOTT database schema. The report user determines which data to retrieve by typing a value for the DEPTNO column as an input parameter in Requester.

About the EMP table in the exampleThe EMP table contains the data shown in Figure 10-22.

Figure 10-22 The EMP table

Page 213: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 191

About the stored functionThe following example shows the code for the stored function REFCUR3.GETMGRDATA. This stored function defines two cursor parameters, EMPCURSOR and MGRCURSOR. The Stored Procedure Data Source Builder processes the first cursor, EMPCURSOR.

create or replace package refCur3 ascursor c1 is select ename, deptno from emp;cursor c2 is select ename, ename AS manager, hiredate from

emp;type empCur is ref cursor return c1%ROWTYPE;type mgrCur is ref cursor return c2%ROWTYPE;

function GetMgrData(indeptno IN NUMBER,EmpCursor in outempCur,deptAcct OUT NUMBER )RETURN mgrCur;

END;

create or replace package body refCur3 asfunction GetMgrData(indeptno IN NUMBER,EmpCursor in out

empCur,deptAcct OUT NUMBER )

RETURN mgrCur is

MgrCursor mgrCur;begin

open EmpCursor for select ename, deptno from emp wheredeptno = indeptno;

open MgrCursor for select e.name, n.ename AS MANAGER,e.hiredate

from emp n, emp ewhere e.mgr= n.empno and e.deptno= indeptno ;

deptAcct := indeptno + 100;return MgrCursor;

end;end;

Figure 10-23 shows the report structure.

Page 214: Accessing Data

192 A c c e s s i n g D a t a

Figure 10-23 The report structure

About the result columns and parametersStored Procedure Data Source Builder displays result columns and parameters for the stored function REFCUR3.GETMGRDATA.

Figure 10-24 and Figure 10-25 show result columns and parameters, respectively.

Figure 10-24 The result columns

Figure 10-25 The parameters

Result columns

Oracle connection

Stored procedure component

Page 215: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 193

Figure 10-26 shows variables that e.Report Designer Professional creates on the stored procedure component for the DEPTACCT and INDEPTNO parameters.

Figure 10-26 The variables

The Actuate Basic code that is generated for the report design declares a CPointer parameter type for EMPCURSOR and assigns the cursor parameter to an Actuate cursor, AcDBCursor:

Class DataSource Subclass Of AcStoredProcedureSource

Dim DEPTACCT_output As DoubleStatic INDEPTNO As Double

Sub SetProperties ( )Super::SetProperties ( )ProcedureName = "REFCUR3.GETMGRDATA"OwnerName = ""QualifierName = "SCOTT"QualificationOption = "UNQUALIFIED"ReturnParameter = ":acProcStatus"ActualParameters = " :INDEPTNO , :EMPCURSOR ,

:DEPTACCT"CursorParameter = "acProcStatus"

End Sub

Sub BindStaticParameters( stmt As AcDBStatement )stmt.DefineProcedureInputParameter ( "INDEPTNO" ,

INDEPTNO )stmt.DefineProcedureOutputParameter ( "EMPCURSOR" ,

V_CPOINTER, NULL )stmt.DefineProcedureOutputParameter ( "DEPTACCT" ,

V_DOUBLE )stmt. DefineProcedureReturnParameter ( "acProcStatus" ,

V_CPOINTER )End Sub

Sub BindDataRow( cursor As AcDBCursor )cursor.BindColumn( 1, "NewReportApp::DataRow" ,

"ENAME" )cursor.BindColumn( 3, "NewReportApp::DataRow" ,

"HIREDATE" )

Page 216: Accessing Data

194 A c c e s s i n g D a t a

cursor.BindColumn( 2, "NewReportApp::DataRow" ,"MANAGER" )

End Sub

Sub GetOutputParameters( cursor As AcDBCursor )DEPTACCT_output = cursor.GetOutputParameter( "DEPTACCT"

)End Sub

Supplying parameter valuesWhen a user runs the report, Requester prompts the user to supply a value for the input parameter, INDEPTNO, as shown in Figure 10-27.

In the EMP table, the DEPTNO column contains the values 10, 20, and 30.

Figure 10-27 Prompting the user to supply a value

Viewing the report resultsAs shown in Figure 10-28, the report displays the data in the result columns ENAME, MANAGER, and HIREDATE based on the value of INDEPTNO.

Figure 10-28 Report output, displaying the values for department specified in the parameter

Customizing access to handle specific databases or multiple result sets

Typically, you use Stored Procedure Data Source Builder in e.Report Designer Professional to create data sources that use a stored procedure as a source of data. In some cases, however, you override methods in Actuate Basic to customize the way an application accesses the stored procedure and its resulting data. This customization enables you to work with a database that Stored Procedure Data Source Builder does not support, handle multiple cursors that a parameter returns, or meet other special requirements.

Page 217: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 195

If you have multiple results sets but only need to process a single cursor parameter, see “Processing additional cursors that a procedure or function returns,” earlier in this chapter.

Accessing a stored procedureTo call a stored procedure from an Actuate report, you complete the following steps in this order:

■ Connect to the database.

■ Create and prepare the statement to execute the stored procedure using the connection’s Prepare( ) method.

■ If you are passing a value or values to the stored procedure, define the procedure input parameters using the statement’s DefineProcedureInputParameter( ) method. Do not embed the input parameter definitions in the statement itself.

■ To get a value from the stored procedure:

■ Define output parameters using the statement’s DefineProcedureOutputParameter( ) method.

■ Call the StartNextSet( ) method.

■ Execute the stored procedure using Execute( ).

■ Get the output parameter value or values using GetOutputParameter( ).

■ If the stored procedure returns rows:

■ Create a cursor using the statement’s AllocateCursor( ) method.

■ Bind columns to data row variables using the cursor’s BindColumn( ) method.

■ Create the data-row object using New( ).

■ Retrieve the rows using the cursor’s Fetch( ) method.

■ If the stored procedure returns a status, get the return status value using GetProcedureStatus( ).

Mapping Actuate variable types and Visual Basic type codesWhen you use DefineProcedureOutputParameter( ), you must specify the appropriate Actuate type code. This type code maps to the database data type of the stored-procedure parameter to which the call refers.

Page 218: Accessing Data

196 A c c e s s i n g D a t a

Table 10-1 shows the Actuate variable types and the corresponding Visual Basic type code.

The following statements are examples of how to map the data types in DefineProcedureOutputParameter( ):

statement.DefineProcedureOutputParameter("@charboy", V_STRING)statement.DefineProcedureOutputParameter("@int_out", V_INTEGER)

Working with an Oracle stored procedureThe following example shows the code in Actuate Basic that prepares, passes input parameters to, executes, and obtains output parameters from an Oracle stored procedure that does not return a cursor:

Function Start( ) As BooleanDim stmtText As StringDim stmt As AcDBStatementDim Conn As AcDBConnectionDim arg_in_date As Date, arg_out_date As Date, tempDate As

DateStart = Super::Start( )Set Conn = GetConnection( )stmtText = "BEGIN sp_date_test(:arg_in_date, :arg_out_date);

END;"Set stmt = conn.Prepare(stmtText)If stmt Is Nothing ThenExit Function

End If

arg_in_date = CDate("01/01/2000")If stmt.DefineProcedureInputParameter("arg_in_date",

arg_in_date) = 0

Table 10-1 Actuate variable types and the corresponding Visual Basic type code

Actuate variable type Type code to use

Currency or Variant V_CURRENCY

Date or Variant V_DATE

Double or Variant V_DOUBLE

Integer or Variant V_INTEGER

Long or Variant V_LONG

Single or Variant V_SINGLE

String or Variant V_STRING

Page 219: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 197

Then Exit Function

End If

If stmt.DefineProcedureOutputParameter("arg_out_date",V_DATE) = 0 ThenExit Function

End If

If stmt.Execute( ) = 0 ThenstmtText = Conn.GetSpecificErrorText( )

Exit FunctionEnd If

tempDate = stmt.GetOutputParameter("arg_out_date")

End Function

Working with a stored procedure’s return valueThe following example shows the code for a stored procedure and a section of Actuate Basic code that passes input parameters to the stored procedure and extracts the return value:

The following stored procedure takes an input parameter value (a name) and uses that value to determine what value (the associated ID) to return to e.Report Designer Professional or Actuate iServer:

-- Create the procedure spfuncCREATE OR REPLACE FUNCTION spfunc ( p_name IN VARCHAR )-- Declare output parameterRETURN NUMBERAS

l_id NUMBER;-- Declare input parameterBEGIN

SELECT id INTO l_id FROM sproctable WHERE name = p_name;RETURN ( l_id );

END spfunc;/

Working with a stored procedure to return an IDThe following Actuate Basic code executes the stored procedure to determine the ID that is associated with a name. The code passes the input parameter value, the name, to the stored procedure. The stored procedure uses the name to determine its ID and returns the ID.

Page 220: Accessing Data

198 A c c e s s i n g D a t a

Sub TestSPStatement( connection As AcDBConnection )Dim statement As AcDBStatementDim id As LongDim newId As LongDim name As Variant

' Prepare the statementSet statement = connection.Prepare("BEGIN :p_id := spfunc (:p_name); END;" )If statement Is Nothing Then

PrintString ( "Failed to prepare statement." )PrintString ( connection.GetSpecificErrorText( ) )PrintString ( connection.GetGeneralErrorText( ) )Exit sub

End If

' Define the input parameter; pass the value "John Smith" to the procedure name = "John Smith"

If statement.DefineProcedureInputParameter ( "p_name", name ) = 0 ThenPrintString ( "Failed to define input parameter" )PrintString ( connection.GetSpecificErrorText( ) )PrintString ( connection.GetGeneralErrorText( ) )Exit sub

End Ifu

' Define the output parameterIf statement.DefineProcedureOutputParameter ( "p_id",

V_INTEGER ) = 0 Then

PrintString ( "Failed to define output parameter" )PrintString ( connection.GetSpecificErrorText( ) )PrintString ( connection.GetGeneralErrorText( ) )Exit sub

End If

' Execute spfunc procedureIf statement.Execute( ) = 0 Then

PrintString ( "Stored function spfunc execution failed." )PrintString ( connection.GetSpecificErrorText( ) )PrintString ( connection.GetGeneralErrorText( ) )

Else PrintString ( "Stored function spfunc execution success."

)End if

' Get the output parameter value, the id associated with "John Smith"

newId = statement.GetOutputParameter ( "p_id" )

Page 221: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 199

Print #1, "Function Return Value - id = ", newIdEnd Sub

Accessing multiple result sets from Oracle stored proceduresThis section describes how to access multiple result sets that Oracle stored procedures or stored functions return. This section applies only to using Oracle9i run-time clients.

Stored Procedure Data Source Builder supports only stored procedures that return one result set. To process multiple result sets, you customize Actuate Basic methods. Use the stored procedure’s output parameter, declared as a cursor variable of type CPointer. Then, open and fetch data rows from the cursor variable. Each cursor variable provides access to a single result set.

Before you write the custom Actuate Basic code to execute a stored procedure or stored function, you must know the definition of that procedure or function. The definition includes the data type of each parameter and the type of result set that a cursor variable returns. If you are processing multiple result sets, you must call the appropriate Actuate Basic methods for each result set’s cursor variable. You also must know the structure and definition of the stored procedure to write custom code to execute it and process its result sets.

A cursor variable can be either strong or weak. A strong cursor specifies a return type with the exact table and columns or row structure to return. A weak cursor supports determining the return type when the report runs.

A stored procedure or stored function returns different columns depending on the values of the input parameters and on how they are defined. If this is the case, the columns in the result set can fail to correspond to the controls in your report design.

Adding support in Actuate Basic methodsFirst, specify the call to the Oracle stored procedure in the AcDBStatement::Prepare( ) method. For example:

stmtText = “BEGIN :mgrCursor := refcur3.GetMgrData (:DEPTNO, :empCursor, :deptAcct ); END;”

Set stmt = New AcDBStatement ( GetDBConnection( ) )If Not stmt.Prepare( stmtText ) Then...

To declare an Oracle stored procedure’s output parameter for a result set:

AcDBStatement::DefineProcedureOutputParameter ("CursorParameterName", V_CPOINTER )

where CursorParameterName is the name of the output parameter, without the colon (:). Enclose the parameter name in quotation marks.

Page 222: Accessing Data

200 A c c e s s i n g D a t a

Assign the output parameter to an Actuate cursor, so you can use AcDBCursor methods to bind, open, and fetch data rows. For example, type:

AcDBStatement::AllocateCursor ( "CursorParameterName" )

where CursorParameterName is the name of the cursor parameter, without the colon (:). Enclose the cursor parameter name in quotation marks.

Actuate Basic closes special cursor variables when you close the associated AcDBCursor.

Specify the expected return row structure of a cursor variable by calling AcDBCursor methods. For example, call:

AcDBCursor::BindColumn ( ColumnPositionID, DataRowClassName, DataRowVarName )

An Oracle stored function returns a value. Use either of the following methods to access the stored function’s return value:

■ AcDBStatement::GetProcedureStatus( )

■ AcDBCursor::GetProcedureStatus( )

The return value’s data type is any data type that Oracle supports, except REF_CURSOR. Supported Oracle data types map to Actuate data types.

If the return value is a REF_CURSOR, use:

AcDBStatement::AllocateCursor ( "CursorParameterName" )

where CursorParameterName is the name of the return parameter that is specified in the call to the stored function, without the colon (:).

Using the CPointer type with another stored procedure functionYou cannot use the cursor variable CPointer type with the following methods:

■ AcDBStatement::GetOutputParameter( )

■ AcDBStatement::GetProcedureStatus( )

■ AcDBCursor::GetOutputParameter( )

■ AcDBCursor::GetProcedureStatus( )

The following example displays the names of department employees, the employees’ managers, and the employees’ hire dates. Users specify the department number to display the data for that department. The example uses the Oracle sample database installed with the Oracle product.

-- ref cursor stored function in scott/tiger database -- where a cursor is returned as a stored function value, in

addition

Page 223: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 201

-- to a result set in the output parametercreate or replace package refCur3 as cursor c1 is select ename, deptno from emp;cursor c2 is select ename, ename AS manager, hiredate from emp;type empCur is ref cursor return c1%ROWTYPE; type mgrCur is ref cursor return c2%ROWTYPE; function GetMgrData(indeptno IN NUMBER,EmpCursor in out empCur,

deptAcct OUT NUMBER ) RETURN mgrCur;

END;

create or replace package body refCur3 as function GetMgrData(indeptno IN NUMBER,EmpCursor in out

empCur, deptAcct OUT NUMBER ) RETURN mgrCur is

MgrCursor mgrCur;begin

open EmpCursor for select ename, deptno from emp where deptno = indeptno;

open MgrCursor for select e.ename, m.ename AS MANAGER, e.hiredate from emp m, emp e where e.mgr= m.empno and e.deptno= indeptno;

deptAcct := indeptno + 100;return MgrCursor;

end; end;

The example shows the code for an Oracle stored function and a section of the Actuate Basic program that calls it. The Actuate Basic program calls the Oracle stored function with two cursor parameters defined. One of the cursors is the function’s return value.

Define the cursors as variables in a subclass of AcDatabaseSource. For example:

Dim theEmpCursor As AcDBCursorDim theMgrCursor As AcDBCursor

The example defines two variables in the data stream component:

■ INDEPTNO, an input parameter to specify the department number that the user enters

■ DEPTACCT_output, an output parameter that returns the department’s account number

Page 224: Accessing Data

202 A c c e s s i n g D a t a

Fetching the data rowOverride the Fetch( ) method to fetch rows from the cursor variable:

Function Fetch( ) As AcDataRow' Set Fetch = Super::Fetch( )

Set Fetch = myFetch( theMgrCursor )End Function

Calling the Oracle stored procedure with result setsAdd custom Actuate Basic code to call the stored procedure. Add the code in the data stream component of the report design.

The following code example declares input and output parameters, result set cursors, and calls the Oracle stored procedure.

Sub OracleSPResults( )

Dim stmtText As StringDim stmt As AcDBStatementDim i_deptId As Integer

' Format SQL statement text to call a stored procedure with result sets

stmtText = "BEGIN :mgrCursor := refCur3.GetMgrData( :deptNo, :empCursor, :deptAcct ); END;"

' Prepare the statement

Set stmt = New AcDBStatement( GetDBConnection( ) )If Not stmt.Prepare( stmtText ) Then

GetDBConnection( ).RaiseError( )Exit FunctionEnd If

' Define Input and output parameters for stored procedure i_deptId= 20 stmt.DefineProcedureInputParameter ( "deptNo", i_deptId )

stmt.DefineProcedureOutputParameter( "empCursor", V_CPOINTER, NULL )

stmt.DefineProcedureOutputParameter( "deptAcct", V_INTEGER )

stmt.DefineProcedureReturnParameter( "mgrCursor", V_CPOINTER )

' Make optional call to Execute( ) in order to have access to ' output parameter values before calling OpenCursor( ) If Not stmt.Execute( ) Then

ShowFactoryStatus( "Stored procedure execution failed." )Exit Function

Page 225: Accessing Data

C h a p t e r 1 0 , A c c e s s i n g d a t a u s i n g a s t o r e d p r o c e d u r e 203

Else ShowFactoryStatus( "Stored procedure execution

succeeded." )End if

' Get the output parameter values to static variable defined in OraStoredProcExampeApp

g_deptAcctNo = stmt.GetOutputParameter ( "deptAcct" )

' Now allocate an AcDBCursor for the defined cursor parameter' and assign to the instance variable Set theEmpCursor = stmt.AllocateCursor( "empCursor" )

If Not theEmpCursor.OpenCursor( ) Then GetDBConnection( ).RaiseError( )

Exit FunctionEnd If

' Bind the first result set columns to the combined data rowtheEmpCursor.BindColumn( 1,

"OraStoredProcExampleApp::DataRow", "ename" )theEmpCursor.BindColumn( 2,

"OraStoredProcExampleApp::DataRow", "deptno" )

' Allocate another AcDBCursor for the second result setSet theMgrCursor = stmt.AllocateCursor( "mgrCursor" )

If Not theMgrCursor.OpenCursor( ) Then GetDBConnection( ).RaiseError( )

Exit FunctionEnd If

' Bind the second result set columns to the combined data rowtheMgrCursor.BindColumn( 1,

"OraStoredProcExampleApp::DataRow", "empName" )theMgrCursor.BindColumn( 2,

"OraStoredProcExampleApp::DataRow", "mgrName" )theMgrCursor.BindColumn( 3,

"OraStoredProcExampleApp::DataRow", "hireDate" )

' Let the Fetch( ) method takes care of fetching and combining each row of data

End Sub

Page 226: Accessing Data

204 A c c e s s i n g D a t a

Page 227: Accessing Data

P a r t

3Part 3Accessing SAP data

Page 228: Accessing Data
Page 229: Accessing Data

C h a p t e r 1 1 , C o n n e c t i n g t o a n S A P d a t a s o u r c e 207

C h a p t e r

11Chapter 11Connecting to an SAP

data sourceThis chapter contains the following topics:

■ About accessing SAP data

■ Configuring the system environment for accessing SAP data

■ Connecting to an SAP system

Page 230: Accessing Data

208 A c c e s s i n g D a t a

About accessing SAP dataIn e.Report Designer Professional, you can design reports that use the following types of SAP data:

■ SAP InfoProviders

■ SAP BW Operational Data Stores

■ SAP R/3 Business object APIs (BAPIs)

■ Other remote function call-enabled function modules (RFMs) in an SAP R/3 system

Configuring the system environment for accessing SAP data

Before you can create and run a report design that uses SAP data, you must install the SAP Java Connector libraries and configure your environment. For information about which SAP BW and SAP GUI versions Actuate supports, see the Actuate supported products and obsolescence policy at the following URL:

http://support.actuate.com/documentation/spm

How to configure the environment

1 Install the SAP Java Connector libraries.

You can download the SAP Java Connector libraries from the SAP Service Marketplace at the following URL:

http://service.sap.com/connectors

For library download information, see Note 19466 at the following URL:

http://service.sap.com/notes

To download a patch over the web, navigate to the following URL and choose Download Kernel/Frontend Patches:

http://service.sap.com/ocs

2 Install the SAP GUI client and the BW add-ons, as specified in your SAP documentation.

3 Using SAP Logon create a login configuration with the following properties:

■ Description, for example, CB3 BW

■ Application server, for example, 12.34.56.78

■ SAP router string, for example, /H/12.23.45.67/H/80.123.45.78/H/

Page 231: Accessing Data

C h a p t e r 1 1 , C o n n e c t i n g t o a n S A P d a t a s o u r c e 209

■ System number, for example, 03

4 Place the sapjco.jar and sapjcorfc.dll SAP Java Connector libraries in the appropriate directory for each product you are using, as shown in Table 11-1.

5 Place the librfc32.jar library in the appropriate directory for each product you are using, as shown in Table 11-2.

6 If you are accessing SAP R/3 data, place the SAPmdi.jar library in the following directory:

\Program Files\Actuate10\MyClasses

You need SAPmdi.jar only if you use SAP R/3. This file is available on the CD labeled SAP WEB AS: SAP Web Application Server - Java Development environment, in \JBA\lib\ext. Copy this file directly from the CD. You do not have to use the SAP Java Development Tools installation.

Connecting to an SAP systemTo connect to an SAP system, you need to create a connection and specify the connection properties. To specify the properties, you need to know the user name and password for the SAP system and the system’s login configuration. SAP systems support logging in to an individual server or a group of servers. Ask your SAP administrator whether you should use an individual login configuration or an SAP group login configuration. The properties that you need

Table 11-1 Directories for the sapjco.jar and sapjcorfc.dll libraries

Products Directory

BIRT Report Designer Professional, e.Spreadsheet Designer, and Information Object Designer

\Program Files\Actuate10\oda\AcOdaSapDriver\MyClasses

e.Report Designer Professional

\Program Files\Actuate10\MyClasses

Table 11-2 Directories for the librfc32.jar library

Products Directory

BIRT Report Designer Professional, e.Spreadsheet Designer, and Information Object Designer

<windows home>\system32

e.Report Designer Professional \Program Files\Actuate10\ErdPro\bin

Page 232: Accessing Data

210 A c c e s s i n g D a t a

to specify to connect to an SAP system depend on the type of login configuration required by your SAP system:

■ Individual login configuration

If you want to log into an individual server, you need to specify the ApplicationServer, Router, and SystemNumber. You can obtain the proper values of the system properties from your SAP administrator or by examining the values on the Properties page when using SAP Logon to log in to your SAP system.

■ SAP group login configuration

An SAP administrator can specify a group of servers to balance the load between multiple servers. Each group of servers has a message server to handle communication with the client. If you want to log in to a group of servers, specify the GroupName, MessageServer, and SystemID. You can obtain the proper values of the system properties from your SAP administrator or by examining the values on the Group selection page when using SAP Logon to log in to your SAP group.

To access an SAP BW data source or SAP R/3 data source, you must create an SAP connection component.

How to add an SAP connection component

1 In Report Structure, ensure that a connection slot and its associated DataStream slot are empty, as shown in Figure 11-1. If necessary, right-click each slot and choose Delete.

Figure 11-1 An empty connection slot and DataStream slot

2 Open the toolbox, as shown in Figure 11-2. Select Data.

Figure 11-2 The toolbox

Page 233: Accessing Data

C h a p t e r 1 1 , C o n n e c t i n g t o a n S A P d a t a s o u r c e 211

3 Drag a database connection component from Toolbox—Data and drop it in Connection, as shown in Figure 11-3.

Figure 11-3 Putting a database connection in the connection slot

Select Component appears, displaying all connection types that are compatible with your data source component, if any. If you have not chosen a data source component, you see all possible connection types.

4 In Select Component, select SAP connection.

Choose OK.

Component Properties appears, as shown in Figure 11-4.

Figure 11-4 Setting connection properties

Type the values for the connection properties for your SAP login configuration.

Page 234: Accessing Data

212 A c c e s s i n g D a t a

Page 235: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 213

C h a p t e r

12Chapter 12Accessing SAP BW data

This chapter contains the following topics:

■ About accessing SAP BW data

■ Preparing to use your SAP BW data

■ Creating a report design that uses an SAP BW BEx Query data stream

■ Understanding MDX Query terms

■ Querying data from an SAP InfoProvider

■ Working with memory issues when querying an SAP BW data source

■ Creating a report design that uses an SAP BW ODS data stream

Page 236: Accessing Data

214 A c c e s s i n g D a t a

About accessing SAP BW dataIn e.Report Designer Professional, you can access SAP BW data from SAP InfoProviders or from SAP BW Operational Data Stores (ODS) Objects.

Preparing to use your SAP BW dataYou can access SAP BW data from an SAP InfoProvider from a report designer or from Information Object Designer. If you have an SAP BW system with a BEx query that was defined on an InfoProvider, you can view the BEx query’s metadata in SAP BW BEx Query Builder. You select elements of the metadata to specify the data to query. A BEx query’s metadata includes information about the key figures, dimensions, hierarchies, levels, parent nodes, members, and items in the data. Understanding your BEx query’s metadata is necessary if you want to use SAP BW BEx Query Builder effectively. For information about SAP BW, BEx queries, and BEx query metadata, see the SAP documentation at:

http://help.sap.com

If you want to access data from SAP BW Operation Data Store, you need to know the names and positions of the columns while designing reports so that you can specify the desired columns in your code.

Creating a report design that uses an SAP BW BEx Query data stream

You can create an SAP BW data source using the tool box or use Report Wizard to create a report design that uses an SAP BW BEx Query data stream. The procedure in this section describes how to use Report Wizard to create a report that accesses SAP BW data.

How to create a report design that uses an SAP BW BEx Query data stream

1 Choose File➛New.

2 On Create New Report, select Quick Report Wizard as shown in Figure 12-1. Choose OK.

3 On Report Wizard—Data Sources , select Build a new database connection, as shown in Figure 12-2. Choose Next.

Page 237: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 215

Figure 12-1 Selecting Quick Report Wizard

Figure 12-2 Building a new database connection

4 On Report Wizard—Build New Database Connection, specify your database connection information, as shown in Figure 12-3:

■ In Type of database, select SAP Connection.

■ In Connection information, type the property values for the BW login configuration that you created using SAPlogon.

If you are using an individual login configuration, set the properties under SystemProperties.

If you are using a group login configuration, set the properties under GroupProperties.

Choose Next.

Page 238: Accessing Data

216 A c c e s s i n g D a t a

Figure 12-3 Specifying your database connection information

5 On Report Wizard—Select Data Stream, select SAP BW BEx Query, as shown in Figure 12-4. Choose Next.

Figure 12-4 Creating an SAP BW BEx query data source

SAP Logon appears, as shown in Figure 12-5.

6 Choose OK.

Page 239: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 217

Figure 12-5 SAP Logon

7 As shown in Figure 12-6, SAP Logon at <BW login configuration> appears, where <BW login configuration> is the BW login configuration you created using SAPlogon.

Figure 12-6 Using SAP Logon to connect to SAP

8 Choose OK.

SAPQueryCubeSource—SAP BW BEx Query Builder appears.

Although SAP BW BEx Query Builder runs as an application that is separate from e.Report Designer Professional, you will not be able to work in e.Report Designer Professional until you exit SAP BW BEx Query Builder. When you close SAP BW BEx Query Builder, Windows sometimes does not display e.Report Designer Professional automatically. If that situation occurs, select e.Report Designer Professional on the Windows task bar to continue designing your report.

9 Design an query in SAP BW BEx Query Builder, as shown in Figure 12-7, to extract the desired SAP BW data and choose OK. This step is described in more detail later in this chapter.

Page 240: Accessing Data

218 A c c e s s i n g D a t a

Figure 12-7 SAP BW BEx Query Builder

Report Wizard—Choose Layout Style appears, as shown in Figure 12-8.

Figure 12-8 Choosing a layout style

10 To lay out the report, complete the following tasks:

■ In Available Layout Styles, select the report layout.

■ In Paper Size, select the appropriate paper size.

Page 241: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 219

■ In Orientation, select Portrait or Landscape.

Choose Next.

11 On Report Wizard—Finish, to complete the report design, complete the following tasks, as shown in Figure 12-9:

■ In Enter a title for your report, type a report title.

■ Select Display the report or Change the report design.

Choose Finish.

Figure 12-9 Entering a report title and selecting your next action

If you select Change the report design, the report design appears in Layout after you choose Finish, as shown in Figure 12-10.

Figure 12-10 Layout with an SAP BW data source

Page 242: Accessing Data

220 A c c e s s i n g D a t a

Understanding MDX Query termsSAP BW BEx Query Builder uses your metadata selections to create a Multidimensional Expressions (MDX) query. MDX is the language component of Microsoft’s Object Linking and Embedding Database for Online Analytical Processing (OLE DB for OLAP) specification. OLE DB for OLAP specifies a set of COM interfaces through which a program can gain access to the services of an OLAP data provider. The OLE DB for OLAP specification includes data structures and protocols for issuing queries to and exchanging data with a data provider.

You do not need to know MDX to use SAP BW BEx Query Builder. However, the following OLAP and MDX terms are used in SAP BW BEx Query Builder:

■ Tuple

A cube is composed of many cells, but each cell is an intersection of the dimensions of a cube that is defined in the BEx query metadata. Thus, each cell can be uniquely identified by listing those dimensions. A tuple is a collection of members, each of which is selected from a different dimension. A tuple that specifies a single cell is a collection of members, one for every dimension. A tuple that specifies a group of cells contains members from only a subset of the dimensions. The term, tuple, can refer to the combination of members or their associated values.

■ Axis

An axis is a collection of members from one or more dimensions that are organized as tuples. Use an axis to support displaying, sorting, filtering, and analyzing the associated data. For example, you can have an axis for the time period, another axis for product-related data, and a third axis for distributor-related information. In SAP BW BEx Query Builder, you can add one or more axes to provide data for the rows or columns of a report design.

■ Set

A set is an ordered set of tuples, possibly repeating a tuple. The term tuple can refer to the set of member combinations that it contains or the values in the cells specified by the associated tuples. Sets are used in SAP BW BEx Query Builder to specify which cells to return from the query.

■ Slice

A slice is a subset of a cube for which all cells share a single value for one or more members of the dimensions that are not included in the subset. For example, you can define a slice to be all cells in the cube that have the value "Asia" for the Region member. In SAP BW BEx Query Builder, you can specify a slice to use in limiting the data retrieved for a report design.

Page 243: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 221

For more information about these terms and MDX queries, see MDX Solutions by George Spofford, or the MDX Essentials series of articles by William Pearson at www.databasejournal.com.

Querying data from an SAP InfoProviderTo query data from an SAP BW InfoProvider, you perform the following tasks:

■ Open SAP BW BEx Query Builder.

■ Select an InfoProvider and BEx query.

■ Select the type of data to include on each axis of the returned data.

■ Provide the values of any SAP variables used by the selected BEx query.

■ Optionally, perform one or more of the following tasks:

■ Specify how to sort the returned data.

■ Specify filter conditions to limit the data that is returned.

■ Specify slices to use in the MDX query.

■ View the MDX query that your choices created.

■ Save the query and close SAP BW BEx Query Builder by choosing OK.

These steps, except for saving the query and closing the SAP BW BEx Query Builder, are described later in this chapter.

Opening SAP BW BEx Query BuilderThe first step in accessing data from an SAP BW InfoProvider is to open SAP BW BEx Query Builder. You can access the SAP BW BEx Query Builder from Report Wizard or after you create a connection and data stream manually.

How to open SAP BW BEx Query Builder

1 Open a report design and ensure that the report design contains a connection to an SAP BW data source.

2 Add an SAP BW BEx Query database source, creating an SAPQueryCubeSource data stream.

3 In Report Structure, select the appropriate SAPQueryCubeSource data stream component.

4 Choose View➛Data Source.

SAP Logon appears as shown in Figure 12-11.

Page 244: Accessing Data

222 A c c e s s i n g D a t a

Figure 12-11 SAP Logon

5 In each field, type the appropriate values for your SAP BW system. Choose OK.

SAP BW BEx Query Builder appears as shown in Figure 12-12.

Figure 12-12 SAP BW BEx Query Builder

Selecting an InfoProvider and BEx queryAn InfoProvider is a generic SAP BW term for several types of data objects that are available in SAP BW systems. You can query data from InfoProviders, using any BEx queries that are defined on those InfoProviders. A BEx query is an SAP BW term for a collection of characteristics and key figures for analyzing an InfoProvider. The InfoProviders and BEx queries must exist in the SAP BW

Page 245: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 223

system that the connection accesses. For more information about these and other SAP terms, see the SAP glossary at the following URL:

http://help.sap.com/saphelp_glossary/en/index.htm

In SAP BW BEx Query Builder, you can use the metadata that the BEx query provides to choose data to include in the report design. The metadata appears in the Key Figures and Dimensions fields in the upper pane of SAP BW BEx Query Builder.

The Key Figures pane lists the key figures that are defined in the selected BEx query. In SAP BW, these key figures are also called measures, as they contain values or quantities. In Dimensions, shown in Figure 12-13, SAP BW BEx Query Builder displays the following elements, which are specified in the BEx query:

■ Dimensions

■ Hierarchies

■ Levels

■ Parent nodes

■ Members

■ Attributes

Figure 12-13 Dimensions displays various types of elements

If the BEx query changes within the SAP BW system while you are using SAP BW BEx Query Builder, you can refresh the display of metadata.

BEx query metadata uses both business names and technical names. In SAP BW BEx Query Builder, you can use either type of name to build your query.

How to select an InfoProvider and BEx query

1 In InfoProvider, select an InfoProvider.

As shown in Figure 12-14, SAP BW BEx Query Builder displays the BEx queries that are available for that InfoProvider in BEx Query.

DimensionHierarchy

Level

Parent node

Member

Attribute

Page 246: Accessing Data

224 A c c e s s i n g D a t a

Figure 12-14 Available BEx queries for the selected InfoProvider

2 In BEx Query, select a BEx query for the InfoProvider.

SAP BW BEx Query Builder displays the BEx query’s metadata in the upper pane, as shown in Figure 12-15.

Figure 12-15 Viewing the BEx query’s metadata

How to refresh the display of metadata in SAP BW BEx Query Builder

If the BEx query changes within the SAP BW, refresh the display of metadata by choosing Refresh Metadata.

How to display technical names in SAP BW BEx Query Builder

By default, SAP BW BEx Query Builder displays business names for the BEx query’s metadata. To display technical names instead of business names, choose Toggle Unique Names. To return to displaying business names instead of technical names, choose Toggle Unique Names again.

Selecting the type of data to include on each axisYou can use the BEx query’s metadata to specify the type of information to include in the result set. First, create axes by selecting sets and properties. If desired, you can then place the cross-product of two or more sets on an axis,

Page 247: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 225

move an axis, and modify an axis to exclude members that do not contain data. If necessary, you can delete axes, sets, and properties.

Creating an axis by selecting a set or propertyYou create axes to specify which information should appear in the columns and rows of the report design. You can specify up to 10 axes for the columns and rows of a report design. Performance decreases as the number of axes increases.

The first column axis should include one or more key figures. These measures contain values and typically appear as column or crosstab headings in a report design. If an axis other than the first axis includes key figures, all key figures that can be aggregated in the report design should be of the same data type or compatible data types. For example, if the data type of the first key figure is Double, that key figure can be aggregated with another key figure with an Integer data type.

Using the context menus, you can specify the data for each axis by using:

■ Parent nodes that appear in Dimensions

■ Members that appear in Key Figures or Dimensions

■ Individual items that appear in Key Figures or Dimensions

The following rules apply when you create axes and sets:

■ You must create a set that contains one or more key figures on a column axis.

■ You must create at least one row axis.

■ If you specify a set and later add attributes for the same dimension that use the same type of axis, the attributes are added to the set. For example, if you create a set that uses the Product dimension on a row axis, you can add additional Product attributes later if you add them to a row axis.

■ If you try to add a set that uses the same dimension as a previous set, the results depend on whether there is a conflict. If there is no conflict, SAP BW BEx Query Builder adds the new set. If there is a conflict, SAP BW BEx Query Builder displays a warning that this action will delete the existing set that uses the same dimension.

■ You must create an axis before you can specify sorting or filtering on that axis.

■ You can choose to include an element’s items, members, or descendants in a set, depending on the type of element, as shown in Table 12-1. The choices are

Page 248: Accessing Data

226 A c c e s s i n g D a t a

the same for both column and row axes. The table lists the types of elements in the same order as they appear in Dimensions.

How to specify the sets, axes, and property values for a query on SAP BW data

This procedure explains how to create an axis by creating a set. It also shows how to add attributes to an axis as properties. This procedure does not cover placing the cross-product of two or more sets on a single axis:

1 In SAP BW BEx Query Builder, choose Axes.

SAP BW BEx Query Builder—Axes appears as shown in Figure 12-16.

Figure 12-16 The Axes page of SAP BW BEx Query Builder

2 To set up the first axis, complete one of the following tasks:

■ In Key Figures, right-click the Key Figures node. Choose Column➛Members, as shown in Figure 12-17.

Table 12-1 Available choices for each type of element to create a set

Element type Available choices for set contents

Dimension Members

Hierarchy Members

Level Descendants

Members

Parent node Descendants

Members

Item

Member Item

Attribute Item

Page 249: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 227

Figure 12-17 Choosing to create a column axis containing all key figures

SAP BW BEx Query Builder adds all key figures to a single set on an axis and displays the axis in the lower pane, as shown in Figure 12-18.

Figure 12-18 A column axis containing a set with all key figures included

■ Expand Key Figures, and right-click a node under Key Figures. Choose Column➛Item, as shown in Figure 12-19. You can repeat this task for other key figures that you want to include in the set.

Figure 12-19 Choosing to add a single key figure to a set on a column axis

SAP BW BEx Query Builder adds the key figures to a set on an axis and displays the axis in the lower pane. Figure 12-20 shows the result of choosing two key figures.

Figure 12-20 A column axis with a set containing two key figures

3 To set up another axis, perform these tasks:

1 In Dimensions, right-click an element.

Page 250: Accessing Data

228 A c c e s s i n g D a t a

2 Choose Column to create a column axis, or choose Row to create a row axis.

A submenu appears, showing Descendants, Members, and Items.

3 Choose Descendants, Members, and Items to include that element in the set on the axis.

SAP BW BEx Query Builder displays choices that are not relevant for the element you chose in step 1 in gray to indicate that those choices cannot be selected.

For example, Figure 12-21 shows the creation of a row axis that contains the members of the Employment Status hierarchy.

Figure 12-21 Creating a row axis containing all members of a hierarchy

SAP BW BEx Query Builder displays the new axis. Figure 12-22 shows the result of creating a row axis that contains the members of the Employment Status hierarchy.

Figure 12-22 A column axis containing two key figures and a row axis containing all members of a hierarchy

4 To set up additional axes, repeat step 3.

Be sure to set up at least one column axis and one row axis for your query.

Figure 12-23 shows the addition of several more axes. The row that contains Axis (4) shows that adding an axis by selecting an attribute adds a property, a new axis, and a new set. In the metadata, the attribute belongs to a particular member, such as Personnel Area. The resulting axis has the Personnel Area member set and a property that corresponds to the selected attribute, Medium Name.

Page 251: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 229

Figure 12-23 Several column axes and row axes

5 To add additional attributes to the existing axes that use the same dimension, right-click the attribute and choose Column➛Item or Row➛Item.

Choose the same type of axis, column, or row that you chose for the axis that uses that dimension. SAP BW BEx Query Builder adds the property that corresponds to the attribute of the axis that uses the same dimension. Figure 12-24 shows the result of adding the Nationality dimension’s Name property to Axis (1).

Figure 12-24 A row axis with a property added to an existing axis

Adding the cross-product of several sets to an axisIn SAP BW BEx Query Builder, you can place the cross-product of two or more sets on an axis. An axis that contains the cross-product of two sets contains a set of all possible combinations of the two sets of members. For example, if you have three distributors in one set and four products in another set, you can add the cross-product of the two dimensions to the axis. The cross-product in this example contains 12 members, each with one of the distributor-product combinations. If you have another set with two members, the cross-product of all three sets would contain 24 members.

Adding a cross-product to an axis

In SAP BW BEx Query Builder, you create cross-products by combining two sets at a time. The original sets can contain the members of a single dimension or the cross-product of two or more dimensions.

The two sets must both be row axes or column axes. They also must be listed next to each other in SAP BW BEx Query Builder—Axes. If necessary, move the axes or change the type of one of the axes before following this procedure.

Page 252: Accessing Data

230 A c c e s s i n g D a t a

How to place the cross-product of two or more sets on a single axis

1 In SAP BW BEx Query Builder, choose Axes.

SAP BW BEx Query Builder—Axes appears.

2 Verify that the sets you want to combine into a cross-product are listed on adjacent rows in SAP BW BEx Query Builder—Axes, and are both on column axes or are both row axes.

Figure 12-25 shows SAP BW BEx Query Builder—Axes with several row axes.

Figure 12-25 Several row axes

3 Right-click the Axes column for one of the sets, and choose Crossjoin with Set above or Crossjoin with Set below, as shown in Figure 12-26.

Figure 12-26 Creating a crossjoin

The cross-product of the two sets is placed on the axis that you created in step 2, and the second axis is removed, as shown in Figure 12-27.

Figure 12-27 A crossjoin of two sets

4 Repeat steps 2 and 3 for each additional set that you want to include on this axis. One or both sets can contain the cross-products of other sets.

Page 253: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 231

Figure 12-28 is the result of repeating steps 2 and 3 to add a third set to an axis that already contains the cross-product of two dimensions. The result is a cross-product of all three dimensions.

Figure 12-28 A cross-product of three dimensions

Removing a cross-product from an axis

You can remove a cross-product from an axis. Removing a cross-product does not remove the sets involved in the cross-product. Instead SAP BW BEx Query Builder replaces the axis with two axes, each with one of the sets that composed the former cross-product. If one or both of the remaining sets also contain cross-products, you can leave those cross-products intact or repeat the procedure to remove them.

How to remove the cross-product of two or more sets from an axis

When you remove the cross-product of two sets or cross-products, the result is two axes, each with one of the sets or cross-products that were part of the original cross-product.

1 In SAP BW BEx Query Builder, choose Axes.

SAP BW BEx Query Builder—Axes appears, as shown in Figure 12-29.

Figure 12-29 A row axis with a cross-product of three dimensions

2 Right-click the Axes column that contains the name of the axis, and choose Remove Crossjoin, as shown in Figure 12-30.

Page 254: Accessing Data

232 A c c e s s i n g D a t a

Figure 12-30 Removing a crossjoin

SAP BW BEx Query Builder removes the cross-product that is on the current axis. If there is more than one cross-product on the current axis, SAP BW BEx Query Builder removes the outer cross-product. The current axis contains the first of the sets that previously formed the cross-product. SAP BW BEx Query Builder creates another axis that contains the second of the sets that previously formed the cross-product, as shown in Figure 12-31.

Figure 12-31 Two row axes, including one with a remaining crossjoin

3 If the original cross-product contained more than two sets, you can repeat step 2 for each resulting axis that still contains a cross-product.

Figure 12-32 shows the result of separating all cross-products on the row axes.

Figure 12-32 Three row axes without any crossjoins

Moving an axis and changing its axis typeYou can move an axis up or down in the list. If you move an axis from the column axes section to the row axes section, the axis becomes a row axis. If you move an axis from the row axes section to the column axes section, the axis becomes a column axis.

Moving an axis or changing its type can change the layout of data in a report design. If you want to place a cross-product of several sets on an axis, the sets

Page 255: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 233

must be adjacent and the same type, either row or column. You can move an axis or change its type to place a cross-product on an axis.

How to move an axis or change its axis type

1 In SAP BW BEx Query Builder, choose Axes.

2 On SAP BW BEx Query Builder—Axes, select the gray column on the left side of the row that contains the axis’ number, and drag the row up or down to the desired location, as shown in Figure 12-33.

Figure 12-33 Moving a column axis and changing it to a row axis

SAP BW BEx Query Builder places the axis in the new location. In this example, a column axis has moved to the row axes section and has become a row axis, as shown in Figure 12-34.

Figure 12-34 The axis containing the Nationality.Members set is now a row axis

Modifying an axis to include members that do not contain dataWhen you create an axis, members that do not contain data are excluded by default to improve performance. There are two ways to exclude empty members:

■ Using Filter Empty Members

■ Using the FilterEmptyMeasures property

Filter Empty Members is interpreted by SAP and has a more limited effect than the FilterEmptyMeasures property.

By default, Filter Empty Members is selected for every axis in your query. When Filter Empty Members is selected for an axis, SAP BW BEx Query Builder adds a NON EMPTY clause to the MDX query it builds from your selections. If you need to include these empty members, you can deselect Filter Empty Members for an axis to include all members on the axis that do not contain data. When you

Page 256: Accessing Data

234 A c c e s s i n g D a t a

deselect Filter Empty Members, SAP BW BEx Query Builder removes the NON EMPTY clause for the axis.

The NON EMPTY clause removes members on that axis for which there is no data in the selected measures. For example, if the only measure selected is Items and the China member on the Country axis generates no rows with a value for Items, then your SAP BW system does not return any rows with the China member. However, it is possible for the results to include rows with no values for the measures. For example, consider the rows in Table 12-2.

If you select Filter Empty Members on the Year axis, your SAP BW system returns the result set in Table 12-3. The SAP BW system does not return rows for 2003 and 2004 because there are no values in the Items measure for those years for any country. The SAP BW system does return three rows for 2006 and two rows for 2005 because there exists a value in the Items measure for at least one of the returned rows for each of those years.

If you also select Filter Empty Members on the Country axis, your SAP BW system returns the result set in Table 12-4. The SAP BW system does not return rows for China because there are no values in the Items measure for that country for any year. The SAP BW system does return two rows each for France and the

Table 12-2 Sample rows, including some containing empty measures

Country Year Items

China 2006

China 2004

France 2006

France 2005 100

Italy 2003

United Kingdom 2006 200

United Kingdom 2005

Table 12-3 Sample rows returned if Filter Empty Members is selected on the Year axis

Country Year Items

China 2006

France 2006

France 2005 100

United Kingdom 2006 200

United Kingdom 2005

Page 257: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 235

United Kingdom because there exists a value in the Items measure for at least one of the returned rows for each of those countries.

You also can use the FilterEmptyMeasures property for the data source to remove empty members. If you set FilterEmptyMeasures to true, SAP BW BEx Query Builder obtains the result set returned by an MDX query and then the calling application, the report designer or Information Object Designer, filters out data rows that contain empty measures. As this filtering occurs based on the entire result, not just a single axis, it removes rows with empty measures in any measure. For example, consider the original set of rows discussed in this section and reproduced again in Table 12-5.

If you set the FilterEmptyMeasures property to true, then the resulting rows are as shown in Table 12-6. Because the FilterEmptyMeasures property applies to the entire results, not a single axis, there are no rows that contain empty measures.

Table 12-4 Sample rows returned if Filter Empty Members is selected on the Country axis

Country Year Items

France 2006

France 2005 100

United Kingdom 2006 200

United Kingdom 2005

Table 12-5 Full set of sample rows, including some containing empty measures

Country Year Items

China 2006

China 2004

France 2006

France 2005 100

Italy 2003

United Kingdom 2006 200

United Kingdom 2005

Table 12-6 Result of setting FilterEmptyMeasures to true to filter the sample rows

Country Year Items

France 2005 100

United Kingdom 2006 200

Page 258: Accessing Data

236 A c c e s s i n g D a t a

How to use FilterEmptyMeasures to remove empty measures

You set FilterEmptyMeasures outside of SAP BW BEx Query Builder. The method of setting this property varies by each product that uses SAP BW BEx Query Builder, as shown in Table 12-7.

How to include empty members on an axis in your query

1 In SAP BW BEx Query Builder, choose Axes.

2 On SAP BW BEx Query Builder—Axes, to include members that do not have data in the result set, deselect Filter Empty Members for the appropriate axis.

In Figure 12-35, Filter Empty Members is deselected for the axis that contains the Nationality set. SAP BW BEx Query Builder includes members of the Nationality set even if the members do not have any associated data in Key Figures or in the Employment Status, Gender, or Personnel Area dimensions.

Figure 12-35 Deselecting Filter Empty Members

Deleting axes, sets, and propertiesYou can delete an axis, a set defined for an axis, or a property of a set.

Table 12-7 Method of setting FilterEmptyMeasures for each product

Product Method

BIRT Report Designer Professional

Set FilterEmptyMeasures on Edit Data Set—Property Binding.

e.Report Designer Professional

Select the data source component in the DataStream slot and changing its FilterEmptyMeasures property in the Properties pane.

e.Spreadsheet Designer Set FilterEmptyMeasures on SAP BW BEx Query Properties before you create or modify the query.

Information Object Designer

Double-click the EPR file to open it, and choose Data Set Properties to see and modify the value for FilterEmptyMeasures.

Page 259: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 237

Deleting an axis

Deleting an axis deletes all sets and properties defined for the axis. Deleting an axis also deletes all sorting and filtering that is defined on that axis.

How to delete an axis

1 In SAP BW BEx Query Builder, choose Axes.

2 On SAP BW BEx Query Builder—Axes, right-click the number of the axis, and choose Remove Axis, as shown in Figure 12-36.

Figure 12-36 Deleting an axis

SAP BW BEx Query Builder deletes the axis and the set and properties on that axis, as shown in Figure 12-37.

Figure 12-37 Result of removing Axis (3)

SAP BW BEx Query Builder also deletes any sorting and filtering specifications for that axis.

Deleting a set

Deleting a set removes all properties selected for the set. Deleting a set from the query also deletes from the query any sorting and filtering specifications for that axis on that set.

How to delete a set

1 In SAP BW BEx Query Builder, choose Axes.

2 On SAP BW BEx Query Builder—Axes, right-click the Sets column for the set and choose Remove Set, as shown in Figure 12-38.

Page 260: Accessing Data

238 A c c e s s i n g D a t a

Figure 12-38 Removing a set

SAP BW BEx Query Builder removes the set. If the set was not a cross-product, SAP BW BEx Query Builder also removes the axis.

If the set was part of a cross-product, SAP BW BEx Query Builder moves the other part of the cross-product up one level in the cross-product hierarchy. For example, Figure 12-39 shows the result of deleting the Employment Status.Members set that appears earlier in this step.

Figure 12-39 Result of removing an outer set in a crossjoin

If you delete an inner set instead, such as Gender.Members, the remaining set moves up in the hierarchy, as shown in Figure 12-40.

Figure 12-40 Result of removing an inner set of a crossjoin

Deleting a property

If you delete an axis or a set, SAP BW BEx Query Builder deletes any properties selected for that set and axis. You also can delete a property without deleting an axis or a set.

How to delete a property

1 In SAP BW BEx Query Builder, choose Axes.

Page 261: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 239

2 On SAP BW BEx Query Builder—Axes, right-click the Properties column that contains the property, and choose Remove properties, as shown in Figure 12-41.

Figure 12-41 Removing properties from a set

3 On Remove Properties, select the properties to delete. Use the Shift key to select a range of properties or use the Control key to select several separate properties.

In Figure 12-42, the Personnel Area set includes two properties, but only one property is selected for deletion.

Figure 12-42 Deleting one of two properties included in a set

Choose OK.

Specifying the axes for each type of layout style in Report WizardIf you use Report Wizard to access SAP BW BEx Query Builder, you must choose one of the following layout styles for your report on Report Wizard—Choose Layout Style:

■ Blocked

■ Columnar

■ Crosstab

■ Tabular

Page 262: Accessing Data

240 A c c e s s i n g D a t a

This section provides examples that illustrate the effect of specifying the axes on SAP BW BEx Query Builder—Axes for each of these layout styles. For more information about Report Wizard, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. For information about creating a cross tabulation (crosstab), see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

How to add axes for each layout style in Report Wizard

This procedure uses the BEx query with the Key Figures and Dimensions that are expanded in Figure 12-43.

Figure 12-43 Adding axes for different layout styles

1 In SAP BW BEx Query Builder, choose Axes.

2 On SAP BW BEx Query Builder—Axes, in Key Figures, right-click Revenue. Choose Column➛Item.

This step creates the first axis, which will contain the revenue values.

3 In Dimensions, right-click Products➛PRODPGRP. Choose Row➛Members.

This step creates the second axis, which will contain the product group values.

Page 263: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 241

If, on Report Wizard—Choose Layout Style, you choose Columnar for the layout style, the first page of the report looks like the one in Figure 12-44.

Figure 12-44 A columnar layout style example

Blocked and tabular reports that display data from these axes similarly organize the information by product group then revenue.

Two axes are also sufficient to display a crosstab that has one column. If, on Report Wizard—Choose Layout Style, you choose Crosstab for the layout style, the first page of the report looks like the one in Figure 12-45.

Figure 12-45 A crosstab layout style example

4 In Dimensions, right-click Quarter➛Quarter➛Quarter Level 01. Choose Column➛Members.

This step creates the third axis, which contains the calendar quarter in which the sales occurred.

Three axes are sufficient for displaying a crosstab that has multiple columns. With these axes, the revenue figures are displayed by quarter then totaled. If, on Report Wizard—Choose Layout Style, you choose Crosstab for the layout style, the first page of the report looks like Figure 12-46.

Page 264: Accessing Data

242 A c c e s s i n g D a t a

Figure 12-46 An example of a crosstab layout with multiple columns

5 In Dimensions, right-click Scenarios➛Scenarios➛Scenarios Level 01. Choose Column➛Members.

This creates the fourth axis, specifying whether the revenue values are budgeted or actual values.

Four axes are sufficient for displaying a crosstab that groups the columns. With these axes, the quarterly revenue columns are grouped by whether the values are actual values or budgeted values. If, on Report Wizard—Choose Layout Style, you choose Crosstab for the layout style, the first page of the report looks like the one in Figure 12-47.

Figure 12-47 An example of a crosstab layout with column grouping

Specifying the values of any SAP Variables that are used in the BEx queryA BEx query can contain SAP Variables and can designate the variables as mandatory or optional. You can specify values for these variables. You must specify a value for each mandatory variable. Variables can be used in SAP BW to simplify the act of querying an InfoProvider.

Page 265: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 243

For example, you have a data warehouse that contains sales data. If the quantity of data is too great for a single cube, the person who designs the SAP InfoProviders and BEx queries can divide the warehouse into several cubes that are based on year, for example, 1997, 1998, and so on. To execute the same MDX query for different years, however, you must modify the query for each year. Alternatively, if the SAP designer uses an SAP Variable called Year, the cubes can be logically consolidated into one cube, such as SalesCube. A single MDX query on SalesCube can access each year’s data by using a different value for the Year variable. As SAP BW BEx Query Builder creates an MDX query that is based on your selections, you must provide values for all SAP Variables that the BEx query contains. SAP Variables are an extension of the MDX standard.

You must specify a default value for an SAP Variable if it is a mandatory variable. You can enable the user to provide a value for the SAP Variable. If the report user provides a value other than the default value when he runs the report, the number of columns that are returned in the query’s result set can differ from the number of columns that the BindDataRow( ) method binds. For example, if the report user provides a member value for an SAP variable, and the member value does not exist, related hierarchy columns might not be returned in the result set.

You can use an SAP Variable to include or exclude data. If you want the SAP BW system to return the matching data, select Include. If you want the SAP BW system to exclude the matching data from the result set, deselect Include. For information about including data that is associated with the SAP Variable’s value, see MDX query documentation.

For more information about report parameters, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional, or Designing Spreadsheet Reports using Actuate e.Spreadsheet Designer.

How to specify a value for an SAP Variable

1 In SAP BW BEx Query Builder, choose SAP Variables.

SAP BW BEx Query Builder—SAP Variables appears. Figure 12-48 shows SAP BW BEx Query Builder—SAP Variables for a BEx query with two variables, Calendar Year and Continent.

Figure 12-48 Two SAP Variables

Page 266: Accessing Data

244 A c c e s s i n g D a t a

2 In Value, specify the property values of the SAP Variable as required by the following rules:

■ You must type a value for the variable if SAP BW BEx Query Builder displays a check mark in Mandatory for that variable. You can type a value for a non-mandatory variable, but it is not required.

■ If the value is a member or includes a member, enclose the member name in square brackets.

■ If the variable’s type is Single, type a single value, as shown in the following example:

[1998]

■ If the variable’s type is Multivalue, type a range. Separate the lower and upper bounds of the range with a colon (:), as shown in the following example:

[1996]:[1998]

■ If the variable’s type is Complex, type a set of values and ranges. Separate the values and ranges with semicolons (;), as shown in the following example:

[1992]; [1995]:[1997]

3 To make the value a report parameter, select Parameter.

4 If you want the query to return data that is associated with the SAP Variable’s value, select Include. If you want the query to exclude the data that is associated with the SAP Variable’s value, deselect Include.

Figure 12-49 shows the results of specifying Include for both variables, and using 1994 for the calendar year variable value and Europe for the continent variable value.

Figure 12-49 Specifying Include and providing values for both SAP Variables

Page 267: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 245

Specifying how to sort the returned dataYou can specify a sort order for the result set. Like most data sources, an SAP BW system can sort data in ascending or descending order. With SAP BW, you also need to specify whether to preserve the data’s hierarchy or break the hierarchy.

For example, the following data is sorted by revenue in ascending order with the hierarchy preserved:

City Revenue------ -------------California

San Jose $200,000San Francisco $300,000Los Angeles $400,000

New YorkSyracuse $100,000Buffalo $200,000Albany $700,000

The following data is sorted by revenue in ascending order with the hierarchy broken:

City Revenue------ -------------Syracuse, New York $100,000Buffalo, New York $200,000San Jose, California $200,000San Francisco, California $300,000Los Angeles, California $400,000Albany, New York $700,000

You can specify sorting on one or more elements for each axis. All elements on a single axis will have the same sort order, such as ascending.

Deleting an axis from the query deletes from the query any sorting specifications for that axis.

How to specify sorting the returned data

1 In SAP BW BEx Query Builder, choose Order.

SAP BW BEx Query Builder—Order appears, as shown in Figure 12-50.

Figure 12-50 The Order page of SAP BW BEx Query Builder

Page 268: Accessing Data

246 A c c e s s i n g D a t a

2 Select the measure or element to use for sorting:

1 Right-click one of the following elements:

❏ In Key Figures, select an individual measure.

❏ In Dimensions, select a parent node.

❏ In Dimensions, select a member.

2 Choose Order.

Choose Axis for Order Clause appears, as shown in Figure 12-51.

Figure 12-51 Choosing an axis for the Order clause

3 Select the axis to which to apply the order.

Choose OK.

4 Repeat steps 1 through 3 to specify additional elements by which to sort on the same axis.

5 In Sort By for the axis, specify the type of sorting in Sort By:

■ ASC means ascending with hierarchy preserved.

■ BASC means ascending with hierarchy broken.

■ DESC means descending with hierarchy preserved.

■ BDESC means descending with hierarchy broken.

Figure 12-52 shows selecting the sort type for an axis, including the sort order and whether to preserve the hierarchy.

Figure 12-52 Selecting how to sort the data on an axis

6 To specify sorting for additional axes, repeat steps 1 through 5.

Page 269: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 247

How to move a sorting specification to another axis

1 In SAP BW BEx Query Builder, choose Order.

2 On SAP BW BEx Query Builder—Order, in the On column for a sorting specification, select a different axis, as shown in Figure 12-53.

Figure 12-53 Selecting a different axis for a sorting specification

The sorting specification moves to the selected axis, as shown in Figure 12-54.

Figure 12-54 Result of moving a sorting specification to a different axis

Limiting the returned data using filter conditionsYou can create a filter to restrict the data that is returned from the InfoProvider. You create a filter on an axis by creating one or more conditions for that axis. These conditions specify how to restrict the members that are returned for that axis.

For each filter condition, you can specify an expression, an operator, and the value. The SAP BW system will evaluate each condition in the filter by comparing the expression and value using the operator. The filter limits the data that is returned for that axis to the data for which the expression evaluates to true.

The first filter condition for an axis must include a measure in the filter expression. The Key Figures field lists the measures that are defined in the selected BEx query. You can also create filter conditions for the axis using one or more elements from anywhere in the dimension structure. The procedure for creating filter conditions with measures differs from the procedure for creating filters with elements in the dimension structure.

You can enable users to input the value in a filter condition by using a report parameter. If you specify that the user can specify a value, you must specify a valid default value when you define the filter condition. For more information

Page 270: Accessing Data

248 A c c e s s i n g D a t a

about report parameters, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional, or Designing Spreadsheet Reports using Actuate e.Spreadsheet Designer.

If you delete an axis from the query, any filter conditions that are defined for that axis are also deleted.

How to include a measure in a filter expression

1 In SAP BW BEx Query Builder, choose Filters.

SAP BW BEx Query Builder—Filters appears, as shown in Figure 12-55.

Figure 12-55 The Filters page of SAP BW BEx Query Builder

2 In Key Figures, right-click a measure and choose Filter➛Condition.

3 On Choose Axis to Filter on, select the axis to which to apply the filter, as shown in Figure 12-56.

Figure 12-56 Selecting which axis to filter

Choose OK.

4 In SAP BW BEx Query Builder—Filters, type a value in Value.

The query compares the measure that you chose in step 2 to this value to determine which members to return.

If you plan to enable users to input the value using a report parameter, use this field to provide the default value for the parameter. The default value must be a valid value.

5 In Operator, select one of the following operators:

■ =

■ >

Page 271: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 249

■ <

■ >=

■ <=

■ <>

The query uses this operator to compare the measure that you chose in step 2 to the value that you typed in step 4. Figure 12-57 shows that the filter includes the data if the Age in years is equal to or greater than 21.

Figure 12-57 Filtering data based on the value of Age in Years

6 To make the value a report parameter, select Parameter.

How to include an element from the dimension structure in a filter expression

If the axis already has a filter condition with a measure in the expression, you can create filter conditions for that axis using one or more elements from anywhere in the dimension structure.

1 In SAP BW BEx Query Builder, choose Filters.

SAP BW BEx Query Builder—Filters appears. Figure 12-58 shows that SAP BW BEx Query Builder—Filters already contains a filter on a measure.

Figure 12-58 A filter on a measure

2 Select an element to filter.

1 In Dimensions, right-click one of the following elements:

❏ A parent node

❏ A member

Page 272: Accessing Data

250 A c c e s s i n g D a t a

2 Choose Filter➛Selection.

Choose Axis to Filter on appears.

3 Select the axis to which to apply the filter, as shown in Figure 12-59.

Figure 12-59 Choosing the axis for the filter

Choose OK.

SAP BW BEx Query Builder—Filters displays the new filter. Figure 12-60 shows that the new filter has a default value of [All].

Figure 12-60 Result of adding an element from the dimension structure

4 In SAP BW BEx Query Builder—Filters, type a member in Value.

Enclose a member in square brackets, for example, [MO19199601]. The query compares the element that you chose in step 3 to this member to determine which members to return.

If you plan to provide users the ability to input the value through a report parameter, use this field to provide the default value for the parameter. The default value must be a valid value.

5 To make the value a report parameter, select Parameter, as shown in Figure 12-61.

Figure 12-61 Making the filter value a source parameter

Page 273: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 251

How to move a filter specification to another axis

1 In SAP BW BEx Query Builder, choose Filters.

2 On SAP BW BEx Query Builder—Filters, in the On column for a filter specification, select a different axis, as shown in Figure 12-62.

Figure 12-62 Selecting a different axis for a filter specification

Specifying slices to limit the data returned by the queryThe execution of an MDX query on an InfoProvider in SAP BW returns a result set that is also a cube. A section of a cube that is composed of more than one cell is called a slice. In SAP BW BEx Query Builder—Slices, you can choose what should be included in each slice by creating slice specifications for one or more slices. Each slice specification contains one or more slice elements. Together, these slice elements uniquely identify the desired slice. You create a slice element by choosing an expression and entering a value. The expression can be an individual measure, a parent node, or a member. The expression and the value must match for the result set to include the data.

SAP BW BEx Query Builder adds the slice specifications to the MDX query it generates. When SAP BW executes the MDX query, it uses the slice specifications to limit the data it returns. Although you also can limit the returned data using filters, slices differ in that they apply to the query’s entire result set. A filter applies only to an individual axis.

The combined slice elements must form a tuple so you cannot use several members from the same dimension in a slice. In SAP BW BEx Query Builder—Slices, you also cannot use a set that contains the cross-product of other sets to choose the contents of a slice.

How to specify a slice

1 In SAP BW BEx Query Builder, choose Slices.

SAP BW BEx Query Builder—Slices appears, as shown in Figure 12-63.

Page 274: Accessing Data

252 A c c e s s i n g D a t a

Figure 12-63 The Slices page of SAP BW BEx Query Builder

2 Right-click one of the following elements, and choose Slice➛Add to new group:

■ In Key Figures, an individual measure

■ In Dimensions, a parent node or a member

Figure 12-64 shows how to create the first slice.

Figure 12-64 Creating a slice and a new slice group

The new slice appears in SAP BW BEx Query Builder—Slices, as shown in Figure 12-65.

Figure 12-65 A slice

3 In value, type a value for the expression.

Page 275: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 253

If the value is a member, enclose the value in square brackets.

4 To add another slice element to the slice, perform the following steps:

1 Right-click one of the following elements and choose Slice➛Add to group.

❏ In Key Figures, an individual measure

❏ In Dimensions, a parent node or a member

2 In Add new slice to group, select the slice to which you want to add an element, as shown in Figure 12-66.

Figure 12-66 Adding a slice to an existing slice group

Choose OK.

SAP BW BEx Query Builder—Slice appears, displaying the new slice element within the specified slice.

3 In value, type a value for the expression.

If the value is a member, enclose the value in square brackets, as shown in Figure 12-67.

Figure 12-67 Specifying the value as a member

5 To add an additional slice element to this slice, repeat step 4.

6 Repeat this procedure for each additional slice that you want to define.

Displaying and verifying the resulting MDX querySAP BW BEx Query Builder uses the selections you make to create an MDX query, which is used by the report designer or Information Object Designer to access the data from SAP BW.

Page 276: Accessing Data

254 A c c e s s i n g D a t a

You can view the MDX query that SAP BW BEx Query Builder created based on your selections. The resulting MDX query uses the technical names for the BEx query’s metadata. By default, SAP BW BEx Query Builder displays the BEx query’s metadata using business names. However, you can use Toggle Unique Names to display the technical names for the BEx query metadata, including the selected metadata for axes, sets, sorting, and filtering.

You also can verify the validity of an MDX query or clear the query. Verifying an MDX query checks that the MDX query syntax is valid and that all metadata references are still valid for the selected BEx query on the SAP BW system.

How to view the resulting MDX query

To view the MDX query that SAP BW BEx Query Builder created, choose MDX. SAP BW BEx Query Builder—MDX appears, displaying the MDX query as shown in Figure 12-68.

Figure 12-68 The resulting MDX query

How to verify the validity of an MDX query

To verify that an MDX query is valid, choose Verify MDX. If the query is not valid, the report designer or Information Object Designer displays an error message that describes the problem.

How to clear an MDX query

To clear an MDX query, choose Clear Query.

Working with memory issues when querying an SAP BW data source

Some users experience memory problems on their systems while querying SAP BW InfoProviders or SAP BW ODS data streams. If you experience a crash while closing SAP BW BEx Query Builder or while running a report that accesses an SAP BW data source, reduce the Java Virtual Machine (JVM) heap size. If you

Page 277: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 255

receive a java.lang.outOfMemory error, reduce the fetch size limits for obtaining data from an SAP BW system.

Handling memory issues that cause a crashIn e.Report Designer Professional, if the JVM maximum heap size setting is higher than the size of the physical memory, then the JVM that e.Report Designer Professional uses may not start. Consider reducing the JVM maximum heap size setting if you experience:

■ A crash while closing SAP BW BEx Query Builder

■ A crash while running a report accessing an SAP BW InfoProvider or an ODS data stream

A overly large JVM heap size is a possible cause of such a crash. If either type of crash occurs, lower the JVM heap size to less than the physical memory, then try to run the report again. If you specify a maximum heap size, ensure that you have enough physical memory to contain a heap of that size. If the heap exhausts the available physical memory, paging can cause unpredictable errors. Actuate’s Java Object Interface and charts also use the JVMMaxHeapSize value you set.

To change the maximum JVM heap size for e.Report Designer Professional, create a Windows registry key. Be sure to back up your registry before making any changes. Under under HKEY_CURRENT_USER\Software\Actuate\e.Report Designer Professional 9.0\Settings, create the registry key called JVMMaxHeapSize. If you set JVMMaxHeapSize to 0 or you do not set JVMMaxHeapSize, e.Report Designer Professional uses the default value.

The unit for JVMMaxHeapSize is megabytes (MB). If you want to type the value as a binary number, create the registry key as a binary value and type the binary number in Value Data. If you want to type the value as a decimal number, create the registry key as a DWORD value and select Decimal in Base before typing the value in Value Data. If you want to type the value as a hexadecimal number, create the registry key as a DWORD value and select Hexadecimal in Base before typing the value in Value Data. For example, to change the JVM’s maximum heap size to 256 MB, you can create JVMMaxHeapSize as a DWORD value, select Decimal in Base and type 256 in Value Data.

Solving out of memory errors when using an SAP BW InfoProviderAn SAP BW data stream uses two BAPI calls, Bapi_Mddataset_Get_Axis_Data and Bapi_Mddataset_Get_Fs_Data, to return data. By default in e.Report Designer Professional, the BAPI calls request data in batches of up to 2000 tuples each. Using these settings, some customers get a java.lang.outOfMemory error. To avoid out of memory errors, you can reduce the size of the batches that the BAPI calls request. Returning data in smaller batches reduces the amount of memory

Page 278: Accessing Data

256 A c c e s s i n g D a t a

the data stream uses. For example, you can tune the fetch size properties of the report so that the SAP run-time driver requests data in increments of 1000 tuples.

Determining which BAPI call caused the errorIf running an SAP BW query returns an out of memory error, you can use the SAP BW run-time driver log files to investigate the problem. Turn on SAP logging, run the report, and examine the log file. An error message will indicate which property to adjust to solve the memory problem.

The technique used to start logging depends on where you are using the report:

■ To investigate memory problems from e.Report Designer Professional, create a system environment variable called AC_CDA_LOG_LEVEL. Set this environment variable to 9000, a logging level that tracks severe errors, including out of memory issues. To review errors, check the log file in Actuate10\eRDPro\log.

■ To investigate memory problems you encounter while running an SAP report on Actuate iServer System, turn on SAP logging in the iServer. For more information about logging levels and using iServer logging, see Configuring Actuate iServer.

The resulting log file messages specify which BAPI call failed, Bapi_Mddataset_Get_Axis_Data or Bapi_Mddataset_Get_Fs_Data.

Setting the fetch size properties for a BAPI callTo reduce the memory the data stream uses, adjust the fetch size properties for either:

■ The connection

To reset the fetch size for every data stream that uses a connection, adjust the fetch size properties for the connection component. The connection fetch size properties are BwBapiAxisDataFetchSize for Bapi_Mddataset_Get_Axis_Data BAPI calls and BwBapiFsDataFetchSize for Bapi_Mddataset_Get_Fs_Data BAPI calls.

■ A particular data stream

To reset the fetch size for a particular data stream, adjust the fetch size properties for the data stream. The data stream fetch size properties are BapiAxisDataFetchSize for Bapi_Mddataset_Get_Axis_Data BAPI calls and BapiFsDataFetchSize for Bapi_Mddataset_Get_Fs_Data BAPI calls.

If Bapi_Mddataset_Get_Axis_Data failed, set BwBapiAxisDataFetchSize to affect all data streams using the connection or BapiAxisDataFetchSize to affect a particular data stream. If Bapi_Mddataset_Get_Fs_Data failed, set BwBapiFsDataFetchSize to affect all data streams using the connection or BapiFsDataFetchSize to affect a particular data stream.

Page 279: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 257

Fetch sizes you set for a data stream override fetch sizes you set for a connection. If you set different fetch sizes in a connection and in a data stream that uses that connection, e.Report Designer Professional uses the data stream settings. If you do not set any fetch size properties, e.Report Designer Professional uses the SAP run-time driver default values.

To return all the data from a BAPI call at once, set the fetch size properties for that BAPI call to zero. The BAPI call retrieves all the information in one batch.

How to set the fetch size for a SAP BW connection component

This procedure assumes that you have used error logging to determine which BAPI call is causing the out of memory error.

1 To edit the component properties, in Report Structure, select the connection.

Properties shows the properties for the connection component.

2 Double-click BW BAPI Properties.

Properties shows the fetch size properties, as shown in Figure 12-69.

Figure 12-69 BW BAPI properties for the connection

3 Type the number of tuples to request when using the BAPI call that caused the out of memory error.

If error logging showed that Bapi_Mddataset_Get_Axis_Data failed, type a value for BwBapiAxisDataFetchSize. If Bapi_Mddataset_Get_Fs_Data failed, type a value for BwBapiFsDataFetchSize.

4 To have the new fetch limits take effect, restart e.Report Designer Professional. If the out of memory error occurred while running a report on Actuate iServer

Page 280: Accessing Data

258 A c c e s s i n g D a t a

System, restart Actuate iServer. If you are setting this value before running out of memory you do not need to restart Actuate iServer.

How to set the fetch size for an SAP BW data stream

This procedure assumes that you have used error logging to determine which BAPI call is causing the out of memory error.

1 To edit the data stream properties, in Report Structure, select the data source component in the DataStream slot.

Properties shows the properties for the data source component.

2 Double-click BW BAPI Properties.

Properties shows the fetch size properties, as shown in Figure 12-70.

Figure 12-70 BW BAPI properties for the data source

3 Type the number of tuples to request when using the BAPI call that caused the out of memory error.

If the error logging showed that Bapi_Mddataset_Get_Axis_Data failed, type a value in BapiAxisDataFetchSize. If Bapi_Mddataset_Get_Fs_Data failed, type a value in BapiFsDataFetchSize.

4 To have the new fetch limits take effect, restart e.Report Designer Professional. If the out of memory error occurred while running a report on Actuate iServer System, you must also restart the iServer machine. If you are setting this value before running out of memory you do not need to restart Actuate iServer.

Page 281: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 259

Creating a report design that uses an SAP BW ODS data stream

Data in an SAP BW Operational Data Store (ODS) object is stored in database tables. An ODS object is associated with several InfoObjects. InfoObjects are similar to database columns. When you create a report design that uses an SAP BW ODS data stream, you create a data row component and associate the data row’s variables with InfoObjects.

To create a report design that uses an SAP BW ODS data stream, you must:

■ Create a blank report design.

■ Create an SAP connection component.

■ Create an ODS data source component.

■ Create a data row component.

■ Associate the data row’s class variables with the InfoObjects.

■ Set the fetch limit.

■ Drag database fields from Fields and drop them in frames in the report design.

How to create a report design that uses an SAP BW ODS data stream

1 Create a blank report design:

1 Choose File➛New.

2 On Create New Report, select Blank Report, as shown in Figure 12-71.

Figure 12-71 Selecting blank report

Choose OK.

2 Delete the DataStream component and the Connection component:

1 In Report Structure, select the DataStream component. Press Delete.

Page 282: Accessing Data

260 A c c e s s i n g D a t a

2 In Report Structure, select the Connection component. Press Delete.

Report Structure looks like the one in Figure 12-72.

Figure 12-72 A report structure without a connection or DataStream component

3 Create an SAP connection component:

1 Drag a database connection component from the toolbox and drop it in Connection, as shown in Figure 12-73.

Figure 12-73 Adding a database connection component

2 In Select Component, select SAP Connection, as shown in Figure 12-74.

Figure 12-74 Creating an SAP connection component

Choose OK.

Page 283: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 261

3 In Component Properties, type the property values for the BW login configuration that you created using SAPlogon as part of configuring your report environment for SAP BW. Choose OK.

If you are using an individual login configuration, set the properties under SystemProperties.

If you are using a group login configuration, set the properties under GroupProperties, as shown in Figure 12-75.

Figure 12-75 SAP login configuration properties

4 Create an ODS data source component:

1 Drag a database source component from the toolbox and drop it in DataStream, as shown in Figure 12-76.

Figure 12-76 Creating a data source for an SAP connection

2 In Select Component, select SAP BW ODS, as shown in Figure 12-77.

Figure 12-77 Creating an SAP BW ODS data source

Choose OK.

Page 284: Accessing Data

262 A c c e s s i n g D a t a

3 In Component Properties, type the name of the ODS object, as shown in Figure 12-78.

Figure 12-78 Entering the ODS object name

Choose OK.

5 Create a data row component:

1 Drag a data row component from the toolbox and drop it in DataRow, as shown in Figure 12-79.

Figure 12-79 Creating a data row component

Report Structure looks like the one in Figure 12-80.

Figure 12-80 A data row component for an SAP ODS data source

2 Create a class variable for each InfoObject in the ODS object:

❏ In Report Structure, double-click DataRow1.

❏ In Properties, choose Variables.

❏ On Properties—Variables, choose New.

❏ Complete Class Variable, as shown in Figure 12-81, then choose OK.

Page 285: Accessing Data

C h a p t e r 1 2 , A c c e s s i n g S A P B W d a t a 263

Figure 12-81 Creating a class variable

3 Create the remaining class variables.

Properties—Variables looks similar to the one shown in Figure 12-82.

Figure 12-82 Creating class variables

6 Associate the data row’s class variables with the database cursor’s columns (InfoObjects):

1 In Report Structure, select SAPOdsSource.

2 In Properties, choose Methods.

Page 286: Accessing Data

264 A c c e s s i n g D a t a

3 On Properties—Methods, select Sub BindDataRow( cursor As AcDBCursor ). Choose Override.

4 In Method Editor, type code similar to the following code:

Sub BindDataRow( cursor As AcDBCursor )cursor.BindColumn( 1, "NewReportApp::DataRow1",

"column1" )cursor.BindColumn( 2, "NewReportApp::DataRow1",

"column2" )cursor.BindColumn( 3, "NewReportApp::DataRow1",

"column3" )...

End Sub

In the preceding example, InfoObjects are identified by position (1, 2, 3, and so on). You can also identify InfoObjects using their names. Do not include the leading zero.

Choose Close.

7 Set the fetch limit.

The fetch limit is the maximum number of rows to fetch from the ODS data source. If the Java Virtual Machine (JVM) does not have enough memory to accommodate the result set, you must decrease the fetch limit or increase the JVM’s maximum heap size.

If you want to set the fetch limit, follow these steps:

1 In Properties, choose Properties.

2 In FetchLimit, type the fetch limit, as shown in Figure 12-83. Choose Close.

0 is the default value. If FetchLimit is set to 0, e.Report Designer Professional retrieves all rows.

Figure 12-83 Setting the fetch limit

8 Drag database fields from Fields and drop them in frames in the report design.

Page 287: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 265

C h a p t e r

13Chapter 13Accessing SAP R/3 data

This chapter contains the following topics:

■ About accessing SAP R/3 data streams

■ Configuring the report environment for SAP R/3

■ Preparing to use your SAP R/3 data

■ Accessing data from an SAP R/3 data source

■ Starting to specify an SAP R/3 data source

■ Controlling RFM execution

■ Working offline after you specify a BAPI or other RFM

Page 288: Accessing Data

266 A c c e s s i n g D a t a

About accessing SAP R/3 data streams You can design a report that uses an SAP R/3 data stream. You can retrieve and display data using:

■ Business object APIs (BAPIs)

■ Other remote function call enabled function modules (RFMs)

Configuring the report environment for SAP R/3Before you can create and run a report design that uses an SAP R/3 data stream, you must install the SAP Java Connector libraries. For more information about installing the SAP Java Connector libraries, see “Preparing to use your SAP BW data” in Chapter 12, “Accessing SAP BW data.”

In addition to the Java Connector libraries that SAP BW requires, you must install SAP’s Java Metadata Interface, SAPmdi.jar, in \Program Files\Actuate10\MyClasses. This file is available on the CD that is labeled SAP WEB AS: SAP Web Application Server - Java Development environment in \JBA\lib\ext. Copy this file directly from the CD. You do not have to use the SAP Java Development Tools installation.

SAP supports the Metadata Interface for R/3 Release 4.0 and later. The Metadata Interface requires specific versions of R/3 Basis software packages. For patch requirements, see the SAP OSS Notes, such as OSS Note 580834.

Preparing to use your SAP R/3 dataTo use an SAP R/3 data source, you must configure your report development environment. You also need to know the following information about your data.

■ Log-in configuration

Because SAP systems support logging in to an individual server or a group of servers, you must determine whether you are using an individual log-in configuration or an SAP group log-in configuration.

To log in to an individual server, you must specify the ApplicationServer, Router, and SystemNumber. You can obtain the proper values for the system properties from your SAP administrator or by examining the values on the Properties page when you use SAP Logon to log in to your SAP system.

An SAP administrator can specify a group of servers to balance the load between multiple servers. Each group of servers has a message server to handle communication with the client. To log in to a group of servers, specify

Page 289: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 267

the GroupName, MessageServer, and SystemID. You can obtain the proper values for the system properties from your SAP administrator or by examining the values on the Group selection page when you use SAP Logon to log in to your SAP group.

■ Log-in information

Know the user name and password to use for the SAP R/3 data source.

■ Type and name of your SAP R/3 data source

Know the name of your BAPI or other RFM data source.

■ Desired SAP R/3 parameter behavior

Determine whether you want to hide any parameters or change their names or other property values.

■ Data type of any SAP R/3 export structure parameters

Know the data type of your export structure parameters, so you can map them to the corresponding Actuate Basic data type.

■ RFM error codes to ignore

If you want to ignore any RFM errors during RFM execution, you must know their error codes.

Accessing data from an SAP R/3 data sourceTo specify the data to access from an SAP R/3 data source, complete the following tasks in this order:

■ Specify that the data source is SAP R/3, and start SAP R/3 Data Source Builder.

■ Select the desired BAPI or other RFM.

■ View information about the BAPI or other RFM.

■ Modify settings for BAPI or RFM parameters.

■ Control RFM execution, if desired.

■ Choose OK

These steps, except for saving the query and closing the SAP R/3 Data Source Builder, are described later in this chapter.

After you specify a BAPI or other RFM as an SAP R/3 data source, you can modify settings for the data source without connecting to an SAP R/3 system. For instructions about modifying settings without connecting to an SAP R/3 system, see “Working offline after you specify a BAPI or other RFM,” later in this chapter.

Page 290: Accessing Data

268 A c c e s s i n g D a t a

Starting to specify an SAP R/3 data sourceYou begin to specify an SAP R/3 data source by creating an SAP R/3 data source and starting SAP R/3 Data Source Builder.

How to add an SAP R/3 data source component to a report design

1 In Report Structure, verify that the report design contains a connection component for an SAP data source.

2 Drag a database source component from Toolbox—Data, and drop it in the report section’s DataStream slot.

3 On Select Component, select SAP R/3 BOR BAPI (RFM) Source, and choose OK.

4 Choose View➛Data.

5 On SAP R/3 Login, type a user name and password, and choose OK.

6 On SAP R/3 Login, type a user name and password, and choose OK.

When you complete this procedure, SAPRfmSource—SAP R/3 Data Source Builder appears. Although SAPRfmSource—SAP R/3 Data Source Builder runs as an application that is separate from e.Report Designer Professional, you will not be able to work in e.Report Designer Professional until you exit SAPRfmSource—SAP R/3 Data Source Builder. When you close SAPRfmSource—SAP R/3 Data Source Builder, Windows sometimes does not display e.Report Designer Professional automatically. If that occurs, select e.Report Designer Professional on the Windows task bar to continue designing your report.

Selecting the desired BAPI or other RFMYou can find the BAPI or other RFM that you need to access in an alphabetical list or by searching on a string.

Finding the desired BAPI or other RFM using the Alphabetical viewBy default, SAP R/3 Data Source Builder—Browser displays the Alphabetical view with no filters. The Alphabetical view is an alphabetical list of business objects. The Alphabetical view does not display BAPIs that use the SAPGUI Dialog option. The Alphabetical view looks like Figure 13-1.

Page 291: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 269

Figure 13-1 The Alphabetical view

Icons mark the business objects and their contents. You can see a list of these icons and their meanings by choosing Legend. When you choose Legend, SAP R/3 Data Source Builder—Browser—Legend appears, as shown in Figure 13-2.

Figure 13-2 Viewing Legend

If you have many BAPI or RFMs, you can filter the Alphabetical view to locate the desired data source.

How to find a BAPI or other RFM using the Alphabetical view without filtering

1 On Data Source Builder—Browser, choose Alphabetical.

2 Locate and expand the desired business object. Then, select the desired BAPI or other RFM, as shown in Figure 13-3.

Page 292: Accessing Data

270 A c c e s s i n g D a t a

Figure 13-3 Finding a BAPI or other RFM using the Alphabetical view without filtering

How to use filtering to find a BAPI or other RFM using the Alphabetical view

1 On Data Source Builder—Browser, choose Alphabetical.

2 Choose Filters.

3 On Data Source Builder—Browser—Alphabetical—Filters, specify the desired criteria for BAPIs and RFMs. You can specify one or more of the following criteria to determine which BAPIs and RFMs appear in the list:

■ The name of the BAPI, using the asterisk (*) as a wildcard character.

■ The BAPI type:

❏ Class

❏ Instance

❏ Factory

■ Whether to display non-released BAPIs

■ Whether to display obsolete BAPIs

4 Locate and expand the desired business object. Then, select the desired BAPI or other RFM.

Finding the desired BAPI or other RFM using the Search viewTo search for a BAPI or other RFM by name, use the Search view. You can use the asterisk (*) as a wildcard character in the name.

Expand to navigate to BAPI

Select BAPI

Page 293: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 271

How to find a BAPI or other RFM using the Search view

1 On Data Source Builder—Browser, choose Search.

2 On Data Source Builder—Browser—Search:

■ Specify the RFM name. You can use the asterisk as a wildcard character.

■ Specify the group name, if desired. You can use the asterisk as a wildcard character, as shown in Figure 13-4.

Figure 13-4 Using the Search view to search by name

Choose Start Search.

3 From the alphabetical list of RFMs in Results, select the appropriate RFM, as shown in Figure 13-5.

Figure 13-5 Search results, listed alphabetically

4 In the right pane of Data Source Builder—Browser, select the checkbox that uses the name of the BAPI or RFM, as shown in the upper left corner of Figure 13-6.

Select an RFM

Page 294: Accessing Data

272 A c c e s s i n g D a t a

Figure 13-6 Data Source Builder—Browser

Viewing information about the BAPI or RFMSAP R/3 Data Source Builder—Browser displays information about the BAPI or RFM. Figure 13-7 shows the right pane of SAP R/3 Data Source Builder—Browser after a user selects the instance-independent BAPI that is called GetList in the left pane.

Figure 13-7 Viewing the selected BAPI’s information

You can view this information to verify that you have the correct BAPI or other RFM and determine if you need to modify any settings. You can also view additional information about the BAPI or other RFM, including information about its parameters, such as table definitions and structure definitions.

How to view additional information about a BAPI or other RFM

1 Select a BAPI or other RFM.

2 In the right pane of SAP R/3 Data Source Builder—Browser, choose the information icon for the BAPI or other RFM, as shown in Figure 13-8.

Instance-independent BAPI indicator

Export parameter indicatorMandatory parameter indicator

Import parameter indicator

Scalar parameter

Table parameter

Structure parameter

Page 295: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 273

Figure 13-8 Viewing additional information about the selected BAPI

When you choose the icon, documentation for the BAPI or other RFM appears, as shown in Figure 13-9.

Figure 13-9 Additional BAPI information, displayed

How to view information about the parameters of a BAPI or other RFM

You can display information about the parameters of a BAPI or other RFM. If the parameter is a table or structure parameter, you can display information about the table or structure definition.

1 Select a BAPI or other RFM.

2 In the right pane of SAP R/3 Data Source Builder—Browser, find the parameter information icon. Under the parameter information icon, choose the information icon that is next to the parameter that is under the parameter information icon, as shown in Figure 13-10.

Figure 13-10 Viewing BAPI parameter information

Choose to display information about the BAPI or RFM

Choose to display information about the parameter

Page 296: Accessing Data

274 A c c e s s i n g D a t a

When you choose the icon, Documentation appears, displaying information about the parameter, as shown in Figure 13-11.

Figure 13-11 BAPI parameter information, displayed

3 Close Documentation.

4 On SAP R/3 Data Source Builder—Browser, in the right pane of SAP R/3 Data Source Builder—Browser, find the table or structure definition icon.

If the parameter is a table or structure parameter, there is an information icon that is below the table or structure definition icon.

5 To display information about the table or structure definition, choose the information icon that is next to the table or structure parameter, as shown in Figure 13-12.

Figure 13-12 Viewing table or structure definition

If the parameter is a table parameter, Table Definition appears when you choose the icon. If the parameter is a structure parameter, Structure Definition appears. Figure 13-13 shows the table definition for the SalesOrders parameter.

6 Close Table Definition or Structure Definition.

Choose to display information about the table or structure definition

Page 297: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 275

Figure 13-13 Same display of a parameter’s table definition

Modifying parameters from BAPI or other RFMsBAPI or other RFM parameters can have the following types of parameters:

■ Export

■ Import

■ Import and export

Each import and export parameter is composed of two nodes: an import parameter node and an export parameter node. You can display or modify each node like any other import parameter or export parameter. Figure 13-14 shows the two nodes of an import and export parameter.

Figure 13-14 Import and export parameter nodes

Each import or export parameter can be one of these types:

■ Scalar

■ Structure

■ Table

Import parameterExport parameter

Import and export parameter

Page 298: Accessing Data

276 A c c e s s i n g D a t a

For example, an import parameter can be an import scalar parameter, import table parameter, or import structure parameter. Similarly, an export parameter can be an export scalar parameter, export table parameter, or export structure parameter.

By default, SAP R/3 Data Source Builder:

■ Selects the mandatory parameters for the BAPI or other RFM.

■ Assigns Actuate Basic data types.

■ Specifies an export table as the primary result set if the appropriate conditions are met.

How to include an SAP R/3 parameter in a report design

1 Select a BAPI or other RFM.

2 On SAP R/3 Data Source Builder—Browser, choose Details.

3 On SAP R/3 Data Source Builder—Details, the left pane displays:

■ Import parameters

■ Export parameters

■ Import and export parameters, each with an import parameter node and an export parameter node

Mandatory parameters are selected and appear in red. In Figure 13-15, you can see the selection of the mandatory parameters.

Figure 13-15 Mandatory parameters

4 Select a parameter name in the left pane, as shown in Figure 13-16. If the parameter is an import and export parameter, select either its import parameter node or its export parameter node.

Mandatory parameter

Page 299: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 277

Figure 13-16 Selecting a parameter name

The right pane displays the detailed information that is appropriate for the type of parameter. Figure 13-17 shows the information for an import scalar parameter.

Figure 13-17 Import scalar parameter information example

5 To include a parameter in the report design, select the parameter, as shown in Figure 13-18.

Figure 13-18 Selecting a parameter to include in the report design

Select an import parameter

Select an export parameter

Select an import parameter nodeSelect an export parameter node

Import parameter indicator

Export parameter indicatorMandatory parameter indicator

Select check box

Page 300: Accessing Data

278 A c c e s s i n g D a t a

How to modify the display name of a table parameter or structure parameter

A user who accesses a report in Actuate Active Portal or Management Console can specify parameter values on Parameters. You can modify the name that labels a table or structure parameter.

1 Select the import table parameter or import structure parameter.

2 In Display name, type the name to use on the label for the parameter. Figure 13-19 shows the right pane of SAP R/3 Data Source Builder—Details for an import table parameter. The default value for Display name is the parameter name.

Figure 13-19 Specifying a display name for a parameter

How to hide an import table or structure parameter

If you do not want report users to see an import table or structure parameter, you can hide the parameter.

1 Select the import table parameter or import structure parameter.

2 In the right pane of SAP R/3 Data Source Builder—Details, choose Hide report parameter, as illustrated in Figure 13-20.

3 Set default values for the parameter. If you hide a table parameter, provide a default value for each table column. If you hide a structure parameter, provide a default value for each part of the structure.

Edit Display name to modify the table parameter label

Page 301: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 279

Figure 13-20 Hiding a parameter

Modifying the data types and default values of SAP R/3 parametersYou can modify the default data source parameter settings. You can do this even if you are not connected to an SAP system. For more information about working offline, see “Working offline after you specify a BAPI or other RFM,” earlier in this chapter.

SAP R/3 Data Source Builder maps each import scalar parameter to a report parameter. SAP R/3 Data Source Builder maps an import structure parameter or import table parameter to a set of report parameters. For example, the set of report parameters includes one report parameter for each table column. For information about modifying a report parameter, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional. For information about specifying a value for a report parameter, see Working with Reports using Actuate Information Console.

Import parameters map to report parameters. Unless you specify a different default value, the default value for each import table parameter column is Null. The keyword Null means no input value for the field.For a parameter of type date, the default value Null is interpreted as the current date. SAP R/3 Data Source Builder maps an export scalar parameter to an Actuate Basic variable. SAP R/3 Data Source Builder maps an export structure parameter to a set of Actuate Basic variables. SAP R/3 Data Source Builder maps each column in an export table parameter to an Actuate Basic variable.

You can change the data type or data types of any export parameter. You can change the length and reference names of the data row variables that map to an

Select Hide report parameter to hide the table parameter from report users

Page 302: Accessing Data

280 A c c e s s i n g D a t a

export table parameter. The first reference name in the list appears in Fields. For more information about Fields, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.

For information about type mapping between SAP R/3 parameters and Actuate Basic variables, see the description of the AcSAPRfmSource class in Programming with Actuate Foundation Classes.

How to set default values for an import parameter

Import parameters map to report parameters, so you set their default values on Parameters after you leave SAP R/3 Data Source Builder.

1 To close SAP R/3 Data Source Builder, choose OK. You can either make all desired changes in SAP R/3 Data Source Builder first or reopen the builder later to resume making changes.

2 Choose Tools➛Parameters.

3 On Parameter Editor, select the report parameter that corresponds to the import parameter.

4 Set the default value or values for the report parameter. Figure 13-21 shows the report parameter group that corresponds to the SalesOrder import table parameter.

Figure 13-21 Setting default values for an import parameter

5 Type the desired default value beside each report parameter. For information about designing a report parameter, see Developing Actuate Basic Reports using Actuate e.Report Designer Professional.For information about specifying values for a parameter, see Working with Reports using Actuate Information Console.

Parameter’s default value is Null

Name of table parameter group

Page 303: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 281

How to change a data type, length, and reference name for an SAP R/3 export parameter

1 Select an export parameter.

2 In Actuate type for the parameter or column, select a data type. Figure 13-22 shows the location of the Actuate type field for an export scalar parameter.

Figure 13-22 The Actuate type field for an export scalar parameter

Figure 13-23 shows the location of the Actuate type field for an export structure parameter.

Figure 13-23 The Actuate type field for an export structure parameter

3 In length and reference name for an export table parameter, type the desired values. If you specify more than one reference name for a column, separate the reference names with a comma (,). Figure 13-24 shows the Actuate type, length, and reference name fields for an export table parameter.

Select an Actuate Basic type

Select Actuate Basic types

Page 304: Accessing Data

282 A c c e s s i n g D a t a

Figure 13-24 The Actuate type, length, and reference name fields for an export table parameter

Specifying the primary result setBy default, SAP R/3 Data Source Builder specifies an export table as the primary result set if either of the following conditions is met:

■ There is only one export table parameter.

■ Only one of multiple export table parameters is mandatory.

■ SAP R/3 Data Source Builder does not specify a return table as the primary result set.

If an export table is the primary result set, SAP R/3 Data Source Builder maps the export table parameter to a set of Actuate Basic variables.

How to specify an export table as the primary result set

1 Select an export table parameter.

2 In the right pane of SAP R/3 Data Source Builder—Details, select Use this export table as the primary result set, as shown in Figure 13-25. You must specify one and only one export table as the primary result set.

Specify display lengths

Specify reference names for data row variables

Select Actuate Basic types for data row variables

Page 305: Accessing Data

C h a p t e r 1 3 , A c c e s s i n g S A P R / 3 d a t a 283

Figure 13-25 Specifying an export table as the primary result set

3 Specify the Actuate Basic types, the display lengths, and reference names for columns in the primary result set, as desired, as shown in Figure 13-26.

Figure 13-26 Defining attributes for the primary result set columns

Select this option to indicate that this export table is the primary result set

Specify display lengths

Specify reference names for data row variables

Select Actuate Basic types for data row variables

Page 306: Accessing Data

284 A c c e s s i n g D a t a

Controlling RFM executionIn SAP R/3 Data Source Builder, you can control RFM execution in two ways:

■ You can provide a list of RFM error codes that Actuate should ignore.

■ You can roll back any open transactions.

How to control RFM execution

1 In the left pane of SAP R/3 Data Source Builder—Details, choose Properties.

2 To add additional error codes, choose New. Error codes must contain numbers only.

3 To delete an error code, select an error code, and choose Delete.

4 To roll back any open transactions, select Automatically rollback any opened transaction, as illustrated in Figure 13-27. If the RFM data source’s RollbackOnFinish property is parameterized, this option is unavailable.

Figure 13-27 Controlling RFM execution by rolling back any open transactions

Working offline after you specify a BAPI or other RFMAfter you specify a BAPI or other RFM as a data source on SAP R/3 Data Source Builder—Browser, you can specify data source parameters on SAP R/3 Data Source Builder—Details without connecting to an SAP system. To work offline, choose Work Offline on SAP Logon, as illustrated in Figure 13-28.

Figure 13-28 Choosing to work offline

Page 307: Accessing Data

P a r t

4Part 4Accessing data using ActuateInformation Object technology

Page 308: Accessing Data
Page 309: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 287

C h a p t e r

14Chapter 14Accessing an Actuate

Information ObjectThis chapter contains the following topics:

■ About information objects

■ Setting up the report design to access information objects

■ Using Information Object Query Builder

■ Creating an information object query in the Basic Design perspective

■ Creating a graphical information object query

■ Creating a textual information object query

■ Displaying information object query output

■ Modifying font attributes for information object query output in Actuate Query

Page 310: Accessing Data

288 A c c e s s i n g D a t a

About information objectsAn information object is an encapsulated SQL query that you use as a basis for creating queries in report designers such as Actuate e.Report Designer Professional, Actuate e.Spreadsheet Designer, and BIRT Report Designer Professional. Other Actuate products also can use information objects. Information objects enable access to data from diverse data sources, such as database tables and views, other information objects, and result sets from stored procedures and open data access (ODA) data source queries. The encapsulation of these queries supports efficient report development by:

■ Providing reusability across multiple reports and Actuate products. Report developers can use information objects to create reports in a report designer. Each report can use different columns, sorting rules, parameters, and filters, but the reports are based on the same data.

■ Hiding the complexity of data access. Using information objects separates the data access logic from the report development process. Report developers can create queries without code, even for complex data from multiple sources. Information objects enhance report development by making it possible to create and modify queries without connecting to a data source or having knowledge of the data.

When you create a query in a report designer that is based on an information object, you can use all the data in the information object as your data set, or you can use a subset of the data in the information object. You also can join multiple information objects.

Information objects are created in Actuate Information Object Designer and stored in an Actuate iServer Encyclopedia volume. To work with an information object, you must have an account on an Encyclopedia volume with the privileges that are required to access and run the information object.

The information and procedures in this chapter apply to maps and information objects. A map is created in Actuate Information Object Designer and represents one of the following items:

■ A database table

■ A database view

■ A query that is written in the database’s native SQL

■ A result set from a stored procedure

■ A result set from an ODA data source query

For more information about maps, see Designing Information Objects.

Page 311: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 289

Working with an information objectTo use an information object with a report designer you complete the following tasks:

■ Connect to an Encyclopedia volume.

■ Create a query that is based on one or more information objects.

■ Set up the report design to display the data.

■ Run the report to view the data.

Preparing to access information object dataBefore you begin to create an information object query, you need the following information:

■ The name of the Actuate iServer and the Encyclopedia volume that contains the information object

■ A user name and password for the volume

■ The name of the information object and its location in the Encyclopedia volume

You also need privileges that are sufficient to use the information object:

■ You need read privilege on the information object to create a query using the information object.

■ You need execute or trusted execute privilege on the information object to run the query.

Setting up the report design to access information objects

To access an information object, the report design must contain two components, an information object connection component and an information object data source component. You can create both types of components manually or by using Quick Report Wizard or Listing Report Wizard. In the wizards, you:

■ Choose Actuate Data Integration Service Connection as the type of database.

■ Choose Actuate Data Integration Service Data Source as the type of data stream.

You can use the user name and password defined in the connection while designing the report. Users running the report provide their own authentication information. You enable this functionality by using the UseLoggedInUserCredentialsOnServer property when you define the connection

Page 312: Accessing Data

290 A c c e s s i n g D a t a

properties for an information object. To instruct Actuate iServer to use the credentials of the user who runs the report to authenticate access to the Encyclopedia volume and information objects, set this property to False. To use the user name and password that are specified in the report design for all users who run the report, set this property to False. The default value is False.

How to define a connection for an information object manually

1 In Report Structure, ensure that you have an empty data source slot with an empty connection slot. If necessary, delete the existing data source and connection components.

2 In the toolbox, select Data to view the data tools, as shown in Figure 14-1.

Figure 14-1 Viewing the data tools

3 Drag a database connection component from Toolbox—Data and drop it in an empty connection slot, as shown in Figure 14-2.

Figure 14-2 Dropping a database connection component in a Connection slot

4 In Select Component, select Actuate Data Integration Service Connection, as shown in Figure 14-3.

Figure 14-3 Selecting the type of connection for information objects

Page 313: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 291

If you have already chosen a data source component, the choices on this dialog are limited to connection types that are compatible with your data source component.

Choose OK.

5 Drag a database source component from Toolbox—Data and drop it in an empty DataStream slot, as shown in Figure 14-4.

Figure 14-4 Dropping a database source component in a DataStream slot

6 On Select Component, select Actuate Data Integration Service Data Source, as shown in Figure 14-5.

Figure 14-5 Selecting the type of data source used for information objects

Choose OK.

The information object data source appears in the report design, as shown in Figure 14-6.

Figure 14-6 A report design with an information object data source

Page 314: Accessing Data

292 A c c e s s i n g D a t a

7 Optionally, set connection properties.

To set properties for the connection component:

1 In Report Structure, right-click the information object connection component. In the context menu, choose Properties.

2 In the Properties pane for the component, type values for the properties that appear in Table 14-1.

After you type values for these properties, the Properties page looks like the one in Figure 14-7.

Figure 14-7 Connection properties for accessing information objects

You can now define a query by accessing Information Object Query Builder.

Table 14-1 Properties for a data source accessing information objects

Property Description

Password The password for the Encyclopedia volume account that has access to the information object.

ServerUri The URL to the Actuate iServer computer that contains the Encyclopedia volume that stores the information objects. For example:

unidos.actuate.com

UserName The name of the Encyclopedia volume account that has access to the information object.

Volume The Encyclopedia volume that stores the information object.

Page 315: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 293

Using Information Object Query BuilderInformation Object Query Builder supports defining a query on information objects that were created using Actuate Information Object Designer. Use the query builder to specify the data to include, the sort order, and the parameters for filtering the data. Information Object Query Builder produces a query that obtains data from the information object data source. A report developer can use this query builder to create an information object query or change an existing information object query.

Information Object Query Builder is used by report designer applications. Information Object Query Builder runs as an application separate from the report designer applications. You must exit Information Object Query Builder before returning to work in the report designer application. When you close Information Object Query Builder, Windows sometimes does not display the report designer application as the top window. In that event, select the report designer application from the Windows task bar to continue designing your report.

Opening Information Object Query BuilderAfter you create an information object data connection component and an information object data source component, the next step is to open Information Object Query Builder. You also can use this step to reopen an existing information object query.

How to open Information Object Query Builder

1 Select an information object data source component, and choose Data. If you use a report wizard to create a report with an information object data source, that wizard starts Information Object Query Builder.

2 On Connection Properties, type in the appropriate values for the fields that are described in Table 14-2, then choose OK.

Table 14-2 Property values for accessing Information Object Query Builder

Field Description

iServer The URL to the Actuate iServer machine containing the Encyclopedia volume with the information objects.

Port number The port number to access the Actuate iServer.

Volume The Encyclopedia volume containing the information objects.

User name The name of the Encyclopedia volume account with access to the information objects.

(continues)

Page 316: Accessing Data

294 A c c e s s i n g D a t a

You do not need to provide values for the Information Console server, Information Console port, and context path fields.

3 Choose Finish.

Information Object Query Builder Basic Design appears. You can then choose how you want to develop your information object query.

Choosing an editor for designing an information object queryYou can create an information object query in three ways, depending on the number of information objects you access in your query and your familiarity with SQL concepts and the SQL language. Table 14-3 provides a brief description of the differences between the editors. When you open Information Object Query Builder, you view the Basic Design perspective by default.

Password The password for the Encyclopedia volume account with access to the information objects.

Table 14-2 Property values for accessing Information Object Query Builder

Field Description

Table 14-3 Differences between the three Information Object Query Builder editors

Editor capability

Basic Design(graphical)

Advanced Design(graphical)

Advanced Design(textual)

Can access more than one information object in the query

No Yes Yes

Provides the ability to specify sorting options, filtering, and parameters

Yes Yes Yes

Provides the ability to create a complex query No Yes Yes

Provides a graphical interface Yes Yes No

Can access the expression builder Yes Yes No

Requires understanding of SQL concepts such as joins, grouping, distinct rows, and filtering on an aggregate column

No Yes Yes

Requires the ability to write Actuate SQL code No No Yes

Can open an existing query created or modified in the Basic Design perspective

Yes Yes Yes

Can open an existing query created or modified in the Advanced Design perspective

No Yes Yes

Page 317: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 295

How to access the Advanced Design perspective

To access the Advanced Design graphical editor, open Information Object Query Builder, and choose Advanced Perspective.

How to access the textual editor

To access the textual editor, open Information Object Query Builder, and choose Advanced Perspective. On Information Object Query Builder Advanced Design, choose SQL editor.

Using the expression builderWhen designing a query, you can use Actuate SQL expressions to specify filters or joins, create aggregate data, and so on. For example, you can type expressions, such as officeID = 101 to specify that the data returned by the query must have 101 in the officeID column.

You can type these expressions in any of the three editors. In the textual editor, you type the expressions as part of the SQL SELECT statement. In the Basic Design and Advanced Design graphical query editors, you can type the expressions or use the Expression Builder to develop expressions.

Expression Builder helps you create expressions by providing a graphical interface with selections for the available parts of an expression. In Expression Builder, you can build the expressions graphically by selecting constants, operators, functions, column names and so on from a list.

You can use the Expression Builder to create Actuate SQL expressions on the Filter page of Information Object Query Builder Basic Design and many pages in Information Object Query Builder Advanced Design.

Figure 14-8 shows Expression Builder. You can drag items from the left pane to the right pane or insert items by choosing the appropriate icon. If you select a function in the left pane, the function signature appears in the bottom pane.

Can open an existing query created or modified in the textual editor

No No Yes

Table 14-3 Differences between the three Information Object Query Builder editors (continued)

Editor capability

Basic Design(graphical)

Advanced Design(graphical)

Advanced Design(textual)

Page 318: Accessing Data

296 A c c e s s i n g D a t a

Figure 14-8 Using Expression Builder to create expressions

Creating an information object query in the Basic Design perspective

You can create a query on a single information object using Information Object Query Builder Basic Design. This query editor supports specifying sorting options, filtering, and parameters. If you need to work with more than one information object or require more customization than this query editor supports, use Information Object Query Builder Advanced Design.

You can browse an iServer System Encyclopedia volume in Information Object Query Builder to find and select the information object for the query. If you have already chosen your information object and are re-entering Information Object Query Builder, the editor displays the previously selected information object unless it no longer exists in the volume. If an information object that is used by an existing query no longer exists, you must specify a new information object and specify the columns, parameters, and filters for the new information object.

An expanded folder does not reflect changes to the volume. If you or someone else loads a new information object to the volume after you expand a folder, you must collapse and expand the folder to see the changes in the information object.

To specify a basic information object query, perform these tasks:

■ Start Information Object Query Builder.

■ Select an information object for this query.

Function signature

Page 319: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 297

■ Specify the columns that you want to include in this query.

■ Specify any additional information that you want in the query:

■ Specify how you want to sort the data.

■ Specify whether users can provide parameter values when they run the report.

■ Specify the default values of information object parameters.

■ Specify any filtering that you want to restrict the data returned by the information object query.

How to create a basic information object query

1 Start Information Object Query Builder. Information Object Query Builder displays the Basic Design perspective by default.

2 Select an information object and columns by following these steps:

1 In iServer Explorer, expand the Servers node and the Encyclopedia node, as shown in Figure 14-9. Expand folders as necessary to view listings of your information objects.

Figure 14-9 Creating a basic information object query graphically

2 Expand the information object to see the columns and parameters, as shown in Figure 14-10.

Figure 14-10 Selecting an information object to use in the query

Data columns

Parameters

Page 320: Accessing Data

298 A c c e s s i n g D a t a

3 In iServer Explorer, double-click the information object that you want to use in the query. All columns in the information object appear in Output Columns. Beside each column, a check mark indicates that the column will be used in the query, as shown in Figure 14-11.

Figure 14-11 Specifying columns to use in the query

4 Deselect any columns that you do not want to include in the output.

5 To move a column in the list, select the column, and choose the up or down arrow until the column is in the right position.

3 Specify the order in which you want to sort the data:

1 On Query Design, choose Select Sort Order.

2 On Sort, in Available, expand the information object to see the columns.

3 Double-click a column that you want to sort. The column appears in Selected.

4 Under Order, as shown in Figure 14-12, click the field beside the first column on which you want to sort, and use the drop-down list to specify the sort direction for the column:

❏ For ascending order, select Asc.

❏ For descending order, select Desc.

5 Repeat substeps 3 and 4 for any other columns which you want to sort.

6 To change the sort order of a column, select the column and choose the up or down arrow key until the column is in the right position. The data returned by the query is sorted primarily by the column at the top of the list, then by each following column in the listed order.

Page 321: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 299

Figure 14-12 Specifying data sort order

4 For each available parameter, specify any default parameter values and whether users can specify the values of those parameters.

1 On Query Design, choose Define Parameters. Parameters appears, as shown in Figure 14-13.

Figure 14-13 Specifying parameters to export

2 To enable report users to specify single parameter values, export the parameters. In the left column, select each available parameter that you want to export. Parameters appear on the Information Console Requester page.

3 Under Value, specify a default value for each available parameter. If you export the parameter, specifying a default value is optional.

5 Specify filters to limit the data returned from the query by following these steps:

1 On Query Design, choose Define Filters.

2 On Filters, under Column, click in the first available row, and use the drop-down menu to select a column.

3 In the same row, click under Operator, and use the drop-down menu to select an operator.

4 In the same row, click under Value, and specify a value, as shown in Figure 14-14. You can specify a value by completing any of the following tasks:

❏ Typing a value, or parameter name

Page 322: Accessing Data

300 A c c e s s i n g D a t a

❏ Using the drop-down menu to select a column

❏ Choosing Ellipsis and creating an expression in the expression builder

Figure 14-14 Information Object Query Builder—Filters

Choose OK to save the query and return to the report design.

Creating a graphical information object queryTo specify a graphical information object query using Information Object Query Builder Advanced Design, perform the following tasks:

■ Start Information Object Query Builder and enter the Advanced Design perspective.

■ Define the query:

■ Select one or more information objects for this query.

■ Define the columns that you want to include in this query.

■ If you have more than one information object, specify the joins to use in this query.

■ Specify any filtering that you want on individual columns.

■ Specify the sort order for the data.

■ Select the columns that you want to group in the query.

■ Specify any aggregate columns that you want to filter in the query.

■ Specify parameters that report users can provide values for when they run the report.

■ Choose OK to save the query and return to the report design.

While developing your query, you can use the following tools:

■ Problems pane

As you design your queries using Information Object Query Builder Advanced Design, error messages appear in Problems, as shown in Figure 14-15. If the description is truncated, select the error message. Information Object Query Builder Advanced Design displays an Ellipsis button at the end of the description column for that error message. To view the

Page 323: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 301

complete description for that error message, choose Ellipsis. Line numbers refer to the standard Actuate SQL query, not the extended Actuate SQL query.

To filter the error messages, choose Filters. For more information about using Problems or Filters, see the Workbench User Guide in the Information Object Query Builder Advanced Design online help.

Figure 14-15 Locating errors and filtering error messages

■ SQL Preview pane

While using Information Object Query Builder Advanced Design to create a query, you can view the resulting Actuate SQL query statement. To display the query, choose SQL Preview, as shown in Figure 14-16. If you modify the information object query, choose Refresh to update the display.

Figure 14-16 Displaying the SQL for an information object query

If you use a dynamic filter in your query, the Actuate SQL query includes a FILTERS clause and :? syntax. The FILTERS clause and :? syntax are part of extended Actuate SQL. The corresponding standard Actuate SQL statements substitute dynamic filters with WHERE clause conditions that use the correct data type. To see the standard Actuate SQL query, choose Show Standard SQL in the SQL Preview pane.

Select error message

Choose Filters to filter error messages

Choose SQL Preview to display the SQL query

Choose Refresh to update the SQL query

Page 324: Accessing Data

302 A c c e s s i n g D a t a

Information Object Query Builder uses the standard Actuate SQL statement to validate the syntax of the query. If Information Object Query Builder reports a syntax error, the line number in the error message refers to the syntax that appears in standard SQL. If the query contains syntax errors, use Show Standard SQL to locate and identify the syntax errors. You can then return to viewing the extended Actuate SQL syntax by choosing Show Extended SQL.

■ Progress pane

You also can choose Progress to view the progress of any long-running tasks. Typically tasks do not run long enough for Progress to be used. For more information about using Progress, see the Workbench User Guide in the Information Object Query Builder Advanced Design online help.

■ Data Preview pane

You also can choose Data Preview to view the actual data returned.

Selecting one or more information objectsYou can browse an iServer Encyclopedia volume using Information Object Query Builder to find and select the information objects for the query.

If you have already chosen your information objects and are re-entering Information Object Query Builder, the editor displays the previously selected information objects unless they no longer exist in the volume. If an information object that is used by an existing query no longer exists, you must specify a new information object and specify the columns, parameters, and filters for the new information object.

An expanded folder does not reflect changes to the Encyclopedia volume. If you or someone else loads a new information object in the volume after you expand a folder, you must collapse and expand the folder to see the changes in the information object.

How to select an information object

1 In iServer Explorer, expand the Servers node and the Encyclopedia volume node, as shown in Figure 14-17.

Figure 14-17 Viewing information objects in iServer Explorer

Page 325: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 303

2 To view listings of your information objects, expand the relevant folders.

3 Drag the appropriate information objects from iServer Explorer to the upper pane of Query Design. The items appear in the upper pane of Query Design, as shown in Figure 14-18. By default, Information Object Query Builder selects all columns in each information object.

Figure 14-18 Selected information objects as they appear in Query Design

Defining output columnsTo define the output columns for an information object query, use Information Object Query Builder Advanced Design—Columns. For example, you can create the following SQL fragment:

SELECT ename AS employee, (salary * 12) AS annual_compFROM Employees

How to define output columns

1 In Information Object Query Builder Advanced Design, choose Columns. Information Object Query Builder Advanced Design—Columns appears.

2 In the upper pane of Information Object Query Builder Advanced Design—Columns, select the columns that you want to include and deselect the columns that you want to exclude from the query. To select all columns, select Select All at the top of the listing for that information object. By default, all columns in an information object are included in the query. The columns that you select appear in the lower pane of Information Object Query Builder Advanced Design—Columns.

3 In the lower pane of Information Object Query Builder Advanced Design—Columns:

■ To return only distinct rows, select Distinct values only. Some queries return duplicate rows. In a group of duplicate rows, each selected column contains the same value for all the rows in the group. If you want the query to return only one row for each group of duplicate rows, select Distinct

Page 326: Accessing Data

304 A c c e s s i n g D a t a

values only. This setting affects only rows in which all column values match. The query still returns rows in which only some of the column values match. If the Analysis Type property is set to Dimension or Attribute for all columns in an information object query, the DISTINCT keyword is automatically included in the query.

■ To change a column alias, type the new alias in Name. If a column alias contains a special character, such as a period (.) or a space, enclose the alias in double quotation marks ("). Do not use column aliases that are identical except for case. For example, do not use both status and STATUS as column aliases.

■ To enter an expression, select the source column, and type the expression or choose Ellipsis, as shown in Figure 14-19. Choosing Ellipsis opens the Expression Builder.

■ To change the order of the columns, use the up and down arrows.

Figure 14-19 Defining output columns

4 To define column properties, such as the display name, select the column in the lower pane of Information Object Query Builder Advanced Design—Columns, and define the properties in Properties.

How to delete output columns

To delete an output column, select the column in the lower pane of Information Object Query Builder Advanced Design—Columns, and choose Remove. To delete all output columns, choose Remove All.

Choose Ellipsis to create an expression

Page 327: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 305

Setting column propertiesTable 14-4 lists column properties and a description of each property.

Table 14-4 Column properties

Column property Can set? Description

Analysis Type Yes Analysis type in e.Analysis. If the column contains numeric values, set this property to Measure. If the column contains non-numeric values, set this property to Dimension or Attribute. If this property is set to Dimension or Attribute for all columns in an information object query, the DISTINCT keyword is included in the query.

Category Path No Path for column category and subcategories.

Data Type No Actuate SQL data type. If the data type is unknown, choose the Compile and Synchronize button.

Description Not used Not used.

Display Format Not used Not used.

Display Length Yes Number of characters to allow for display of column values in report output.

Display Name Not used Not used.

Expression Yes, on the Columns tab

Expression for a computed field.

Has Null Yes If column contains NULLs, set to True. Otherwise, set to False.

Heading Not used Not used.

Help Text Not used Not used.

Horizontal Alignment

Not used Not used.

Indexed No Indicates whether the column is indexed in the data source. True indicates that the column is indexed. False indicates that it is not indexed.

(continues)

Page 328: Accessing Data

306 A c c e s s i n g D a t a

Specifying a joinTo define the joins for an information object query, use Information Object Query Builder Advanced Design—Joins. For example, you can create the following SQL fragment:

FROM Customers INNER JOIN Orders ON (Customers.custID = Orders.custID)

About joinsA join specifies how to combine data from two information objects. The information objects do not have to be based on the same data source. A join consists of one or more conditions that must all be true. In the resulting SQL SELECT statement, join conditions are linked with AND.

A join can consist of multiple conditions in the following form:

columnA = columnB

A join can have only one condition that uses an operator other than equality (=) or an expression, for example:

columnA < columnB

Information Object Query Builder Advanced Design does not support right outer joins or full outer joins.

How to define a join condition

1 In Information Object Query Builder Advanced Design, choose Joins. Information Object Query Builder Advanced Design—Joins appears.

2 In the upper pane, drag the join column from the first information object, and drop it on the join column in the second information object.

The upper pane shows the join condition, like the one in Figure 14-20, and the join columns and operator are listed in the lower pane.

Name Yes, on the Columns tab

The alias for the column in the information object query.

Text Format Not used Not used.

Word Wrap Not used Not used.

Table 14-4 Column properties (continued)

Column property Can set? Description

Page 329: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 307

Figure 14-20 Joined columns from two information objects

3 In the lower pane, select the row that describes the new join condition.

4 If necessary, select a different join condition operator from the drop-down list. By default, Information Object Query Builder Advanced Design uses the equality operator (=) to relate two columns.

5 To change a column name to an expression, select the column name, and type the expression, or choose Ellipsis to display the expression builder, as shown in Figure 14-21.

Figure 14-21 Defining a join

If the join has a condition that uses an operator other than equality (=) or an expression, the upper pane marks the join line with the symbol that appears in Figure 14-22.

Equality operator

Select a join condition operator

Choose Ellipsis to create an expression

Page 330: Accessing Data

308 A c c e s s i n g D a t a

Figure 14-22 A join condition that uses an expression or an operator other than equality

6 If the join consists of more than one condition, repeat this procedure for the other conditions.

7 Choose one of the following join types:

■ Inner join

■ Left outer join

8 Optimize the join.

How to delete a join condition

To delete a join condition, select the join condition in the upper pane of Information Object Query Builder Advanced Design—Joins, and press Delete.

Optimizing joinsYou can improve a query’s performance by optimizing the joins. To optimize a join, you can specify the cardinality of the join. Specifying the cardinality of the join adds the CARDINALITY keyword to the Actuate SQL query. If your query is based on two or more information objects based on different data sources, you also can optimize the join by specifying the join algorithm.

Figure 14-23 shows how to specify the cardinality of an information object,and how to specify a join algorithm in Information Object Query Builder Advanced Design—Joins.

Join uses an operator other than equality (=) or an expression

Page 331: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 309

Figure 14-23 Optimizing a join

When you join information objects that are built from different data sources, the Actuate SQL compiler chooses a join algorithm. If you have a good understanding of the size and distribution of the data, however, you can specify the join algorithm. Choosing the correct join algorithm can significantly reduce information object query execution time. Actuate SQL supports three join algorithms:

■ Dependent

■ Merge

■ Nested Loop

When you join information objects that are built from the same data source, specifying a join algorithm has no effect. The join is processed by the data source.

About dependent joins

A dependent join is processed in the following way:

■ The left side of the join statement is executed, retrieving all the results. The results are then processed one at a time (pipelined).

■ For each left side result, the right side of the join is executed, parameterized by the values provided by the current left side row.

A dependent join is advantageous when the cardinality of the left side is small, and the selectivity of the join criteria is both high and can be delegated to the data source. When the cardinality of the left side is high, a dependent join is relatively slow because it repeatedly executes the right side of the join.

Dependent joins can be used for any join criteria, although only join expressions that can be delegated to the right side’s data source result in improved selectivity performance.

About merge joins

A merge join is processed in the following way:

■ The left side of the join statement is executed, retrieving all the results sorted by the left side data source. The results are then processed one at a time (pipelined).

■ The right side of the join statement is executed, retrieving all the results sorted by the right side data source. The results are then processed one at a time (pipelined).

Applies CARDINALITY keyword

Specifies join algorithm

Page 332: Accessing Data

310 A c c e s s i n g D a t a

A merge join can only be used with an equijoin. A merge join has much lower memory requirements than a nested loop join and can be much faster. A merge join is especially efficient if the data sources sort the rows.

About nested loop joins

A nested loop join is processed in the following way:

■ The left side of the join statement is executed, retrieving all the results. The results are then processed one at a time (pipelined).

■ The right side of the join statement is executed. The results are materialized in memory. For each row on the left side, the materialized results are scanned to find matches for the join criteria.

A nested loop join is advantageous when the cardinality of the right side is small. A nested loop join performs well when the join expression cannot be delegated to the data source. A nested loop join can be used for any join criteria, not just an equijoin.

A nested loop join is a poor choice when the cardinality of the right side is large or unknown, because it may encounter memory limitations. Increasing the memory available to the Integration service removes this limitation. The Integration service parameter Max memory per query specifies the maximum amount of memory to use for an Integration service query. For more information about this parameter, see Configuring Actuate iServer.

How to specify a join algorithm

In the lower pane of Information Object Query Builder Advanced Design—Joins, select the appropriate join and choose one of the following from the Specify join algorithm drop-down list shown in Figure 14-24:

■ Dependent

■ Merge

■ Nested loop

Figure 14-24 Specifying the join algorithm

Specifying filtering on a columnA filter restricts the data that is returned by an information object query. To define a filter for an information object query, use Information Object Query Builder Advanced Design—Filters.

Page 333: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 311

This interface creates a WHERE clause for the query. For example, you can create the following SQL fragment:

WHERE salary > 5000 AND rank = 3

Setting filter conditionsFilters are optional. You can set filter conditions by:

■ Creating a parameterized static filter condition

You can use a static parameter to enable users to specify a single value for a column when the query runs.

■ Creating a dynamic filter

In Information Object Designer, a data architect can set the Filter property of an information object’s column to Predefined. When you use the information object in a query, that column is listed as a dynamic filter. Dynamic filters appear on Information Object Query Builder Advanced Design—Filters and Information Object Query Builder Advanced Design—Having.

You also can create a dynamic filter in a report designer. Report designers map a dynamic filter to an ad hoc parameter to give users the opportunity to specify additional filter conditions for the query.

An ad hoc parameter in e.Report Designer Professional enables users to specify a QBE expression as the value. For information about QBE syntax, see Working with Reports using Actuate Information Console. e.Spreadsheet Designer uses an ad hoc parameter as part of a simple equal condition in the query. A user cannot use QBE syntax with an e.Spreadsheet Designer ad hoc parameter.

■ Creating a static filter condition using Actuate SQL

For example, you can use a filter to control which rows are returned based on the user’s Encyclopedia volume user name. This filter uses the CURRENT_USER( ) Actuate SQL function. The following filter indicates that the query returns only rows where the employee name matches the user’s Encyclopedia volume user name:

WHERE empname = CURRENT_USER( )

Filter conditions are linked with AND, so the data must meet all filter conditions. Do not give a parameter the same name as a predefined filter column’s name or display name. A static parameter must not have the same name as an ad hoc parameter.

How to define a static filter condition

1 In Information Object Query Builder Advanced Design, choose Filters.

2 On Information Object Query Builder Advanced Design—Filters:

■ In Select columns to filter, click in the top empty line.

Page 334: Accessing Data

312 A c c e s s i n g D a t a

■ In Column or expression, select a column from the drop-down list, or choose Ellipsis to create an expression. The drop-down list contains the columns that you defined on Information Object Query Builder Advanced Design—Columns.

■ In Operator, select an operator from the drop-down list.

■ In Value, complete one of the following actions:

❏ Choose a column, parameter, or expression from the drop-down list. The drop-down list contains the columns and expressions that you defined on Information Object Query Builder Advanced Design—Columns and any parameters that you defined on Information Object Query Builder Advanced Design—Parameters.

❏ Choose Ellipsis to create an expression using the expression builder.

❏ Type a value:

❏ If Value is a string, enclose the string in single quotation marks, for example:

'New York City'

❏ If Value is a timestamp, it must be in the following form:

TIMESTAMP '2001-02-03 12:11:10'

❏ If Value is a number, use a period (.) as the decimal separator, for example:

123456.78

❏ If Value is a parameter, precede the parameter name with a colon (:), as shown in Figure 14-25.

Figure 14-25 Using a parameter as the value for a column or expression

How to delete a static filter condition

1 In Information Object Query Builder Advanced Design, choose Filters.

Choose Ellipsis to create an expression

Page 335: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 313

2 On Information Object Query Builder Advanced Design—Filters, complete the appropriate task:

■ To delete a single, static filter condition, select the filter in Select columns to filter, and choose Remove.

■ To delete all static filter conditions, choose Remove All.

How to define an ad hoc filter condition

1 In Information Object Query Builder Advanced Design, choose Filters.

2 On Information Object Query Builder Advanced Design—Filters, scroll down to see Select dynamic filters, as shown in Figure 14-26.

Figure 14-26 Selecting a dynamic filter to create an ad hoc filter condition

3 To create a new dynamic filter, click in the first blank row under the Column or expression column. Use the drop-down menu to add a column or choose Ellipsis to create an expression. Chose Prompt Editor to view or change the properties of the prompt.

4 For each dynamic filter, you can perform the following steps:

1 To set or change the data type, click the filter’s row under Data type, and select a data type from the drop-down list.

2 To change how the user is prompted for a value for the dynamic filter when running a report, click the filter’s row under Prompt Editor. This action displays Prompt Editor, where you can change the prompt properties for the filter.

How to remove a dynamic filter

In Information Object Query Builder Advanced Design, choose Filters.

On Information Object Query Builder Advanced Design—Filters, complete the appropriate task:

■ To delete a single ad hoc filter condition, select the filter in Select dynamic filters, and choose Remove.

■ To delete all ad hoc filter conditions, choose Remove All.

Page 336: Accessing Data

314 A c c e s s i n g D a t a

How to define a filter condition using Actuate SQL

1 In Information Object Query Builder Advanced Design, choose Filters.

2 On Information Object Query Builder Advanced Design—Filters, complete the following tasks:

■ Click in the text box.

■ Type the filter condition using Actuate SQL, as shown in Figure 14-27. If a table or column identifier contains a special character, such as a space, enclose the identifier in double quotation marks (").

Figure 14-27 Using Actuate SQL to define a filter condition

How to delete a filter condition written in Actuate SQL

1 In Information Object Query Builder Advanced Design, choose Filters.

2 On Information Object Query Builder Advanced Design—Filters, complete the following tasks:

■ Select the text in the text box.

■ Choose Edit➛Cut.

Setting filter prompt propertiesWhen you create a dynamic filter, you can use the Prompt editor to specify the filter’s display control type, list of values, and default value. You create a list of values by typing the values or by typing an Actuate SQL query that retrieves the values. You can specify the filter values as well as the values displayed to the user. If you type a query, the query must meet the following requirements:

■ The query must retrieve one or two columns from an information object or map, for example:

SELECT DISTINCT custID, customNameFROM "MyInformationObject.iob"ORDER BY 2

The first column contains the filter values and must be of string data type. The second column contains the values displayed to the user. The information object or map must reside in the same volume as the report executable. You must use an absolute path to reference the information object or map. If the

Page 337: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 315

information object or map defines a parameter, you must provide a value for the parameter, for example:

SELECT DISTINCT custID, customNameFROM "MyInformationObject.iob" ['CA']ORDER BY 2

■ The query must not contain a WITH clause.

The filter values are interpreted as QBE expressions. Certain characters, for example, the comma (,) and the pipe sign (|), are interpreted as operators in a QBE expression. For example, the QBE expression:

16M x 1 Dynamic Ram, 3.3 volts

is interpreted as:

WHERE description LIKE '16M x 1 Dynamic Ram%' OR description LIKE '3.3 volts%'

If you want these characters to be interpreted literally, enclose the strings in four single quotation marks ('''') as shown in the following Actuate SQL queries:

■ To match a string exactly:

SELECT '''' || description || ''''FROM "MyInformationObject.iob"

■ To match a string using the LIKE operator:

SELECT '''' || description || '%'''FROM "MyInformationObject.iob"

|| is the concatenation operator.

Information Object Query Builder Advanced Design does not validate the query. The values returned by the query appear when a user specifies a value for the ad hoc parameter when running a report. The values do not appear, however, when a report developer specifies a value for the ad hoc parameter when running a report in a report designer.

For more information about QBE expressions, see Working with Reports using Actuate Information Console.

How to set the prompt properties of a dynamic filter

Setting the prompt properties of a filter affects how the user sees the filter when running the report.

1 In Information Object Query Builder Advanced Design, choose Filters if you want to change the prompt properties of a filter on a non-aggregated column or expression. If you want to change the prompt properties of a filter on an aggregated column, choose Having.

2 Scroll down to Select Dynamic Filters so that you can see the filter.

Page 338: Accessing Data

316 A c c e s s i n g D a t a

3 In the row for that filter, choose Prompt editor.

The Prompt editor appears.

4 On Prompt editor, complete the following tasks:

■ In Show as, select the display control type. The choices available and appearance of the page depend on the display control type you select.

■ If you use a display control type other than Text box, you can specify a list of values for the user to choose by typing the values and, optionally, the display names, as shown in Figure 14-28.

■ In Default value, specify the default value. The default value can be a QBE expression.

Figure 14-28 Typing values and display names for a filter

To create an Actuate SQL query that retrieves the values, select Dynamic list of values, as shown in Figure 14-29, and type the query.

If you select Combo box (editable), Dynamic list of values, and Auto suggest, a drop-down list appears after the report user types the number of characters specified in Start Auto suggest after N character(s). The list contains values that begin with the characters the user typed. For example, if the user typed 'Atel and N=4, the list contains the value 'Atelier graphique'. In this case, the query that retrieves the values must select two columns, a value column and a display name column.

Choose OK.

Type values and display names

Page 339: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 317

Figure 14-29 Creating an Actuate SQL query to generate values for a filter

Specifying the sort orderTo define the sort order for an information object query, use Information Object Query Builder Advanced Design—Sort. For example, you can create the following SQL fragment:

ORDER BY rank Descadds to the value of the doc.--Melia 060803>>

How to define sort order

1 In Information Object Query Builder Advanced Design, choose Sort.

2 On Information Object Query Builder Advanced Design—Sort, complete the following tasks:

■ If you want to sort on a column in an information object query that is not an output column, select Show all. By default, Information Object Query Builder displays only output columns and computed fields in Available.

Select a column, and choose its sort order:

1 In Available, select the column, and choose Select.

Select Dynamic list of values

Page 340: Accessing Data

318 A c c e s s i n g D a t a

2 Use the drop-down menu in the Order field for the column name to select Asc to sort the column in ascending order or Desc to sort the column in descending order.

Repeat these steps for each sort column.

■ To change the order of the sort columns, select a column, and use the up or down arrow, as shown in Figure 14-30.

Figure 14-30 Defining the sort order for columns

How to remove sort columns

To remove a sort column, select the sort column in Selected, and choose Deselect.

To remove all sort columns, choose Remove All.

Specifying columns to group in the queryTo specify columns that you want to group in a query, use Information Object Query Builder Advanced Design—Group By. Settings that you make on this page create a GROUP BY clause for the query. For example, you can create the following SQL fragment:

GROUP BY rank

How to specify grouping columns

1 In Information Object Query Builder Advanced Design, choose Group By. Information Object Query Builder Advanced Design—Group By appears.

2 In Available, expand Computed and Output nodes to view available columns.

3 By default, Information Object Query Builder displays only output columns and computed fields in Available. To group on a column in an information object query that is not an output column, choose Show all.

4 In Available, select the appropriate column, and choose Select. This action moves the column name to Selected, as shown in Figure 14-31.

Page 341: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 319

Figure 14-31 Selecting a column to use as a grouping column

5 Repeat the previous step for each grouping column.

6 To change the order of the group columns, select a column in Selected, and use the up or down arrow.

How to delete a grouping column

1 In Information Object Query Builder Advanced Design, choose Group By.

2 On Information Object Query Builder Advanced Design—Group By, complete one of the following tasks:

■ To delete a grouping column, select the column in Selected, and choose Deselect.

■ To delete all group columns, choose Remove All.

Specifying filtering on an aggregate columnYou can specify aggregate columns on which you want to filter using Information Object Query Builder Advanced Design—Having. Settings that you make on this page create a HAVING clause for the query. For example, you can create the following SQL fragment:

HAVING COUNT (*) > 3

Aggregate filters are optional. You can specify aggregate filter conditions individually or type your own HAVING clause. You can also define an ad hoc filter condition. HAVING conditions are linked with AND, so the data must meet all filter conditions.

You can create a dynamic aggregate filter in a report designer. The report designer maps a dynamic filter to an ad hoc parameter to give users the opportunity to specify additional filter conditions for the query. An ad hoc parameter in e.Report Designer Professional enables users to specify a QBE expression as the value. For information about QBE syntax, see Working with Reports using Actuate Information

Page 342: Accessing Data

320 A c c e s s i n g D a t a

Console. e.Spreadsheet Designer uses an ad hoc parameter as part of a simple equal condition in the query.

How to create a static aggregate filter condition

1 In Information Object Query Builder Advanced Design, choose Having.

2 On Information Object Query Builder Advanced Design—Having, complete the following tasks:

■ In Select aggregate columns to filter, click the top empty line.

■ In Aggregate expression, complete one of the following tasks:

❏ Type an aggregate expression.

❏ Choose an aggregate expression from the drop-down list. The drop-down list contains the aggregate expressions that you defined on Information Object Query Builder Advanced Design—Columns.

❏ Choose Ellipsis to create an aggregate expression in Expression Builder.

■ In Operator, select an operator from the drop-down list.

■ In Value, complete one of the following tasks:

❏ Choose a column, parameter, or expression from the drop-down list. The drop-down list contains the columns and expressions you defined on Information Object Query Builder Advanced Design—Columns and any parameters you defined on Information Object Query Builder Advanced Design—Parameters.

❏ To create an expression, choose Ellipsis.

❏ Type a value, as shown in Figure 14-32.

❏ If the value is a string, enclose the string in single quotation marks, as shown in the following example:

'New York City'

❏ If the value is a time stamp, it must be in the following form:

TIMESTAMP '2001-02-03 12:11:10'

❏ If the value is a number, use a period (.) as the decimal separator, as shown in the following example:

123456.78

❏ If the value is a parameter, precede the parameter name with a colon (:).

Page 343: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 321

Figure 14-32 Creating a static aggregate filter condition

How to delete a static aggregate filter condition

1 In Information Object Query Builder Advanced Design, choose Having.

2 On Information Object Query Builder Advanced Design—Having, complete one of the following tasks:

■ To delete a single static aggregate filter condition, select the filter in Select aggregate columns to filter, and choose Remove.

■ To delete all static filter conditions, choose Remove All.

How to define an ad hoc aggregate filter condition

1 In Information Object Query Builder Advanced Design, choose Having.

2 On Information Object Query Builder Advanced Design—Having, scroll down to see Select dynamic filters, as shown in Figure 14-33.

Figure 14-33 The Having page’s Select dynamic filters area

3 For each filter condition, perform the following tasks:

■ In Aggregate expression, complete one of the following tasks:

❏ Type an aggregate expression.

❏ Choose an aggregate expression from the drop-down list. The drop-down list contains the aggregate expressions that you defined on Information Object Query Builder Advanced Design—Columns.

Choose Ellipsis to create an aggregate expression

Page 344: Accessing Data

322 A c c e s s i n g D a t a

❏ Choose Ellipsis to create an aggregate expression in Expression Builder.

■ In Data type, select a data type from the drop-down list.

■ To change how the user is prompted for a value for the dynamic filter when running a report, click the filter’s row under Prompt Editor. This action displays Prompt Editor, where you can change the prompt properties for the filter.

How to delete an ad hoc aggregate filter condition

1 In Information Object Query Builder Advanced Design, choose Having.

2 On Information Object Query Builder Advanced Design—Having, complete one of the following tasks:

■ To delete a single ad hoc aggregate filter condition, select the filter in Select dynamic filters, and choose Remove.

■ To delete all ad hoc aggregate filter conditions, choose Remove All.

How to create a static aggregate filter condition by writing Actuate SQL

1 In Information Object Query Builder Advanced Design, choose Having.

2 On Information Object Query Builder Advanced Design—Having, in the text box, type the HAVING clause condition using Actuate SQL, as shown in Figure 14-34. If a table or column identifier contains a special character, such as a space, enclose the identifier in double quotation marks (").

Figure 14-34 Typing a HAVING clause condition using Actuate SQL

How to delete a static aggregate filter condition that was written in Actuate SQL

1 In Information Object Query Builder Advanced Design, choose Having.

2 On Information Object Query Builder Advanced Design—Having, select the text in the text box, and choose Edit➛Cut.

Defining parametersAn Actuate SQL parameter is a variable that is used in an information object query. When a report developer runs a report on the desktop, they provide a value for this variable. When a user runs a report in an Encyclopedia volume, the user provides a value for this variable on the Requester page in Information Console.

Page 345: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 323

For example, the following Actuate SQL query uses the parameters lastname and firstname in the WHERE clause:

WITH ( lastname VARCHAR, firstname VARCHAR )SELECT lname, fname, address, city, state, zipFROM customerstableWHERE (lname = :lastname) AND (fname = :firstname)

If an Actuate SQL query defines a parameter in a WITH clause but does not use the parameter, the query does not return any rows if no value is provided for the parameter when the report runs. For example, the following query does not return any rows if no values are provided for the lastname and firstname parameters when the report runs:

WITH ( lastname VARCHAR, firstname VARCHAR )SELECT lname, fname, address, city, state, zipFROM customerstable

How to define a parameter

1 In Information Object Query Builder Advanced Design, choose Parameters. Information Object Query Builder Advanced Design—Parameters appears.

2 In Parameters, click the top empty line, and complete the following tasks:

■ In Parameter, type the name of the parameter. If a parameter name contains a special character, such as a period (.) or a space, enclose the name in double quotation marks (").

■ In Data type, select a data type from the drop-down list.

■ In Default value, type the default value:

❏ If Default value is a string, enclose the string in single quotation marks, as shown in the following example:

'New York City'

❏ If Default value is a timestamp, it must be of the following form:

TIMESTAMP '2001-02-03 12:11:10'

❏ If Default value is a number, use a period (.) as the decimal separator, as shown in the following example:

123456.78

NULL is not a valid parameter value. You cannot use a QBE expression.

■ To change the order of the parameters, use the up or down arrow.

■ To use the Prompt editor to specify the parameter’s prompt properties, choose Prompt editor, as shown in Figure 14-35.

Page 346: Accessing Data

324 A c c e s s i n g D a t a

Figure 14-35 Choosing Prompt editor to specify a parameter’s prompt properties

■ To define other parameter properties, such as display name, select the parameter in Information Object Query Builder Advanced Design—Parameters, and define the properties in Properties.

How to delete a parameter

1 To delete a parameter, on Information Object Query Builder Advanced Design, choose Parameters.

2 On Information Object Query Builder Advanced Design—Parameters, complete one of the following tasks:

■ To delete an individual parameter, select the parameter, and choose Remove.

■ To delete all parameters, choose Remove All.

Specifying a parameter’s prompt propertiesUse the Prompt editor to specify a parameter prompt’s properties, including display control type, list of values, and default value. You can specify the parameter values and, if desired, a corresponding set of display values that the users choose. You create a list of values by typing the values or by typing an Actuate SQL query that retrieves the values.

The query must meet the following requirements:

■ The query must retrieve one or two columns from an information object or map, as shown in the following example:

SELECT DISTINCT custID, customNameFROM "MyInformationObject.iob"ORDER BY 2

Choose Prompt editor to specify prompt properties

Page 347: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 325

The first column contains the parameter values. The second column contains the values that are displayed to the user. The information object must reside in the same volume as the report executable. You must use an absolute path to reference the information object or map. If the information object defines a parameter, you must provide a value for the parameter, as shown in the following example:

SELECT DISTINCT custID, customNameFROM "MyInformationObject.iob" ['CA']ORDER BY 2

■ The first column’s data type must match the parameter’s data type.

■ The query must not contain a WITH clause.

The query editor does not validate the query. The values returned by the query appear when a user specifies a value for the parameter. The values do not appear, however, if a report developer specifies a value for the parameter in a report designer.

How to specify a parameter prompt’s properties

1 Locate the appropriate parameter in Information Object Query Builder Advanced Design—Parameters, and choose Prompt editor.

2 On the Prompt editor, in Show as, select the method of prompting the user, as shown in Figure 14-36. If you use a type of display other than a text box, you can specify a list of values for the user to choose.

Figure 14-36 Selecting the method of prompting the user

You can create a list of values by typing the values and, optionally, the display names, as shown in Figure 14-37. If you do not provide a display name, the values is displayed to the user.

You can create an Actuate SQL query that retrieves the values or both the values and the corresponding display names. If the query has two columns, the values in the second column are used as the display names. To use a query to create the list of values, select Dynamic list of values, as shown in Figure 14-38, and type the query.

Page 348: Accessing Data

326 A c c e s s i n g D a t a

Figure 14-37 Typing a list of values and display names

Figure 14-38 Specifying an Actuate SQL query to provide a dynamic list of values

Type values and display names

Type Actuate SQL query

Select Dynamic list of values

Page 349: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 327

If you select Combo box (editable), Dynamic list of values, and Auto suggest, a drop-down list appears after the report user types the number of characters specified in Start Auto suggest after N character(s). The list contains values that begin with the characters the user typed. For example, if the user typed 'Atel and N=4, the list contains the value 'Atelier graphique'. In this case, the query that retrieves the values must select two columns, a value column and a display name column.

3 In Default value, you specify the default value.

4 You also can specify values for the following additional properties:

■ Conceal value

■ Do not prompt

■ Required

When you finish specifying the property values for the prompt, choose OK.

Setting parameter propertiesTable 14-5 lists parameter properties and provides a description of each property.

Table 14-5 Parameter properties

Parameter property Can set? Description

Conceal Value Yes, in the Prompt editor

Visibility of the value that the user provides for this parameter. To conceal the value, set to True. To display the value, set to False. This parameter property applies only to parameters with the varchar data type and the text box display type.

Data Type Yes, on the Parameters tab

Parameter’s data type.

Default Value Yes, in the Prompt editor

Parameter’s default value. If a parameter does not have a default value, and the Required property is set to False, the parameter takes one of the following values if the user does not provide a value:■ 0 if the parameter is of type decimal,

double, or integer.■ Empty string if the parameter is in the

varchar data type.■ Current date and time if the parameter

is in the timestamp data type.

(continues)

Page 350: Accessing Data

328 A c c e s s i n g D a t a

Setting source parametersA source parameter is a parameter that is defined in a information object from which you are building an information object query. If a query contains an information object with a parameter, Information Object Query Builder Advanced Design—Parameters has a Source parameter field.

Description Not used Not used.

Display Control Type

Yes, in the Prompt editor

Control type for this parameter. The options are text box, read-only drop-down list, editable drop-down list, or radio buttons.

Display Format Not used Not used.

Display Length Not used Not used.

Display Name Not used Not used.

Do Not Prompt Yes, in the Prompt editor

Visibility of the parameter to the user. To hide this parameter, set to True. To display the parameter, set to False.

Heading Not used Not used.

Help Text Not used Not used.

Horizontal Alignment

Not used Not used.

Name Yes, on the Parameters tab

Parameter name.

Parameter Mode Yes Setting for parameters that are in stored procedures and ODA data source queries to specify the input or output type of the parameter. The options are Input, Output, InputAndOutput, or ReturnValue. ReturnValue is used only for stored procedures and is equivalent to Output.

Required Yes, in the Prompt editor

Indicator of whether the parameter is required. To require a value for this parameter, set to True. Otherwise, set to False.

Size Yes The size of the parameter if the parameter data type is varchar. Otherwise, not used. Must be set if size is greater than 1300.

Table 14-5 Parameter properties (continued)

Parameter property Can set? Description

Page 351: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 329

You can set a source parameter to one of the following types of values:

■ A single scalar value.

■ A local parameter in the information object query that you are creating.

You cannot set a source parameter to a column reference, such as ORDERS.ORDERID, or an Actuate SQL expression.

When you set a source parameter to a local parameter, you can indicate that the local parameter inherits the values of its prompt properties from the source parameter. The available prompt properties are Conceal Value, Default Value, Display Control Type, Do Not Prompt, and Required. If you specify that the local parameter inherits its prompt property values from the source parameter, and prompt property values for the source parameter change, the changes are propagated to the local parameter. For example, if the display control type for the source parameter changes from text box to read-only drop-down list, the display control type for the local parameter also changes from text box to read-only drop-down list.

If you change a prompt property value for a local parameter, its prompt property values are no longer inherited from the source parameter. For example, if you change the display control type for the local parameter to editable drop-down list, and the display control type for the source parameter later changes to text box, the change is not propagated to the local parameter. To reinstate inheritance, choose Reset in the Prompt editor. Choosing Reset returns all property values in the local parameter to inherited values, and the local parameter inherits any future changes to property values in the source parameter.

To set source parameters, use Information Object Query Builder Advanced Design—Parameters. To define a local parameter and set a source parameter to the local parameter in one step, drag the source parameter from Source parameter, and drop it in Parameter, as shown in Figure 14-39.

Figure 14-39 Setting a source parameter for a new, local parameter

Choose Reset to reset value to default value

Page 352: Accessing Data

330 A c c e s s i n g D a t a

How to set a source parameter

1 In Information Object Query Builder Advanced Design, choose Parameters.

2 On Information Object Query Builder Advanced Design—Parameters, complete the following tasks:

■ In Source parameter, select the appropriate parameter.

■ In Value, complete one of the following tasks:

❏ Choose a parameter from the drop-down list. The drop-down list contains the local parameters for the information object query you are building.

❏ Type a value, as shown in Figure 14-40:

❏ If Value is a string, enclose the string in single quotation marks, as shown in the following example:

'New York City'

❏ If Value is a timestamp, it must be in the following form:

TIMESTAMP '2001-02-03 12:11:10'

❏ If Value is a number, use a period (.) as the decimal separator, as shown in the following example:

123456.78

❏ If Value is a parameter, precede the parameter name with a colon (:).

Figure 14-40 Providing a value for a source parameter

Synchronizing source parametersYou must synchronize source parameters when parameters in a source information object are added, removed, or reordered, or their data types or other properties change. To synchronize source parameters, choose Synchronize in Information Object Query Builder Advanced Design, as shown in Figure 14-41. Synchronizing source parameters refreshes the list of source parameters on Information Object Query Builder Advanced Design—Parameters.

Page 353: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 331

Figure 14-41 Synchronizing source parameters

Creating a textual information object queryUse the Actuate SQL text editor if either of the following conditions is true:

■ Information Object Query Builder Advanced Design does not generate the desired Actuate SQL query, so you must edit the query. For example, if the query includes OR or UNION, you must use the Actuate SQL text editor to edit the query.

■ You want to type or paste an Actuate SQL query instead of creating it graphically.

If you save a query in the Actuate SQL text editor, you cannot modify the query in Information Object Query Builder Advanced Design.

To display the Actuate SQL text editor, complete one of the following tasks:

■ In Information Object Query Builder Advanced Design, choose SQL editor, as shown in Figure 14-42.

Choose Synchronize to synchronize source parameters

Page 354: Accessing Data

332 A c c e s s i n g D a t a

Figure 14-42 Choosing SQL editor to edit an Actuate SQL query

■ On Information Object Query Builder Advanced Design—SQL Preview, choose Edit SQL.

You edit the query in the upper pane of the Actuate SQL text editor. The lower pane displays output columns or parameters.

When you edit a query in the SQL text editor, do not use table and column aliases that are identical except for case. For example, do not use both status and STATUS as column aliases.

Absolute paths are recommended in the Information Object Query Builder because the report executable may not be in the same Encyclopedia volume as the information object.

Figure 14-44 shows the Actuate SQL text editor.

Displaying output columnsIn SQL Text Editor—Columns, to display the query’s output columns and the data type for each column, choose Describe Query, as shown in Figure 14-43.

Choose SQL editor to edit the SQL query

Page 355: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 333

Figure 14-43 Using Describe Query to display the query’s output columns

To specify column property values, select the column, and specify the property values in Properties.

Figure 14-44 Editing the SQL query in the Actuate SQL text editor

Displaying parametersOn SQL Text Editor—Parameters, choose Describe Query to display the query’s parameters and the data type for each parameter. You can type a default value for a parameter in Default value, as shown in Figure 14-45.

Choose Describe Query to display the query’s output columns

Edit SQL query

Page 356: Accessing Data

334 A c c e s s i n g D a t a

Figure 14-45 Using Describe Query to display the query’s parameters

You can choose Prompt Editor to set the prompt property values.

Displaying information object query outputTo preview output, you can display information object query output.

How to display information object query output

1 Choose Data Preview.

2 In Data Preview, choose Refresh. As shown in Figure 14-46, Parameter Values appears if the information object query defines parameters.

Figure 14-46 Specifying parameter values

3 On Parameter Values, type the parameter values. A parameter value must be a single value, not a list of values. When you finish, choose OK, and information object query output appears, as shown in Figure 14-47.

4 Use the scroll bars to view all columns and displayed rows. Use the Page Size list box to change the number of rows displayed on each page. Use the Next Page and Previous Page icons to navigate through the data preview one page at a time.

Choose Describe Query to display the query’s parameters

Choose Prompt editor to specify the prompt property values

Page 357: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 335

Figure 14-47 Viewing the information object query’s output

Modifying font attributes for information object query output in Actuate Query

If you plan to use Actuate Query to query information object (.iob) files, you can use e.Report Designer Professional to modify fonts used in Actuate Query output. Although you make this modification using e.Report Designer Professional, it does not affect any information object queries that were created in e.Report Designer Professional’s Information Object Query Builder.

To display the Actuate Query output, an IOB uses the font settings that are specified in a template file that is located in an Encyclopedia volume. To modify these fonts using e.Report Designer Professional, you set property values for the report component of the template file, which is a report object design (.rod) file. You can change the settings of the font properties that appear in Table 14-6.

Page Size list box

Next PagePrevious Page

Refresh

Page 358: Accessing Data

336 A c c e s s i n g D a t a

After you set the values of the font properties in the template file, you complete the following tasks to make the file available to Actuate iServer System:

■ Build a data object executable (.dox) file from the report object design (.rod) file.

■ Publish the DOX to an Encyclopedia volume.

■ Set the volume’s Actuate Query Generation property to specify the path to, and name of, the DOX in the Encyclopedia volume.

For more information about using a DOX as a font template file for Actuate Query output, see Configuring Actuate iServer.

How to modify fonts used in Actuate Query output

This procedure explains how to modify fonts in a report object design (.rod) file used in Actuate Query output. You build a data object executable (.dox) file and publish it to an Encyclopedia volume.

1 In e.Report Designer Professional, open \Program Files\Actuate10\eRDPro\lib\AQTemplate.rod. AQTemplate.rod appears in Design Editor.

2 Save the file with a different name, such as AQTemplate_fonts.rod.

3 In Report Structure, right-click the report component, ActuateQueryTemplate. Choose Properties. The Properties page for the component appears.

4 On the Properties page, complete the following tasks:

1 Expand Auto Contents, as shown in Figure 14-48.

Figure 14-48 Auto Contents group of attributes

Table 14-6 Modifiable font properties

Font property Text affected

DataFont Data that is retrieved from the data sources

LabelFont Column headings

PageDecorationFont Page number and date in the footer

TitleFont Title for Actuate Query output

Page 359: Accessing Data

C h a p t e r 1 4 , A c c e s s i n g a n A c t u a t e I n f o r m a t i o n O b j e c t 337

2 To set font properties in the Auto Contents group, expand the appropriate property:

❏ DataFont

❏ LabelFont

❏ PageDecorationFont

❏ TitleFont

3 Set the font property values.

4 Verify that the ReportType property setting is ActuateQueryTemplate.

5 Choose Report➛Build. e.Report Designer Professional builds the data object executable (.dox) file.

6 Publish the DOX to an Encyclopedia volume:

1 Choose File➛Publish to Server. Publish and Preview Options appears.

2 In Publish options, select Publish only.

3 Provide additional information to specify to which Encyclopedia volume to publish the file.

7 Choose OK.

After you publish the DOX to an Encyclopedia volume, the system administrator must log in to the Actuate iServer’s System Administration console to set the volume’s Actuate Query Generation property. The Actuate Query Generation property value is the location and name of the DOX.

Page 360: Accessing Data

338 A c c e s s i n g D a t a

Page 361: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 339

C h a p t e r

15Chapter 15Actuate SQL reference

This chapter contains the following topics:

■ About Actuate SQL

■ Differences between Actuate SQL and ANSI SQL-92

■ Actuate SQL syntax

■ Data types and data type casting

■ Functions and operators

■ Providing query optimization hints

■ Using pragmas to tune a query

Page 362: Accessing Data

340 A c c e s s i n g D a t a

About Actuate SQLAn information object encapsulates an Actuate SQL query. You can create the Actuate SQL query that defines an information object in Information Object Designer by typing the Actuate SQL query in the textual query editor or by specifying the desired query characteristics in the graphical query editor. If you use the graphical query editor, you can view the resulting Actuate SQL query in SQL Preview.

If you already have one or more existing information objects, you can access the information object data by specifying a query on the information object using a report designer’s Information Object Query Builder. You can create the query on the information object by typing a Actuate SQL query in the textual query editor or by specifying the desired query characteristics in a graphical query editor. If you use the graphical query editor, you can view the resulting Actuate SQL query in SQL Preview.

A query that defines an information object and a query on an information object both use Actuate SQL. Actuate SQL is based on the ANSI SQL-92 standard. This chapter describes the differences between Actuate SQL and ANSI SQL-92. This chapter also describes the FILTERS statement that you can use when creating a query from Information Object Query Builder in a report designer.

Differences between Actuate SQL and ANSI SQL-92Actuate SQL is based on ANSI SQL-92. This section provides an overview of the differences between Actuate SQL and ANSI SQL-92. This section also provides an overview of the FILTERS statement that is available from report designers. Report designers support using the FILTERS statement with Actuate SQL to dynamically filter SELECT statements.

Limitations compared to ANSI SQL-92Actuate SQL has the following limitations compared to ANSI SQL-92:

■ Only the SELECT statement is supported.

■ Data types are limited to integers, strings, timestamps, floating point numbers, and decimals.

■ Intersection and set difference operations are not available.

UNION and UNION DISTINCT are not supported. UNION ALL is supported. To obtain the same results as a UNION DISTINCT operation, perform a UNION ALL operation followed by a SELECT DISTINCT

Page 363: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 341

operation. For example, IO3 performs a UNION ALL operation on IO1 and IO2:

SELECT empNo, eNameFROM "IO1.iob" AS IO1UNION ALLSELECT empNo, eNameFROM "IO2.iob" AS IO2

To obtain distinct results from IO3, create IO4, which performs a SELECT DISTINCT operation on IO3:

SELECT DISTINCT empNo, eNameFROM "IO3.iob" AS IO3

■ LIKE operator patterns and escape characters must be literal strings, parameters, or expressions. The LIKE operator does not support column references, subqueries, or aggregate functions, for example, MAX and AVG.

■ Unnamed parameters are not supported.

■ Some subqueries are not supported.

■ Not all ANSI SQL-92 functions and operators are available.

Extensions to ANSI SQL-92Actuate SQL has the following extensions to ANSI SQL-92:

■ Parameterized queries with named parameters

A parameterized query starts with a WITH clause that specifies the names and types of parameters that the query uses. The following example shows using parameters to specify returning rows where salesTotal is within a range specified by two parameters.

WITH ( minTotal DECIMAL, maxTotal DECIMAL )SELECT o.id, o.dateFROM "/sales/orders.sma" oWHERE o.salesTotal BETWEEN :minTotal AND :maxTotal

A query with a parameterized SELECT statement is typed and is subject to the same casting rules as a function call, except that parameter declarations specify the maximum scale, precision, and length of parameter values. All parameter values are required. A parameter value must be a literal, for example 'abc', NULL, a parameter reference, or an Actuate SQL expression. A parameter value cannot be a column reference, for example ORDERS.ORDERID.

■ Parameterized table, view, and query references

A parameterized table or view reference in a query enables specification of the query without knowing the table or view until run time. At run time, the

Page 364: Accessing Data

342 A c c e s s i n g D a t a

values of the parameters specify the table. In the following example, the table is specified by the IOB name and the team and position parameters.

WITH( team VARCHAR, position VARCHAR, minGamesPlayed INTEGER )

SELECT playernameFROM "/sports/baseball/japan/players.iob" [:team,:position]WHERE GamesPlayed > :minGamesPlayed

Parameter passing is typed and is subject to the same casting rules as a function call.

■ Scalar subqueries

A scalar subquery is a query that returns a scalar value that is used in a second query. For example, the following query returns a scalar value:

SELECT SUM(B.Quantity * B.UnitPrice) FROM "Order Detail.sma" AS B

This second query uses the previous query as a scalar subquery, evaluating the result of the scalar subquery and checking if the result is greater than 1000.

SELECT CustomerID FROM "Customers.sma" C LEFT OUTER JOIN"Orders.sma" OON ( C.CustomerID=O.CustomerID )

WHERE ( SELECT SUM(B.Quantity * B.UnitPrice) FROM "Order Detail.sma" AS B ) > 1000

■ Join control syntax specifying the join algorithm

In Actuate SQL, you can specify the algorithm to use for joins. There are three join algorithms in Actuate SQL:

■ Dependent join

A dependent join specifies obtaining all the results for the left side of the join and then using each resulting row to process the right side of the join. This algorithm is especially efficient when the left side of the join does not return many rows and the data source of the right side can handle evaluating the join criteria.

■ Nested loop join

A nested loop join specifies obtaining and storing in memory all the results for the right side of the join. Then, for each row resulting from the left side, a nested loop join evaluates the right side results for matches to the join criteria. This algorithm is especially efficient when the right side of the join

Page 365: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 343

does not return many rows and the join expression cannot be delegated to the data source of the right side.

■ Merge join

A merge join specifies obtaining the results for the right and left sides of the join and comparing these results row by row. Merge joins are applicable only for joins where the value on the left must be equal to the value on the right. This algorithm uses less memory than a nested loop join. This algorithm is especially efficient if the data sources sort the rows but presorting is not required.

The following example shows a merge join in a simple SELECT statement.

SELECT customers.custid, customers.customname, customers.city, salesreps.lastname, salesreps.email

FROM customers MERGE JOIN salesreps ON customers.repid = salesreps.repid

The following example shows a dependent join in a parameterized SELECT statement.

WITH ( minRating INTEGER )SELECT c.name, o.date, o.shippingStatusFROM

"/uk/customers.sma" cDEPENDENT JOIN

"/sales/orders.sma" oON c.id = o.custIdWHERE c.rating >= :minRating

You can also specify whether the join is an inner join or left outer join. The following example shows a SELECT statement with a left outer join.

SELECT customers.custid, customers.contact_last, customers.contact_first, salesreps.lastname, salesreps.firstname

FROM salesreps LEFT OUTER JOIN customers ON salesreps.firstname = customers.contact_first

For information about inner and outer joins, see the SQL reference guide for your database.

■ Pragmas to alter query semantics

■ Additional functions

Page 366: Accessing Data

344 A c c e s s i n g D a t a

■ The ability to have ORDER BY items other than SELECT items or aliases, for example:

SELECT customers.contact_first || ' ' || customers.contact_last "MOST_VALUED_CUSTOMERS"

FROM "/customers.sma" customersWHERE customers.purchasevolume > 3ORDER BY customers.purchasevolume DESC

If an ORDER BY item is not a SELECT item or an alias, it must be a grouping column if a GROUP BY clause is present. ORDER BY items must be SELECT items if SELECT DISTINCT is specified.

Use ORDER BY only when creating a query in a report designer. Do not use ORDER BY when you create an information object in Information Object Designer.

■ The ability to have GROUP BY items that are expressions, for example:

SELECT DATEPART('yyyy', orders.shipbydate) "YEAR",DATEPART('m', orders.shipbydate) "MONTH",COUNT(*) "NUM_ORDERS"

FROM "/orders.sma" ordersGROUP BY DATEPART('yyyy', orders.shipbydate),

DATEPART('m', orders.shipbydate)

To use an expression as a GROUP BY item, the expression must appear as a SELECT item. Aggregate functions are not allowed in GROUP BY expressions unless they are outer references from a subquery and the subquery is contained in the HAVING clause of the parent query. Complex GROUP BY expressions cannot be used in the HAVING clause of the query.

■ The ability to use references to aliases

Database limitationsBecause the Integration service delegates many of its operations to the databases, these operations are affected by database limitations, such as the maximum precision of decimal types or the treatment of zero-length strings.

FILTERS statement in report designersIn addition to Actuate SQL’s extensions to ANSI SQL-92, report designers support using a FILTERS statement with Actuate SQL to dynamically filter SELECT statements. A dynamically filtered SELECT statement enables the user to specify additional filters in the WHERE clause or HAVING clause when running a SELECT statement or a parameterized SELECT statement. The FILTERS statement specifies one or more dynamic filters, their data types, and the

Page 367: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 345

beginning of each filter. The user completes conditions using operators, constants, and column names.

FILTERS ( filter1 Integer 'o.salesRepID' , filter2 Varchar 'o.territory = ')

WITH ( minTotal Decimal, maxTotal Decimal )SELECT o.id, o.dateFROM "/sales/orders.sma" oWHERE o.salesTotal BETWEEN :minTotal AND :maxTotal AND

:?filter1 AND :?filter2

Information Object Designer does not support use of the FILTERS statement.

Actuate SQL syntaxActuate SQL syntax is similar to SQL-92 syntax. Actuate SQL has additional syntax for naming tables and columns. Table 15-1 provides a description of the typographical conventions used in describing Actuate SQL grammar.

Table 15-1 Typographical conventions used in describing Actuate SQL grammar

Convention Used for...

NORMAL UPPERCASE Actuate SQL keywords.

ITALICIZED UPPERCASE

Tokens.

|(vertical bar) Separating syntax items. You choose one of the items.

[ ] (brackets) Optional syntax items. Do not type the brackets.

{ } (braces) Required syntax items. Do not type the braces.

[,...n] Indicating that the preceding item can be repeated n number of times. The item occurrences are separated by commas.

[...n] Indicating that the preceding item can be repeated n number of times. The item occurrences are separated by blanks.

<label> The name for a block of syntax. This convention is used to label syntax that can appear in more than one place within a statement. Each location in which the block of syntax can appear is shown with the label enclosed in chevrons, for example <label>.

Page 368: Accessing Data

346 A c c e s s i n g D a t a

Table 15-2 lists the tokens used in the Actuate SQL grammar.

Actuate SQL grammarThe Actuate SQL grammar contains one statement. The syntax of this statement is:

[<Pragma>] [...n] [<QueryParameterDeclaration>] <SelectStatement>

Report designers also use a FILTERS statement that incorporates Actuate SQL. Information Object Designer does not support use of the FILTERS statement.

Table 15-2 Tokens used in describing the Actuate SQL grammar

Token Definition

IDENTIFIER A sequence of Unicode letters, digits, dollar signs, and underscores combining characters and extenders. The first character must be a letter. Use double quotes to quote identifiers. To represent a double quote within a quoted identifier, use two double quotes. Quoted identifiers can include any characters except carriage return or new line.

CHAR_LITERAL Any Unicode text between single quotes other than carriage return or new line. To represent a single quote, use two single quotes. Multiple consecutive character literals are concatenated.

DECIMAL_LITERAL An integer literal followed by a decimal point and an optional integer representing the fractional part.

Syntax: (INTEGER_LITERAL .) | (. INTEGER_LITERAL) | (INTEGER_LITERAL. [INTEGER_LITERAL])

DOUBLE_LITERAL A number of the form 1.2E+3. If the sign is omitted, the default is positive.

Syntax: ((. INTEGER_LITERAL) | (INTEGER_LITERAL. [INTEGER_LITERAL])) [(e|E) [-|+] INTEGER_LITERAL]

INTEGER_LITERAL One or more consecutive digits.

TIMESTAMP_STRING A literal string that is interpreted as a timestamp value, such as '2002-03-31 13:56:02.7'. Years are 4 digits. Seconds are 2 digits with an optional fraction up to 3 digits. All other fields are 2 digits. The space between the date and time sections is required.

Format: 'yyyy-mm-dd hh:mm:ss.msec'

Page 369: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 347

The syntax for the FILTERS statement is:

<FilterClause> <QueryParameterDeclaration> <SelectStatement>

Table 15-3 provides the syntax for the grammar parts used in these statements.

Table 15-3 Syntax for the Actuate SQL grammar parts

Grammar part Syntax

AdditiveExpression <MultiplicativeExpression> {(+ | - | ||) <MultiplicativeExpression>} [...n]

AdHocParameter :?IDENTIFIERUse AdHocParameter only in a FILTERS statement, which is available only from a report designer. AdHocParameter cannot be used in a WITH clause.

AggrExpression COUNT (([ALL | DISTINCT] <ValueExpression> | *)) | (AVG | MAX | MIN | SUM) ([ALL | DISTINCT]<ValueExpression>)

AndExpression {<UnaryLogicalExpression>} [AND...n]

CardinalityType 1 | ? | * | +

CaseExpression CASE [<ValueExpression>]{<WhenClause>} [...n][ELSE <ValueExpression>]END

CastExpression CAST((<ValueExpression> | NULL) AS <ScalarDataType>)

ColumnAlias IDENTIFIER

CondExpr {<AndExpression>} [OR...n]

ConditionalPrimary (<CondExpr>) | <SimpleCondition> | <AdHocParameter>Use AdHocParameter only in a FILTERS statement.

DataType <ScalarDataType>

ExplicitInnerOuterType LEFT [OUTER] | INNER

ExplicitJoinType MERGE | NL | DEPENDENT

ExpressionList {<ValueExpression>} [,...n]

FilterClause FILTERS(IDENTIFIER DataType 'ValueExpression' [,...n])Use FILTERS only from a report designer.

FromClause {FROM <FromTableReference>} [,...n]

FromTableName IDENTIFIER [(<TableParameters>)] [[AS] IDENTIFIER]If the identifier is not enclosed in quotes, it is interpreted as a table. If the identifier is enclosed in quotes, it is interpreted as an absolute or relative path in the Encyclopedia volume.

(continues)

Page 370: Accessing Data

348 A c c e s s i n g D a t a

FromTableReference <JoinExpression> | (<JoinExpression>) | <FromTableName>

FunctionCallOrColumnRef IDENTIFIER ( ([<ExpressionList>]) | [. IDENTIFIER] )

GroupByClause GROUP BY {<ValueExpression>} [,...n]ValueExpression can be an expression as long as the expression also appears as a SELECT item.

HavingClause HAVING <CondExpr>

JoinCondition ON <CondExpr> [ {CARDINALITY('<CardinalityType> - <CardinalityType>')} ]

JoinElement (<JoinExpression>) | <FromTableName>

JoinExpression <JoinElement> {<JoinSpec><JoinElement> [<JoinCondition>]} [...n]

JoinSpec [ [ [LEFT | RIGHT] OPTIONAL ] <ExplicitInnerOuterType> ] [ <ExplicitJoinType> ] JOIN

Length INTEGER_LITERAL

MultiplicativeExpression <UnaryExpression> {(* | /) UnaryExpression} [...n]

NamedParameter : IDENTIFIER

OrderByClause ORDER BY {<ValueExpression> (ASC | DESC)? } [,...n]ValueExpression is not limited to SELECT items or aliases. If ValueExpression is not a SELECT item or an alias, it must be a grouping column if a GroupByClause is present.Use ORDER BY only when creating a query in a report designer. Do not use ORDER BY when you create an information object in Information Object Designer.

ParameterDeclaration IDENTIFIER [<AS>] <Data Type>

ParamPlaceholder <NamedParameter>

Pragma PRAGMA IDENTIFIER := CHAR_LITERAL

Precision INTEGER_LITERAL

PrimaryExpression <FunctionCallOrColumnRef>| <ParamPlaceholder>| <UnsignedLiteral>| <AggrExpression>| (<ValueExpression>)| <CastExpression>

QueryParameterDeclaration WITH ({<ParameterDeclaration>} [,...n])

All parameters are required.

RelationalOperator =|<>|<|<=|>|>=

Table 15-3 Syntax for the Actuate SQL grammar parts (continued)

Grammar part Syntax

Page 371: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 349

ScalarDataType VARCHAR [(<Length>)]| DECIMAL [(<Precision>, <Scale>)]| INTEGER| DOUBLE [<Precision>]| TIMESTAMP

Scale INTEGER_LITERAL

SelectItem <ValueExpression> [[AS] <ColumnAlias>]

SelectList {<SelectItem>} [,...n]

SelectStatement (<SelectWithoutOrder> [<OrderByClause>])| <SelectWithoutFrom>

SelectWithoutFrom SELECT <ValueSelectList>

SelectWithoutOrder ((SELECT [ALL | DISTINCT] <SelectList><FromClause>[<WhereClause>][<GroupByClause>][<HavingClause>][<SetClause>])

|(<SelectWithoutOrder>)

)[<SetClause>]

SetClause UNION ALL (<SelectWithoutOrder> | <SelectWithoutFrom> )

SignedLiteral CHAR_LITERAL|[+ | -]INTEGER_LITERAL|[+ | -]DOUBLE_LITERAL|[+ | -]DECIMAL_LITERAL|TIMESTAMP TIMESTAMP_STRING

(continues)

Table 15-3 Syntax for the Actuate SQL grammar parts (continued)

Grammar part Syntax

Page 372: Accessing Data

350 A c c e s s i n g D a t a

SimpleCondition EXISTS <SubQuery>| <SubQuery> <RelationalOperator> <ValueExpression>| <ValueExpression>(<RelationalOperator>

( ( [ ANY | ALL ] <SubQuery> ) | <ValueExpression>

)| IS [NOT] NULL| [NOT](BETWEEN <ValueExpression> AND <ValueExpression>| LIKE <ValueExpression> [ESCAPE <ValueExpression>]| IN <SubQuery>| IN (ExpressionList))

)The escape character must evaluate to a single character other than a single quote, a percent sign, or an underscore.

SubQuery (<SelectWithoutOrder> [ OPTION (SINGLE EXEC) ])

TableParameter (<SignedLiteral> | NULL | <ParameterReference> | <ValueExpression>)

TableParameters <TableParameter> [,...n]

UnaryExpression [+ | -] <PrimaryExpression>

UnaryLogicalExpression [NOT] <ConditionalPrimary>

UnsignedLiteral CHAR_LITERAL|INTEGER_LITERAL|DOUBLE_LITERAL|DECIMAL_LITERAL|TIMESTAMP TIMESTAMP_STRING

ValueExpression <AdditiveExpression> | <CaseExpression>

ValueSelectItem <ValueExpression> [[AS] <ColumnAlias>]

ValueSelectList {<ValueSelectItem>} [,...n]

WhenClause WHEN <ValueExpression> THEN <ValueExpression>

WhereClause WHERE <CondExpr>

Table 15-3 Syntax for the Actuate SQL grammar parts (continued)

Grammar part Syntax

Page 373: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 351

Using white space charactersWhite space characters include the space, tab, and new line characters. Multiple white space characters are not significant outside of literal strings and quoted identifiers.

Using keywordsThe Actuate SQL keywords are shown in the following list:

Actuate SQL keywords are not case-sensitive. To prevent incompatibility with other versions of SQL, do not use SQL-92 keywords. If you use an identifier that is also a keyword, place double quotes around the identifier.

■ ALL

■ AND

■ ANY

■ AS

■ ASC

■ AVG

■ BETWEEN

■ BY

■ CARDINALITY

■ CASE

■ CAST

■ COUNT

■ DEC

■ DECIMAL

■ DEPENDENT

■ DESC

■ DISTINCT

■ DOUBLE

■ ELSE

■ END

■ ESCAPE

■ EXEC

■ EXISTS

■ FALSE

■ FILTERS

■ FROM

■ GROUP

■ HAVING

■ IN

■ INNER

■ INT

■ INTEGER

■ IS

■ JOIN

■ LEFT

■ LIKE

■ MAX

■ MERGE

■ MIN

■ NL

■ NOT

■ NULL

■ ON

■ OPTION

■ OPTIONAL

■ OR

■ ORDER

■ OUTER

■ PRAGMA

■ PRECISION

■ RIGHT

■ SELECT

■ SINGLE

■ SUM

■ THEN

■ TIMESTAMP

■ TRUE

■ UNION

■ VARCHAR

■ WHEN

■ WHERE

■ WITH

Page 374: Accessing Data

352 A c c e s s i n g D a t a

Using commentsPrecede a single-line comment with two hyphens. Enclose a multiline comment with /* and */.

Specifying maps and information objects in Actuate SQL queriesIn Information Object Designer, a map or information object name should be qualified by its relative path in the Encyclopedia volume. The path is relative to the IOB file. Use forward slashes to separate components of the path, for example:

../Data Sources/MyDatabase/dbo.customers.sma

In a query from a report designer, a map or information object name should be qualified by its absolute path in the Encyclopedia volume. Use forward slashes to separate components of the path, for example:

/MyProject/Data Sources/MyDatabase/dbo.customers.sma

Using identifiers in Actuate SQLIdentifiers include table and column names. Actuate SQL identifiers have the same limitations as standard SQL identifiers. For example, you must enclose an identifier in double quotes if it contains an illegal character such as a space or if it is identical to a SQL-92 keyword. Unlike the SQL-92 standard, however, there is no length limitation on Actuate SQL identifiers. Identifiers can contain Unicode characters.

Using column aliases in Actuate SQLWhen you use column aliases, the following rules apply:

■ The column and alias names of the items in the first SELECT statement of a UNION of statements are definitive.

■ Within the items in a SELECT statement, you can use previously defined aliases to create expressions, for example:

SELECT col1 AS a, col2 AS b, a+b

■ Only SELECT and ORDER BY can use aliases.

■ You cannot use an alias in an aggregate expression, for example, MAX(a).

■ You can use aliases defined in an outer SELECT statement in a nested SELECT statement.

■ You can use aliases from the items in the first SELECT statement in a set of UNION statements in the ORDER BY clause of the query.

Page 375: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 353

Specifying parameter valuesA parameter value must be one of the following:

■ A literal value, for example 'abc' or 123.

■ The NULL literal value.

■ A parameter reference.

■ An expression consisting of literal values, parameter references, and Actuate SQL functions and operators.

A parameter value cannot include column references, subqueries, or aggregate functions.

Examples MyInformationObject uses the parameters p1, p2, and p3. The following query passes the parameter values :p1, -100, and 'abc' to MyInformationObject. :p1 represents the value of parameter p1 provided by the user. -100 and 'abc' are literal values.

WITH ( p1 INTEGER, p2 INTEGER, p3 VARCHAR )SELECT . . .FROM "MyInformationObject.iob" [:p1, -100, 'abc']

MyInformationObject uses the parameter p1. The following query passes the NULL literal value to MyInformationObject.

WITH ( p1 INTEGER )SELECT . . .FROM "MyInformationObject.iob" [NULL]

MyInformationObject uses the parameter p1. The following query passes the NULL literal value, cast as integer data type, to MyInformationObject.

WITH ( p1 INTEGER )SELECT . . .FROM "MyInformationObject.iob" [CAST(NULL AS INTEGER)]

MyInformationObject uses the parameter p1. The following query passes the expression :p1 + 10 to MyInformationObject.

WITH ( p1 INTEGER )SELECT . . .FROM "MyInformationObject.iob" [:p1 + 10]

MyInformationObject uses the parameters p1 and p2. The following query passes the parameter reference :p1 and the expression :p1 || :p2 to MyInformationObject.

WITH ( p1 VARCHAR, p2 VARCHAR )SELECT . . .FROM "MyInformationObject.iob" [:p1, :p1 || :p2]

Page 376: Accessing Data

354 A c c e s s i n g D a t a

MyInformationObject uses the parameters p1 and p2. The following query passes two expressions to MyInformationObject.

WITH ( p1 INTEGER, p2 INTEGER )SELECT . . .FROM "MyInformationObject.iob" [:p1 + 10, CASE WHEN :p2 > 100

THEN 100 ELSE 0 END]

Using subqueries in Actuate SQLSubqueries have the following limitations:

■ Subqueries are supported in every clause except the FROM clause. Specifically:

■ Subqueries cannot be used in Actuate SQL parameters or JOIN conditions.

■ Subqueries cannot constitute derived tables.

Derived tables are tables in a FROM clause that are the result of running a subquery.

■ Subqueries must be operands to the operators IN or EXISTS, or operands to a comparison operator such as =, >, or >=ALL. Only one operand of the comparison operator can be a subquery, not both.

■ Only single-column subqueries are supported. In other words, each subquery must have only one SELECT item.

■ Subqueries cannot have more than one SELECT statement. In other words, set operators such as UNION ALL are not allowed in subqueries.

Subqueries can use OPTION (SINGLE EXEC). The SINGLE EXEC option improves the performance of a query when the query cannot be pushed to the database. When the SINGLE EXEC option is specified, the non-correlated portion of the subquery is executed once against the target database, while the correlated portion is executed within the Integration service.

By default, a subquery from a different database is implemented using a dependent join. Using the SINGLE EXEC option, a subquery can be executed

Page 377: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 355

using a single dependent query instead of executing one dependent query for each row of the outer query, for example:

SELECT DISTINCT CUSTOMERS.CUSTID AS "CUSTID", ORDERS.ORDERID AS "ORDERID"

FROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERSINNER JOIN "../Data Sources/MyDatabase/ORDERS.SMA" ORDERSON CUSTOMERS.CUSTID = ORDERS.CUSTIDWHERE (SELECT count(ITEMS.PRICEQUOTE)FROM "../Data Sources/YourDatabase/ITEMS.SMA" ITEMSWHERE ORDERS.ORDERID = ITEMS.ORDERIDOPTION (SINGLE EXEC) ) < 100ORDER BY CUSTOMERS.CUSTID, ORDERS.ORDERID

Data types and data type castingTable 15-4 lists Actuate SQL data types and a description of each data type.

FacetsThe precision, scale, and length associated with a database data type are called facets. Facets are supported for the corresponding Actuate SQL data type.

Table 15-4 Actuate SQL data types

Data type Description

String ("VARCHAR") A sequence of Unicode characters. You can specify a maximum character length for the string. For example, VARCHAR (30) represents strings with a maximum length of 30 Unicode characters.

Integer number ("INTEGER")

32-bit two’s-complement arithmetic numbers.

Decimal number ("DECIMAL")

Fixed point numbers consisting of up to 100 digits. You can specify a maximum scale and a maximum precision using the syntax (precision, scale). For example, DECIMAL (15, 4) represents decimals that can have up to 15 digits in all and up to 4 digits after the decimal point.

Floating point number ("DOUBLE")

64-bit IEEE double precision floating point numbers.

Timestamp ("TIMESTAMP")

A combined date and time (hour/minute/second).

Page 378: Accessing Data

356 A c c e s s i n g D a t a

An Actuate SQL expression that evaluates to a scalar value has facets. These facets are determined by the Actuate SQL functions used in the expression and the facets on the columns in the expression. You can specify facets for an Actuate SQL expression by using a cast, for example:

CAST (EXPR AS DECIMAL (38, 8))

CAST (EXPR AS VARCHAR(25))

Parameters in Actuate SQL queries have facets. These facets determine the maximum precision, scale, and length of parameter values. When no facets are specified for a parameter or a cast expression, the defaults are used. The default precision and scale for the Actuate SQL DECIMAL data type are (20, 8). The default length for the Actuate SQL VARCHAR data type is 50.

If the decimal value passed into a parameter or cast expression is too large for the precision and scale, an error results. Actuate SQL truncates digits after the decimal point to force the decimal value to fit within the precision and scale.

If the string or timestamp value passed into a string parameter, or into a cast expression to VARCHAR, is too large for the string length specified, the string or timestamp is truncated. If the string value passed into a cast expression to DECIMAL is too large for the precision and scale specified, an error results.

By default, Actuate SQL has a decimal precision of 38. The decimal precision can be set to a smaller or larger value up to 100. Results of calculations that exceed this limit may have their precision and scale truncated. Calculations may also be limited by the database. The same applies to operations on strings in the database.

Casting rulesThe following casting rules apply:

■ Integers can be implicitly cast to decimals and doubles. For implicit casts to decimals, the resulting decimals have a precision of 10 and a scale of 0. Integers can be explicitly cast to these types, as well as to strings.

■ Decimals can be implicitly cast to doubles. Decimals can be explicitly cast to doubles, as well as to integers and strings. Conversion to integer type may result in rounding or truncation of data.

■ Doubles can be explicitly cast to strings, as well as to integers and decimals. Conversion to decimal and integer types may result in rounding or truncation of data.

■ Timestamps can be explicitly cast to strings. Casting to other types is not permitted.

Page 379: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 357

■ Strings can be implicitly or explicitly cast to timestamps. For explicit casting, the strings must be of the form

yyyy-MM-dd hh:mm:ss.fff

Strings can be explicitly cast to integers, decimals, and doubles.

■ Because databases vary in their implementation, casts to strings do not have a defined format. For example, the same value can be represented as 6E5, 60000, or 60000.00.

■ All types can be implicitly cast to the same type.

Table 15-5 summarizes the casting rules for Actuate SQL data types.

String comparison and orderingThe Actuate iServer Integration service compares and orders strings according to the Unicode code point value of each character. For example, Bright-Abbott is sorted before Brightman because the hyphen (-) has a Unicode value of 45, while lowercase m has a Unicode value of 109. The expression

'Kirsten' LIKE 'ki%'

evaluates to False because uppercase K is different from lowercase k.

Although string comparison is case-sensitive by default, you can configure the Integration service to do case-insensitive comparison and ordering.

Table 15-5 Casting rules for Actuate SQL types

ToINTEGER

ToDECIMAL

ToDOUBLE

To VARCHAR

To TIMESTAMP

From INTEGER

Implicit casting occurs

Implicit casting occurs

Implicit casting occurs

Explicit casting required

Casting not permitted

From DECIMAL

Explicit casting required

Implicit casting occurs

Implicit casting occurs

Explicit casting required

Casting not permitted

From DOUBLE

Explicit casting required

Explicit casting required

Implicit casting occurs

Explicit casting required

Casting not permitted

From VARCHAR

Explicit casting required

Explicit casting required

Explicit casting required

Implicit casting occurs

Implicit casting occurs

From TIMESTAMP

Casting not permitted

Casting not permitted

Casting not permitted

Explicit casting required

Implicit casting occurs

Page 380: Accessing Data

358 A c c e s s i n g D a t a

Functions and operatorsActuate SQL supports several built-in operators and named functions. Functions and operators are described in the following topics, grouped by related functionality.

Comparison operators: =, <>, >=, >, <=, <Comparison operators are used to compare the value of two expressions, returning True if the comparison succeeds, and False if it does not. The following rules apply to the use of comparison operators handled by the Integration service:

■ For numeric data types, the usual rules of arithmetic comparisons apply.

■ For string comparisons, the shorter of the two strings is padded with space characters to equal the length of the longer string before the comparison is performed, as in SQL-92.

■ Timestamps are compared using chronological order.

■ An equality comparison between two floating point numbers does not return an error.

For information about the Integration service, see Configuring Actuate iServer. Comparison operations delegated to a remote data source may vary from the rules for comparison operators handled by the Integration service.

Range test operator: BETWEENThe BETWEEN operator tests a value to see if it occurs in a given range including the endpoints. For example, the expression

col BETWEEN 10 AND 20

evaluates to True if and only if the value of col is at least 10 but no more than 20. Table 15-6 shows the result type for using BETWEEN for each operand data type.

Table 15-6 Result data types for using BETWEEN with various operand types

First operand type Second operand type Third operand type Result type

Boolean Boolean Boolean Boolean

Integer Integer Integer Boolean

Decimal Decimal Decimal Boolean

Double Double Double Boolean

Varchar Varchar Varchar Boolean

Timestamp Timestamp Timestamp Boolean

Page 381: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 359

The BETWEEN operator follows the same rules as the comparison operators.

Comparison operator: INThe IN operator tests a row or scalar value to see if it occurs in a set of values. For example, the expression

column IN (1,3,5,7,9)

evaluates to True if and only if the value of column is 1, 3, 5, 7, or 9.

Arithmetic operators: +, -, *, /These operators implement addition, subtraction, multiplication, and division on the supported numeric data types. For decimal data types, the result’s precision and scale are shown in Table 15-7. d1 represents an operand expression with precision p1 and scale s1, and d2 represents an operand expression with precision p2 and scale s2. The result’s precision and scale may be truncated due to database limitations.

Integer arithmetic operations are performed using 32-bit two’s-complement semantics. Floating point operations are performed according to the IEEE double precision standard.

These general rules apply to operations handled by the Integration service. Operations delegated to remote data sources may vary in their semantics. For information about the Integration service, see Configuring Actuate iServer.

Table 15-8 shows the result type of using arithmetic operators with each operand type.

Table 15-7 Precision and scale of arithmetic operation results

Operation Result’s precision Result’s scale

d1 + d2 max(s1, s2) + max(p1-s1, p2-s2) + 1 max(s1, s2)

d1 - d2 max(s1, s2) + max(p1-s1, p2-s2) + 1 max(s1, s2)

d1* d2 p1 + p2 + 1 s1 + s2

d1 / d2 p1 - s1 + s2 + max(6, s1 + p2 + 1) max(6, s1 + p2 + 1)

Table 15-8 Result data types for using arithmetic operators with various operand types

Left operand type Right operand type Result type

Integer Integer Integer

Decimal Decimal Decimal

Double Double Double

Page 382: Accessing Data

360 A c c e s s i n g D a t a

Numeric functionsActuate SQL supports the following numeric functions:

■ FLOOR, CEILING, MOD

■ ROUND

■ POWER

FLOOR, CEILING, MODFLOOR returns the largest integer not greater than the argument’s value. The result is cast to the specified type.

Decimal FLOOR( value Decimal )Double FLOOR( value Double )

Example The following code:

SELECT FLOOR(123.45), FLOOR(-123.45), FLOOR(0.0)

returns:

123,-124,0

CEILING returns the smallest integer not less than the argument’s value. The result is cast to the specified type.

Decimal CEILING( value Decimal )Double CEILING( value Double )

Example The following code:

SELECT CEILING(123.45), CEILING(-123.45), CEILING(0.0)

returns:

124,-123,0

MOD returns the remainder after division of two integers.

Integer MOD( v1 Integer, v2 Integer )

Example The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAMEFROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERSWHERE MOD(CUSTOMERS.CUSTID, 2) = 1

Page 383: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 361

returns:

101,Signal Engineering109,InfoEngineering111,Advanced Design Inc....

For decimal data types, the result’s precision and scale for the FLOOR and CEILING functions are (p + 1, s), where (p, s) are the precision and scale of the operand.

ROUNDROUND returns the number closest in value to the first argument, rounding away from zero. The second argument specifies the precision, with positive values indicating a position to the right of the decimal point, and negative values indicating a position to the left of the decimal point. All positions to the right of the specified position are zero in the result.

Integer ROUND( value integer, precision integer )Decimal ROUND( value Decimal, precision integer )Double ROUND( value Double, precision integer )

Example The following code:

SELECT ROUND(123.4567, 2), ROUND(123.4567, -1)

returns:

123.46, 120

For decimal data types, the result’s precision and scale are (p + 1, s), where (p, s) are the precision and scale of the operand.

POWERPOWER raises the left argument (base) to the power of the right argument (exponent).

Integer POWER( base Integer, exponent Integer )Decimal POWER( base Decimal, exponent Integer )Double POWER( base Double, exponent Integer )

Example The following code:

SELECT CUSTOMERS.CUSTID, POWER(CUSTOMERS.CUSTID, 2)FROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERS

Page 384: Accessing Data

362 A c c e s s i n g D a t a

returns:

101,10201102,10404104,10816...

For decimal data types, the result’s precision and scale are (P, s), where P is the maximum precision in the database or the Integration service, and s is the scale of the operand.

Null test operators: IS [NOT] NULLThese operators allow expressions to be tested for NULL values. For example, the expression

column IS NULL

evaluates to True if and only if column has the value NULL.

Logical operators: AND, OR, NOTThese operators implement Boolean conjunction, disjunction, and negation, respectively. AND and OR take two Boolean operands each, while NOT takes a single operand. All return Boolean values.

For AND and OR, both operands may be evaluated even if one operand is undefined, particularly in queries against multiple databases. For example, the clause

WHERE QUANTITY <> 0 AND TOTALCOST / QUANTITY > 50

may result in an error for rows where QUANTITY = 0.

String functions and operatorsActuate SQL supports the following string functions and operators:

■ Case conversion functions: UPPER, LOWER

■ Concatenation operator: ||

■ Length function: CHAR_LENGTH

■ LIKE operator

■ Substring functions: LEFT, RIGHT, SUBSTRING

■ Trimming functions: LTRIM, RTRIM, TRIM

■ Search function: POSITION

Page 385: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 363

Case conversion functions: UPPER, LOWERThese functions return a string formed by converting the characters in the argument to uppercase or lowercase respectively, provided the character is alphabetic.

Varchar UPPER( value Varchar )Varchar LOWER( value Varchar )

Examples The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAME, UPPER(CUSTOMERS.CUSTOMNAME)

FROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERS

returns:

101,Signal Engineering,SIGNAL ENGINEERING109,InfoEngineering,INFOENGINEERING111,Advanced Design Inc.,ADVANCED DESIGN INC....

The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAME, LOWER(CUSTOMERS.CUSTOMNAME)

FROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERS

returns:

101,Signal Engineering,signal engineering109,InfoEngineering,infoengineering111,Advanced Design Inc.,advanced design inc....

Concatenation operator: ||This operator concatenates two string values, returning a new string that contains the characters from the left operand followed by the characters from the right operand.

Length function: CHAR_LENGTHThis function computes the length of a string, returning an integer count of its characters. Trailing spaces are significant.

Integer CHAR_LENGTH( value Varchar )

Page 386: Accessing Data

364 A c c e s s i n g D a t a

Example The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CONTACT_FIRSTFROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERSWHERE CHAR_LENGTH(CUSTOMERS.CONTACT_FIRST) > 5

returns:

102,Leslie109,Michael116,William...

LIKE operatorThe LIKE operator is used in an expression such as

column LIKE 'Mar%'

In this example, values of column, such as Mary or Martin, satisfy the test because both start with Mar.

A LIKE operator pattern must be a literal string, for example, 'abc%', a parameter, or an expression. The LIKE operator does not support column references, subqueries, or aggregate expressions. Other examples include:

column LIKE :paramStatecolumn LIKE CURRENT_USER( )

The following rules apply:

■ Literal pattern characters must match exactly. LIKE is case-sensitive.

■ An underscore character (_) matches any single character.

■ A percent character (%) matches zero or more characters.

Escape a literal underscore, percent, or backslash character with a backslash character (\). Alternatively, use the following syntax:

test_string LIKE pattern_string ESCAPE escape_character

The escape character must obey the same rules as the LIKE operator pattern.

Substring functions: LEFT, RIGHT, SUBSTRINGThese functions transform a string by retrieving a subset of its characters.

Page 387: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 365

LEFT and RIGHT return the leftmost or rightmost n characters, respectively. Each takes the string as the first argument and the number of characters to retrieve as the second argument.

Varchar LEFT( value Varchar, offset Integer )Varchar RIGHT( value Varchar, offset Integer )

Specifying an offset that is less than zero results in an error. If the offset is greater than the length of the string, these functions return the entire string.

SUBSTRING takes three arguments: the input string, the start position (one-based offset from the left side), and the number of characters to retrieve. It returns the substring located at this position.

Varchar SUBSTRING( input Varchar, start Integer, length Integer )

The following actions result in an error:

■ Specifying a start position that is less than or equal to zero.

■ Specifying a length that is less than zero.

Examples The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAMEFROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERSWHERE LEFT(CUSTOMERS.CUSTOMNAME, 4) = 'Info'

returns:

109,InfoEngineering117,InfoDesign129,InfoSpecialists...

The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAMEFROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERSWHERE RIGHT(CUSTOMERS.CUSTOMNAME, 5) = 'Corp.'

returns:

104,SigniSpecialists Corp.115,Design Solutions Corp.118,Computer Systems Corp....

Page 388: Accessing Data

366 A c c e s s i n g D a t a

The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAME, SUBSTRING(CUSTOMERS.CUSTOMNAME, 2, 5)

FROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERS

returns:

101,Signal Engineering,ignal102,Technical Specialists Co.,echni104,SigniSpecialists Corp.,igniS...

Trimming functions: LTRIM, RTRIM, TRIMThese functions strip space characters from a string. LTRIM strips only from the left side, RTRIM only from the right side, and TRIM from both sides. In all cases the result value is a string identical to the argument except for the possible removal of space characters from either side. Other white space characters, including tabs and newlines, are not removed by these functions.

Varchar LTRIM( value Varchar )Varchar RTRIM( value Varchar )Varchar TRIM( value Varchar )

Examples The following code:

SELECT LTRIM(' Title '),'Author'

returns:

Title ,Author

The following code:

SELECT RTRIM(' Title '),'Author'

returns:

Title,Author

The following code:

SELECT TRIM(' Title '),'Author'

returns:

Title,Author

Search function: POSITIONThe POSITION function takes two arguments: a substring and a search string. The POSITION function returns the position of the substring in the search string as an integer or as 0 if the substring is not found. If the substring is the empty

Page 389: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 367

string, the POSITION function returns 1. The POSITION function is case-sensitive.

Integer POSITION( substring Varchar, searchstring Varchar )

Example The following code:

SELECT CUSTOMERS.CUSTID, CUSTOMERS.CUSTOMNAMEFROM "../Data Sources/MyDatabase/CUSTOMERS.SMA" CUSTOMERSWHERE POSITION('Inc.', CUSTOMERS.CUSTOMNAME) > 0

returns:

106,Technical MicroSystems Inc.111,Advanced Design Inc.113,Technical Design Inc....

Timestamp functionsThese functions perform operations on timestamp values:

■ CURRENT_TIMESTAMP

■ CURRENT_DATE

■ DATEADD

■ DATEDIFF

■ DATEPART

■ DATESERIAL

When using these functions, use the control strings listed in Table 15-9 to represent units of time. The control string used in a function must be a literal string, not an expression or a parameter.

Table 15-9 Control strings for various units of time

Unit of time Control string

year yyyy

quarter q

month m

day d

day of year y

day of week w

(continues)

Page 390: Accessing Data

368 A c c e s s i n g D a t a

CURRENT_TIMESTAMPCURRENT_TIMESTAMP returns a timestamp value for the current date and time.

Timestamp CURRENT_TIMESTAMP()

Example The following code:

SELECT CURRENT_TIMESTAMP()

returns:

2004-10-27 14:49:23.0

CURRENT_DATECURRENT_DATE returns a timestamp value for the current date with the time set to 00:00:00.0.

Timestamp CURRENT_DATE()

Example The following code:

SELECT CURRENT_DATE()

returns:

2004-10-27 00:00:00.0

DATEADDDATEADD takes three arguments: a control string, an integer delta value, and a timestamp value. It returns a timestamp that applies the delta value to the specified part of the original timestamp. The operation carries if the sum of the original field value and the delta is illegal.

Timestamp DATEADD( control Varchar, delta Integer, value Timestamp )

Example The following code:

SELECT ORDERS.ORDERID, ORDERS.SHIPBYDATE, DATEADD('d', 14, ORDERS.SHIPBYDATE) AS ExpectedDelivery

FROM "../Data Sources/MyDatabase/ORDERS.SMA" ORDERS

hour h

minute n

second s

Table 15-9 Control strings for various units of time (continued)

Unit of time Control string

Page 391: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 369

returns:

1645,1995-05-22 00:00:00.0,1995-06-05 00:00:00.01340,1995-06-03 00:00:00.0,1995-06-17 00:00:00.01810,1995-04-12 00:00:00.0,1995-04-26 00:00:00.0...

DATEDIFFDATEDIFF takes three arguments: a control string, a start timestamp, and an end timestamp. It returns the integer delta between the part of the two timestamps specified by the control string. Components smaller than the control string are ignored. Components larger than the control string contribute to the result.

Integer DATEDIFF( control Varchar, start Timestamp, end Timestamp )

Examples The following code:

SELECT ORDERS.ORDERID, ORDERS.SHIPBYDATE, ORDERS.FORECASTSHIPDATE, DATEDIFF('d', ORDERS.SHIPBYDATE, ORDERS.FORECASTSHIPDATE) AS ShipDateDifference

FROM "../Data Sources/MyDatabase/ORDERS.SMA" ORDERS

returns:

1645,1995-05-22 00:00:00.0,1995-06-02 00:00:00.0,111340,1995-06-03 00:00:00.0,1995-06-10 00:00:00.0,71810,1995-04-12 00:00:00.0,1995-04-27 00:00:00.0,15...

The following expression:

DATEDIFF('d', CAST('2005-12-31 23:59:59.0' AS TIMESTAMP), CAST('2006-01-01 00:00:00.0' AS TIMESTAMP))

returns 1. The control string d indicates that the difference is in days. The difference between December 31, 2005 and January 1, 2006 is one day. The hours, minutes, and seconds components are ignored.

The following expression:

DATEDIFF('m', CAST('2005-12-31 23:59:59.0' AS TIMESTAMP), CAST('2006-01-01 00:00:00.0' AS TIMESTAMP))

returns 1. The control string m indicates that the difference is in months. The difference between December 31, 2005 and January 1, 2006 is one month. The day, hours, minutes, and seconds components are ignored.

Page 392: Accessing Data

370 A c c e s s i n g D a t a

DATEPARTDATEPART takes two arguments: a control string and a timestamp. It returns the part of the timestamp specified by the control string.

Integer DATEPART( control Varchar, value Timestamp )

Example The following code:

SELECT ORDERS.ORDERID, ORDERS.SHIPBYDATEFROM "../Data Sources/MyDatabase/ORDERS.SMA" ORDERSWHERE DATEPART('m', ORDERS.SHIPBYDATE) = 5

returns:

1645,1995-05-22 00:00:00.01725,1995-05-10 00:00:00.01125,1995-05-03 00:00:00.0...

DATESERIALDATESERIAL has two forms. The first form takes three arguments: a year value, a month value, and a day value. It returns a timestamp for the date corresponding to the specified year, month, and day with the time set to 00:00:00.0.

Timestamp DATESERIAL( year Integer, month Integer, day Integer )

The second form of DATESERIAL takes six arguments: values for the year, month, day, hour, minute, and second. It returns the timestamp for the specified values.

Timestamp DATESERIAL( year Integer, month Integer, day Integer, hour Integer, minute Integer, second Integer )

Example The following code:

SELECT ORDERS.ORDERID, ORDERS.ASKBYDATEFROM "../Data Sources/MyDatabase/ORDERS.SMA" ORDERSWHERE ORDERS.ASKBYDATE >= DATESERIAL(1995, 6, 15, 12, 59, 59)

returns:

1555,1995-06-28 00:00:00.01725,1995-06-23 00:00:00.01720,1995-06-17 00:00:00.0...

Page 393: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 371

Aggregate functions: COUNT, MIN, MAX, SUM, AVGThese functions aggregate an entire column of values into a single scalar result. For decimal data types:

■ For the MIN, MAX, and AVG functions, the result’s precision and scale are the same as the precision and scale of the operand.

■ For the SUM function, the result’s precision and scale are (P, s), where P is the maximum precision in the database or the Integration service, and s is the scale of the operand.

The COUNT function reduces any argument type to a single integer representing the number of non-NULL items. As in SQL-92, COUNT(*) counts the number of rows in a table.

Integer COUNT( column )

Example The following code:

SELECT COUNT(ORDERS.ORDERID) AS NumberOfOrdersFROM "../Data Sources/MyDatabase/ORDERS.SMA" ORDERS

returns:

111

MIN and MAX accept any type and return the minimum or maximum value, using the same rules that apply to comparison of individual items.

ColumnType MIN( column )ColumnType MAX( column )

Examples The following code:

SELECT MIN(ITEMS.QUANTITY)FROM "../Data Sources/MyDatabase/ITEMS.SMA" ITEMS

returns:

2

The following code:

SELECT MAX(ITEMS.QUANTITY)FROM "../Data Sources/MyDatabase/ITEMS.SMA" ITEMS

returns:

6203

SUM and AVG can be applied to any of the three numeric types and produce the sum or average of all the numbers.

ColumnType SUM( column )ColumnType AVG( column )

Page 394: Accessing Data

372 A c c e s s i n g D a t a

Examples The following code:

SELECT SUM(ITEMS.QUANTITY)FROM "../Data Sources/MyDatabase/ITEMS.SMA" ITEMS

returns:

606177

The following code:

SELECT AVG(ITEMS.QUANTITY)FROM "../Data Sources/MyDatabase/ITEMS.SMA" ITEMS

returns:

319

System function: CURRENT_USERCURRENT_USER returns a string containing the user name for the current user.

Varchar CURRENT_USER()

Example The following code:

SELECT CURRENT_USER()

returns:

user1

Providing query optimization hintsA report developer or business user uses an information object to create an Actuate SQL query. When you create the information object, you can provide hints that help to optimize the query. Specifically, you can:

■ Indicate that a table in a join is optional.

■ Specify the cardinality of a join.

For query optimization hints to take effect, you must create join conditions with the ON clause, not the WHERE clause.

Indicating that a table in a join is optionalWhen you create an information object, you indicate that a table in a join is optional using the OPTIONAL keyword. If you indicate that a table is optional and none of its columns appear in the query created by a report developer or business user (except in a join condition), the table is dropped from the optimized query.

Page 395: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 373

The OPTIONAL keyword has no effect in queries created in the Information Object Query Builder.

For example, consider the following information object CustomersOrders:

SELECT Customers.custid, Customers.customname, Customers.contact_last, Orders.orderid, Orders.custid, Orders.amount, Orders.shipbydate

FROM Customers.sma LEFT OPTIONAL INNER JOIN Orders.smaON (Customers.custid = Orders.custid)

Now consider the following Actuate SQL query created by a report developer or business user using CustomersOrders:

SELECT Orders.custid, Orders.orderid, Orders.amountFROM CustomersOrders.iobWHERE Orders.amount BETWEEN 10000 and 20000

Because no column from the Customers table appears in the query, and because the join in CustomersOrders includes the LEFT OPTIONAL keywords, the Customers table is dropped from the optimized query:

SELECT Orders.custid, Orders.orderid, Orders.amountFROM Orders.smaWHERE Orders.amount BETWEEN 10000 and 20000

Now consider another Actuate SQL query created by a report developer or business user using CustomersOrders:

SELECT Customers.custid, Customers.contact_lastFROM CustomersOrders.iobWHERE Customers.city = 'NYC'

No column from the Orders table appears in the query. But because the Orders table is not optional, it is not dropped from the query:

SELECT Customers.custid, Customers.contact_lastFROM Customers.sma INNER JOIN Orders.smaON (Customers.custid = Orders.custid)WHERE Customers.city = 'NYC'

If you use the OPTIONAL keyword without the LEFT or RIGHT qualifier, it applies to both tables in the join.

The OPTIONAL keyword is ignored when it applies to:

■ A table whose columns appear in the query created by a report developer or business user, for example in the SELECT list or in the ORDER BY, GROUP BY, HAVING, or WHERE clauses.

Page 396: Accessing Data

374 A c c e s s i n g D a t a

■ The middle table in an information object, for example:

SELECT Customers.custid, Items.orderid, Items.itemcode, Items.description

FROM Customers RIGHT OPTIONAL INNER JOIN OrdersON (Customers.custid = Orders.custid)LEFT OPTIONAL INNER JOIN Items ON (Orders.orderid =

Items.orderid)

In this information object, Orders is the middle table.

An information object that uses the OPTIONAL keyword cannot be joined to another information object. Therefore, an Actuate SQL query created by a report developer or business user cannot include more than one information object if that information object uses the OPTIONAL keyword.

Using the OPTIONAL keyword with a computed fieldDo not define a computed field in an information object that contains the OPTIONAL keyword. Instead, define the computed field in a lower level information object.

For example, consider the information object MyInformationObject:

SELECT dbo_CUSTOMERS.CUSTID AS CUSTID, dbo_CUSTOMERS.CONTACT_FIRST AS CONTACT_FIRST, dbo_CUSTOMERS.CONTACT_LAST AS CONTACT_LAST, dbo_CUSTOMERS.CITY AS CITY, dbo_ORDERS.SHIPBYDATE AS SHIPBYDATE, dbo_ORDERS.FORECASTSHIPDATE AS FORECASTSHIPDATE, dbo_CUSTOMERS.ADDRESS AS ADDRESS, ( dbo_ITEMS.PRICEQUOTE * dbo_ITEMS.QUANTITY ) AS Total

FROM "dbo.CUSTOMERS.sma" AS dbo_CUSTOMERSOPTIONAL INNER JOIN "dbo.ORDERS.sma" AS dbo_ORDERSON ( dbo_CUSTOMERS.CUSTID=dbo_ORDERS.CUSTID )OPTIONAL INNER JOIN "dbo.ITEMS.sma" AS dbo_ITEMSON ( dbo_ORDERS.ORDERID=dbo_ITEMS.ORDERID )

MyInformationObject defines the computed field Total and also contains the OPTIONAL keyword.

Now consider the following Actuate SQL query created by a report developer or business user using MyInformationObject:

SELECT MyInformationObject.CUSTID AS CUSTID, MyInformationObject.CONTACT_FIRST AS CONTACT_FIRST, MyInformationObject.CITY AS CITY, MyInformationObject.CONTACT_LAST AS CONTACT_LAST

FROM "MyInformationObject.iob" AS MyInformationObject

The ORDERS and ITEMS tables are not dropped from the query even though the OPTIONAL keyword is applied to both tables in MyInformationObject and the SELECT clause does not contain columns from either table. The tables are not

Page 397: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 375

dropped because in MyInformationObject the columns ITEMS.PRICEQUOTE and ITEMS.QUANTITY are used in a computation outside the join condition.

To avoid this situation, define the computed field in a lower level information object such as ITEMS.iob. MyInformationObject then contains the following query:

SELECT dbo_CUSTOMERS.CUSTID AS CUSTID, dbo_CUSTOMERS.CONTACT_FIRST AS CONTACT_FIRST, dbo_CUSTOMERS.CONTACT_LAST AS CONTACT_LAST, dbo_CUSTOMERS.CITY AS CITY, dbo_ORDERS.SHIPBYDATE AS SHIPBYDATE, dbo_ORDERS.FORECASTSHIPDATE AS FORECASTSHIPDATE, dbo_CUSTOMERS.ADDRESS AS ADDRESS, ITEMS.Total AS Total

FROM "dbo.CUSTOMERS.sma" AS dbo_CUSTOMERSOPTIONAL INNER JOIN "dbo.ORDERS.sma" AS dbo_ORDERSON ( dbo_CUSTOMERS.CUSTID=dbo_ORDERS.CUSTID )OPTIONAL INNER JOIN "ITEMS.iob" AS ITEMSON ( dbo_ORDERS.ORDERID=ITEMS.ORDERID )

Using the OPTIONAL keyword with parentheses ( )You can control the processing of the OPTIONAL keyword with parentheses. For example, in the following query the tables CUSTOMERS and ORDERS can be dropped.

SELECT ITEMS.ORDERID, ITEMS.PRICEQUOTE, ITEMS.QUANTITYFROM "CUSTOMERS.sma" AS CUSTOMERS INNER JOIN "ORDERS.sma" AS

ORDERS ON (CUSTOMERS.CUSTID = ORDERS.CUSTID) LEFT OPTIONAL INNER JOIN "ITEMS.sma" AS ITEMS ON (ORDERS.ORDERID = ITEMS.ORDERID)

In the following query, however, only the ORDERS table can be dropped because the join that includes the LEFT OPTIONAL keywords is enclosed in parentheses.

SELECT ITEMS.ORDERID, ITEMS.PRICEQUOTE, ITEMS.QUANTITYFROM "CUSTOMERS.sma" AS CUSTOMERS INNER JOIN ("ORDERS.sma" AS

ORDERS LEFT OPTIONAL INNER JOIN "ITEMS.sma" AS ITEMS ON (ORDERS.ORDERID = ITEMS.ORDERID) ) ON (CUSTOMERS.CUSTID = ORDERS.CUSTID)

In the following examples, A, B, C, and D are tables.

Consider the following query that includes the RIGHT OPTIONAL keywords.

A RIGHT OPTIONAL JOIN B RIGHT OPTIONAL JOIN C RIGHT OPTIONAL JOIN D

The Actuate SQL compiler interprets this query as

((A RIGHT OPTIONAL JOIN B) RIGHT OPTIONAL JOIN C) RIGHT OPTIONAL JOIN D

Tables B, C, and D can be dropped from the query.

Page 398: Accessing Data

376 A c c e s s i n g D a t a

Consider the following query that includes the LEFT OPTIONAL keywords without parentheses.

A LEFT OPTIONAL JOIN B LEFT OPTIONAL JOIN C LEFT OPTIONAL JOIN D

The Actuate SQL compiler interprets this query as

((A LEFT OPTIONAL JOIN B) LEFT OPTIONAL JOIN C) LEFT OPTIONAL JOIN D

Tables A, B, and C can be dropped from the query. It is not possible, however, to drop table C without dropping tables A and B, or to drop table B without dropping table A, without using parentheses.

Consider the following query that includes the LEFT OPTIONAL keywords with parentheses.

A LEFT OPTIONAL JOIN (B LEFT OPTIONAL JOIN (C LEFT OPTIONAL JOIN D))

Table C can be dropped from the query without dropping tables A and B. Table B can be dropped from the query without dropping table A.

Consider the following query that includes the OPTIONAL keyword without the LEFT or RIGHT modifier.

A OPTIONAL JOIN B OPTIONAL JOIN C OPTIONAL JOIN D

The Actuate SQL compiler interprets this query as

((A OPTIONAL JOIN B) OPTIONAL JOIN C) OPTIONAL JOIN D

Any table or set of tables can be dropped from the query.

Using the OPTIONAL keyword with aggregate functionsIf a query created by a report developer or business user contains the function COUNT(*), the OPTIONAL keyword, if it appears in the information object, is ignored. If a query contains another aggregate function, for example SUM or COUNT(column), the value returned by the aggregate function depends on whether the information object includes the OPTIONAL keyword. For example, consider the following Actuate SQL query created by a report developer or business user using the CustomersOrders information object:

SELECT COUNT(Customers.custid) AS CustomerCountFROM CustomersOrders.iob

Page 399: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 377

In the first case, consider the following information object CustomersOrders, which applies the OPTIONAL keyword to the Orders table:

SELECT Customers.custid, Customers.customname, Customers.contact_last, Orders.orderid, Orders.custid, Orders.amount, Orders.shipbydate

FROM Customers.sma RIGHT OPTIONAL INNER JOIN Orders.smaON (Customers.custid = Orders.custid)

Because no column from the Orders table appears in the query and because the join in CustomersOrders includes the RIGHT OPTIONAL keywords, the Orders table is dropped from the optimized query:

SELECT COUNT(Customers.custid) AS CustomerCountFROM Customers.sma

In the second case, consider the following information object CustomersOrders, which does not apply the OPTIONAL keyword to the Orders table:

SELECT Customers.custid, Customers.customname, Customers.contact_last, Orders.orderid, Orders.custid, Orders.amount, Orders.shipbydate

FROM Customers.sma INNER JOIN Orders.smaON (Customers.custid = Orders.custid)

In this case, the Orders table is not dropped from the query:

SELECT COUNT(Customers.custid) AS CustomerCountFROM Customers.sma INNER JOIN Orders.smaON (Customers.custid = Orders.custid)

The value of CustomerCount depends on whether the OPTIONAL keyword is applied to the Orders table in the CustomersOrders information object.

Specifying the cardinality of a joinYou can specify the right-to-left and left-to-right cardinality of a join. Table 15-10 lists the cardinality types and a description of each type.

Table 15-10 Cardinality types

Cardinality type Description

1 One record in the first table matches one record in the second table.

? One record in the first table matches zero or one record in the second table.

* One record in the first table matches zero or more records in the second table.

+ One record in the first table matches one or more records in the second table.

Page 400: Accessing Data

378 A c c e s s i n g D a t a

The right-to-left cardinality type is followed by a hyphen (-), and then by the left-to-right cardinality type. The cardinality type depends on the join column.

For example:

Customers JOIN Orders ON (Customers.custid = Orders.custid) {CARDINALITY ('1-+')}

indicates that:

■ One record in Orders matches one record in Customers.

■ One record in Customers matches one or more records in Orders.

Customers JOIN Orders ON (Customers.custid = Orders.custid) {CARDINALITY ('1-*')}

indicates that:

■ One record in Orders matches one record in Customers.

■ One record in Customers matches zero or more records in Orders.

Customers JOIN Orders ON (Customers.custid = Orders.custid) {CARDINALITY ('*-?')}

indicates that:

■ One record in Orders matches zero or more records in Customers.

■ One record in Customers matches zero or one record in Orders.

Using pragmas to tune a queryIf an information object query joins maps or information objects that are based on different data sources, you may be able to tune the query using the following pragmas:

■ EnableCBO

■ applyIndexing

■ MinRowsForIndexing

These pragmas are described in the following topics.

Disabling cost-based optimizationIf you provide values for the map and join column properties, the Actuate SQL compiler uses these values to do cost-based query optimization. You can disable cost-based optimization using the pragma EnableCBO. For information about map and join column properties, see Chapter 3, “Creating information objects,” in Designing Information Objects.

Page 401: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 379

For example, consider the following query based on SQL Server and Oracle database tables:

SELECTNATION.N_NAME,SUM(LINEITEM.L_EXTENDEDPRICE * (1 - LINEITEM.L_DISCOUNT))

AS RevenueFROM

"/SQL_Server/CUSTOMER.SMA" CUSTOMER,"/Oracle/ORDERS.SMA" ORDERS,"/SQL_Server/LINEITEM.SMA" LINEITEM,"/SQL_Server/SUPPLY.SMA" SUPPLY,"/Oracle/NATION.SMA" NATION,"/Oracle/REGION.SMA" REGION

WHERECUSTOMER.C_CUSTKEY = ORDERS.O_CUSTKEYAND LINEITEM.L_ORDERKEY = ORDERS.O_ORDERKEYAND LINEITEM.L_SUPPKEY = SUPPLY.S_SUPPKEYAND CUSTOMER.C_NATIONKEY = SUPPLY.S_NATIONKEYAND SUPPLY.S_NATIONKEY = NATION.N_NATIONKEYAND NATION.N_REGIONKEY = REGION.R_REGIONKEYAND REGION.R_NAME = 'ASIA'AND ORDERS.O_ORDERDATE >= TIMESTAMP '1993-01-01 00:00:00'AND ORDERS.O_ORDERDATE < TIMESTAMP '1994-01-01 00:00:00'

GROUP BYNATION.N_NAME

If you provide values for the map and join column properties, part of the query plan looks similar to Figure 15-1.

Figure 15-1 Example of part of the query plan for which values for the map and join column properties have been provided

To disable cost-based optimization for the query, set the pragma EnableCBO to False:

PRAGMA "EnableCBO" := 'false'SELECT

NATION.N_NAME,SUM(LINEITEM.L_EXTENDEDPRICE * (1 - LINEITEM.L_DISCOUNT))

AS Revenue

Page 402: Accessing Data

380 A c c e s s i n g D a t a

FROM"/SQL_Server/CUSTOMER.SMA" CUSTOMER,"/Oracle/ORDERS.SMA" ORDERS,"/SQL_Server/LINEITEM.SMA" LINEITEM,"/SQL_Server/SUPPLY.SMA" SUPPLY,"/Oracle/NATION.SMA" NATION,"/Oracle/REGION.SMA" REGION

WHERE...

Now this part of the query plan looks similar to Figure 15-2.

Figure 15-2 Example of part of a query plan with cost-based optimization disabled

Disabling cost-based optimization changes the join sequence and the join algorithm. The Customer and LineItem, Supply database subqueries switch positions, and the merge join is replaced with a nested loop join.

If you create a query using an information object for which cost-based optimization is disabled, cost-based optimization is disabled for the query as well.

You can disable cost-based optimization for all information object queries by setting the Actuate iServer configuration variable Enable cost based optimization to False. For more information about Actuate iServer configuration variables, see Configuring Actuate iServer.

Disabling indexingBy default, the Actuate SQL compiler creates indexes for rows that are materialized in memory during query execution, for example the rows returned when the right side of a nested loop join is executed. You can disable indexing using the pragma applyIndexing.

Page 403: Accessing Data

C h a p t e r 1 5 , A c t u a t e S Q L r e f e r e n c e 381

For example, to disable indexing for a query, set the pragma applyIndexing to False:

PRAGMA "applyIndexing" := 'false'SELECT

NATION.N_NAME,SUM(LINEITEM.L_EXTENDEDPRICE * (1 - LINEITEM.L_DISCOUNT))

AS RevenueFROM

"/SQL_Server/CUSTOMER.SMA" CUSTOMER,"/Oracle/ORDERS.SMA" ORDERS,"/SQL_Server/LINEITEM.SMA" LINEITEM,"/SQL_Server/SUPPLY.SMA" SUPPLY,"/Oracle/NATION.SMA" NATION,"/Oracle/REGION.SMA" REGION

WHERE...

If you create a query using an information object for which indexing is disabled, indexing is disabled for the query as well.

Specifying a threshold value for indexingIf cost-based optimization is enabled and you provide values for the map and join column properties, the Actuate SQL compiler creates an index when 100 rows are materialized in memory during query execution. You can change the number of materialized rows that triggers indexing using the pragma MinRowsForIndexing. For information about map and join column properties, see Chapter 3, “Creating information objects,” in Designing Information Objects.

If cost-based optimization is disabled, or you do not provide values for the map and join column properties, an index is created for materialized rows if a suitable column is available.

For example, to change the number of materialized rows that triggers indexing to 1000, set the pragma MinRowsForIndexing to 1000:

PRAGMA "MinRowsForIndexing" := '1000'SELECT

NATION.N_NAME,SUM(LINEITEM.L_EXTENDEDPRICE * (1 - LINEITEM.L_DISCOUNT))

AS Revenue

Page 404: Accessing Data

382 A c c e s s i n g D a t a

FROM"/SQL_Server/CUSTOMER.SMA" CUSTOMER,"/Oracle/ORDERS.SMA" ORDERS,"/SQL_Server/LINEITEM.SMA" LINEITEM,"/SQL_Server/SUPPLY.SMA" SUPPLY,"/Oracle/NATION.SMA" NATION,"/Oracle/REGION.SMA" REGION

WHERE...

Specifying the number of materialized rows that triggers indexing for an information object has no effect on queries that use the information object.

You can specify the number of materialized rows that triggers indexing for all information object queries by setting the Actuate iServer configuration variable Minimum rows to trigger creation of an index during materialize operation. For more information about Actuate iServer configuration variables, see Configuring Actuate iServer.

Page 405: Accessing Data

P a r t

5Part 5Using Actuate open data access

technology

Page 406: Accessing Data
Page 407: Accessing Data

C h a p t e r 1 6 , C r e a t i n g a c u s t o m d a t a d r i v e r 385

C h a p t e r

16Chapter 16Creating a custom

data driverThis chapter contains the following topics:

■ About accessing additional types of data sources

■ Accessing data using a custom data driver

■ Creating a data source user interface for a custom data driver

■ Providing classes to access data during report generation

■ Providing configuration information about your custom data driver

■ Installing a custom data driver

Page 408: Accessing Data

386 A c c e s s i n g D a t a

About accessing additional types of data sourcesA user can access a variety of a data sources using predefined data drivers in Actuate design tools such as e.Report Designer Professional, e.Report Designer, and e.Spreadsheet Designer. To provide access to other types of data, you can create a custom data driver and plug it into the Actuate design tool. Actuate provides this capability by supporting open data access (ODA) drivers.

A user chooses the data source from a list of possible types of data sources in the Actuate design tool. The list does not distinguish between custom and native data sources. When a user chooses a data source type, the driver provides a design-time user interface for querying the data source.

An ODA driver supports both design-time and run-time functionality. The Actuate design tool uses the driver to build a connection to the data source, retrieve parameter and data row definitions, and compile these definitions for use at run-time. At run-time, Actuate iServer loads the driver. Then, the driver creates the connection and data source instance and fetches the requested data.

Each ODA driver supports one type of connection and can support multiple instances of that connection type. Each driver can support multiple data sources. The driver must be installed in the client environment where you design the report and on Actuate iServer where you run the report. For an example of an ODA driver that includes the configuration file and data source builder, see the open data access flat file example in \Actuate10\oda\Examples\FlatFileExample. This example also includes run-time classes for access by e.Report Designer Professional.

Accessing data using a custom data driverTo provide a custom data driver for an open data source (ODA), perform the following steps in this order:

■ Write the code that implements the custom data driver:

■ In e.Report Designer Professional, create a file, such as a report object library (.rol) file, that contains an ODA connection class and an ODA data stream class. The ODA connection class subclasses AcOdaConnection, and the ODA data stream class subclasses AcOdaSource. For each class, you must add any custom properties that are necessary for communication with the ODA driver. Although you can provide these classes in a report object design (.rod) file, use a report object library (.rol) file instead. By providing them in an ROL, you can use these classes in multiple reports. You specify the library name and the class names in the open data source’s odaconfig.xml file.

Page 409: Accessing Data

C h a p t e r 1 6 , C r e a t i n g a c u s t o m d a t a d r i v e r 387

If e.Report Designer Professional does not use your custom driver, you do not need to create these classes or a file to contain them.

■ Create a custom data source builder. These components read and write XML files that Actuate design tools use to define the data source’s parameters and properties. Actuate design tools use the data source builder components of the custom data driver to support the data source’s user interface. The Factory uses the run-time components of the ODA driver, which implement a set of interfaces to generate a report.

■ Create the run-time components of the driver, implementing the ODA run-time Java interfaces. For more information about the Java interfaces to use, see “Providing classes to access data during report generation,” later in this chapter.

■ Write a configuration file for the driver. The configuration file specifies the ODA interface version of the driver. This file also defines the structure, contents, and semantics of requests and responses between the open data source and an Actuate design tool or Actuate iServer.

■ Install the custom data driver and configuration file:

■ Install the custom data driver and configuration file on the same file system as the Actuate product with which you create the report design. When the Actuate design tool starts, it caches the custom data driver. Any modifications that you make to the TraceLogging section in odaconfig.xml take effect with the next report generation. For any other changes to the configuration file or the driver to take effect, you must close and reopen the design tool. Closing the design tool releases the cached driver and configuration file. Opening the design tool reloads the more recent version of each.

■ Install the custom data driver and configuration file on the Actuate iServer node that runs the report or query. If you modify the driver or configuration file after you install them on Actuate iServer, you do not need to restart Actuate iServer to implement your modifications.

■ Develop a report or Actuate query using data that is accessed through the custom data driver. To access the open data source from e.Report Designer Professional, you use a data stream component, and you must provide a connection class and one or more data source classes. Then, you access the classes from the report object library (.rol) file that you created in the first step of this process. To access the open data source from e.Spreadsheet Designer, you create a data source connection and a data query.

■ Upload the report or query executable file to an Encyclopedia volume on the Actuate iServer node that hosts the custom data driver.

■ Run the report or query. You can run a report that uses an open data source from either the client machine or Actuate iServer. During report generation, a custom data driver performs the following tasks:

Page 410: Accessing Data

388 A c c e s s i n g D a t a

■ Opens the data source

■ Accepts values for each data source parameter, if any exist

■ Fetches each data row

■ Closes the data source

Creating a data source user interface for a custom data driver

Using the open data access framework, a report developer can access data using a custom data source builder. Data source builder is a generic term for an application that a report developer accesses from the design tool to define the structure of a data stream component for a report design.

Actuate design tools communicate with the data source builder using XML files and a request-and-response format. The use of XML facilitates language-independent communication between the custom data source builder and the Actuate design tool.

The data source builder must be an executable file. The ODA driver’s odaconfig.xml file defines the executable file and its command-line arguments in the DesignTimeInterface element. The Actuate design tool passes the names of the data stream definition XML request and response files to the data source builder as additional command-line arguments. The data source builder must parse the XML request file and populate the XML response file.

A data-stream definition file contains a DesignSessionRequest or DesignSessionResponse element. Both DesignSessionRequest and DesignSessionResponse contain a DataStreamDefinition element, which defines details about the data stream, including the command or query to execute, input and output parameters to use, public and private properties of the data stream, and other information. DesignSessionRequest and DesignSessionResponse also contain a PublicConnectionProperties element, which defines the custom values that are required for connecting to the underlying data source. DesignSessionResponse contains a ResultSetDefinition element, which defines the metadata of the data fields that the ODA driver returns.

By default, the Actuate design tool creates temporary files for the XML request and response information. To retain these files for debugging your ODA driver, create a REG_DWORD registry key, KeepOdaRequestResponseFiles. Create this key in HKEY_CURRENT_USER/Software/Actuate/<product>/Settings, where <product> is the name and version of the Actuate design tool that you are using. Set the value of the key to 1.

The temporary files each are named odaXXX.tmp, where XXX is a unique, alphanumeric value that Microsoft Windows supplies. The Actuate design tool

Page 411: Accessing Data

C h a p t e r 1 6 , C r e a t i n g a c u s t o m d a t a d r i v e r 389

saves the files that are named to the directory that is specified by the TEMP environment variable. Typically, this directory is \Documents and Settings\your user name\Local Settings\Temp.

The following sections list and describe some of the principal elements of a data-stream definition file.

DataStreamDefinitionProperties that define the data stream. DataStreamDefinition is an element of both DesignSessionRequest and DesignSessionResponse. Elements of DataStreamDefinition include:

■ Command. The command or query to execute to retrieve the result set. Command or query syntax is specific to the data source and must be recognized by the driver when the report runs.

■ InputParameters. Definitions of input parameters to map as report parameters.

■ Name. The external name of the data stream.

■ OutputParameters. Definitions of output parameters.

■ PrimaryResultSet. The ResultSetDefinition for the result set that the data stream returns. The result set maps to a DataRow component in a report design.

■ PrivateProperties. Properties of the data source. A report or query developer cannot edit these properties.

■ PublicProperties. Editable properties of the open data source.

■ ShortDescription. A short business description of the data stream.

■ Type. The type of data source as defined by the ODA driver.

DesignSessionRequestThe request that defines the data that the Actuate design tool passes to an ODA data design tool at the start of the design session. Elements of DesignSessionRequest include:

■ DataStreamDefinition. Properties that define the data stream to use in a report design.

■ ExternalDesignState. An optional element that stores the private state of the data source builder when the builder last exited.

■ PrivateConnectionProperties. Properties of the connection that a report developer cannot edit in the Actuate design tool.

Page 412: Accessing Data

390 A c c e s s i n g D a t a

■ PublicConnectionProperties. Properties of the connection that a report developer can edit in the Actuate design tool.

■ SessionLocale. The user locale on the client machine that hosts the Actuate design tool. SessionLocale can differ from the default locale that is set in the Actuate design tool. If your data source builder does not support all locales, you must handle any unsupported locale.

DesignSessionResponseProperties of the design-time interface that a data source builder returns to the Actuate design tool at the end of a design session. Elements of DesignSessionResponse include:

■ DataStreamDefinition. Properties that define the data stream.

■ ExternalDesignState. An optional element that retrieves the previous private state of the data source builder when the builder exits.

■ PrivateConnectionProperties. Properties of the connection that a report developer cannot edit in the design tool.

■ PublicConnectionProperties. Properties of the connection that a report developer can edit for an ODA connection component.

■ ResponseState. The state of the ODA data source builder when it exits.

ResultSetDefinitionThe definition of a single result set that the data stream returns. A data stream must have at least one result set. Each ResultSetDefinition is a named collection of data columns. In e.Report Designer Professional and e.Report Designer, a result set maps to a DataRow component. Elements of ResultSetDefinition include:

■ Name. The name of the result set. A value is required if the data source returns multiple result sets.

■ ResultSetColumns. The collection of data columns in the result set.

Providing classes to access data during report generation

To retrieve data from an open source, create the run-time components of the open data access (ODA) custom data driver and install them on the client system and on Actuate iServer.

During report or query design, the ODA driver performs the following tasks:

■ Creates a new connection to the open data source.

Page 413: Accessing Data

C h a p t e r 1 6 , C r e a t i n g a c u s t o m d a t a d r i v e r 391

■ Provides an optional data source builder interface for a user to select and define a data stream.

■ Reads the request for data from the Actuate design tool.

■ Returns parameter and result set definitions for the data stream, the data stream name and type, the run-time command text to execute, and any public or private properties. The Actuate design tool then maps the result-set definition to the appropriate component type in the report design. For example, Actuate e.Report Designer Professional maps the result-set definition to the DataRow component and its variables.

During report generation, the ODA driver performs the following tasks:

■ Connects to the open data source

■ Handles input and output parameters

■ Prepares the statement that requests data from the data source

■ Executes the statement

■ Manages each result set that the statement returns, passing data rows to the Factory

■ Closes the data source

The run-time components of an open data access driver retrieve data using Java interfaces. The interfaces pass data between the open data source and the Factory. A Java archive file, AcOdaInterfaces.jar, contains the class files for the interfaces and class. All interfaces and the class are in the com.actuate.oda package. Table 16-1 describes the interfaces and classes for writing an ODA driver.

Table 16-1 ODA driver classes and interfaces

Class or interface Description

FileHandler A class that publishes log records to a specified file.

Filter An interface that provides additional criteria for determining whether to log a record.

Handler An abstract class that provides classes to support publishing log records.

ICallStatement An interface for callable statements, which can have output parameters and can return one or more result sets by name. All callable statements, including those for stored procedures and R/3 BAPIs, implement this interface.

IConnection The connection interface.

IConnectionMetaData Comprehensive information about the connection.

(continues)

Page 414: Accessing Data

392 A c c e s s i n g D a t a

The Factory instantiates the class that is defined by the DriverInitEntryPoint element of the RunTimeInterface element of odaconfig.xml. This class must implement the IConnection interface. Methods that are defined by this interface provide access to parameters, statements, and result sets.

Your Actuate design tool accesses the driver’s odaconfig.xml file to obtain the logging configuration data. It then passes this information to the ODA run-time driver for processing. If the logging configuration information in odaconfig.xml is updated without shutting down the host process, the Actuate design tool detects the changes and passes the updated log configuration using IConnectionFactory.setLogConfiguration( ). The ODA driver can then use LogManager.createLogger( ) to set up the appropriate logger.

IDataSourceMetaData Comprehensive information about the data source.

IParameterMetaData Metadata for parameters of a prepared statement.

IResultSet The interface for all result sets.

IResultSetMetaData The metadata interface for a result set.

IRowSet An interface for representing complex structures or tables.

IStatement The root interface in the statement hierarchy. Returns one or more result sets in sequence.

Level A class that represents logging levels such as INFO, WARNING, and SEVERE.

LogFormatter An abstract class that provides classes to convert log records into formatted strings.

LogManager A class that creates and retrieves Loggers.

LogRecord A class that contains information that can be logged.

Logger A class represents the log for an application.

LoggingErrorHandler A class that can be associated with a Handler to process any exceptions that occur during logging.

OdaException A class that returns information about a data source access error or other errors.

SimpleFormatter A class that extends LogFormatter and formats a log record.

SortSpec A class that represents the sorting specification for the result set or sets of an IStatement.

StreamHandler A class that extends Handler to support logging with output streams.

StringSubstitutionUtil A class that finds and replaces strings.

Table 16-1 ODA driver classes and interfaces (continued)

Class or interface Description

Page 415: Accessing Data

C h a p t e r 1 6 , C r e a t i n g a c u s t o m d a t a d r i v e r 393

Providing configuration information about your custom data driver

Use the configuration file to specify the structure, contents, and semantics of requests and responses between the open data source and your Actuate design tool or Actuate iServer. For example, odaconfig.xml defines the connection type and data sources that the driver supports and maps external data types to ODA data types, which the Actuate design tool subsequently maps to its data types. You also specify the ODA interface version of the driver.

The Actuate design tool reads this configuration file when it starts. Actuate iServer uses the configuration file to load the custom data driver during report generation. Each ODA driver has a unique configuration file, odaconfig.xml. When the Actuate design tool starts, it gathers information about the driver by reading odaconfig.xml. During report generation, the Factory uses the configuration file to load the ODA driver.

When you write an ODA configuration file, the following rules apply:

■ Name the file odaconfig.xml.

■ Install odaconfig.xml in a specific location on the client machine and on Actuate iServer. For more information about where to install odaconfig.xml, see “Installing a custom data driver,” later in this chapter.

■ Follow the XML schema that is specified for the ODA configuration file. For information about this XML schema, see Accessing Data using e.Spreadsheet Technology.

Installing a custom data driver To use a custom data driver in both the design-time and run-time environments, install the ODA driver on a client machine and on the Actuate iServer node that runs the report. Install the driver in the home directory for the current Actuate release.

How to install an ODA driver on a client machine or an Actuate iServer node

If you are installing the ODA driver on an Actuate iServer node, install the ODA driver on the node that runs the report or query.

1 Create a directory named \oda in the home directory for the current Actuate release. For example, on a Windows platform that runs Actuate 10 create the new directory using the following path:

\Program Files\Actuate10\oda

Page 416: Accessing Data

394 A c c e s s i n g D a t a

If you are installing the ODA driver on an Actuate iServer node that runs on a UNIX system, the path is:

$AC_SERVER_HOME/oda

2 In \oda, create a separate subdirectory for each ODA driver, as shown in the following example:

\Actuate10\oda\XMLDataDriver

On a UNIX platform, the path is:

$AC_SERVER_HOME/oda/CustomDriver

You must adhere to this directory structure. Do not add levels to the structure. Do not group multiple drivers in one subdirectory. If you use multiple versions of a driver, create a subdirectory for each version in \oda and indicate the version number or other identifier in the file name, as shown in the following examples:

\Actuate10\oda\CustomDriver_version1.0\Actuate10\oda\CustomDriver_version1.1

The name that you assign to the driver must be unique. The report executable file passes the name to the Factory. The Factory loads the driver by looking up the unique name. The driver name is case-sensitive and cannot contain special characters that the operating system does not recognize.

The name of the driver subdirectory must be exactly the same as the value of the DriverName element of odaconfig.xml:

<?xml version="1.0" encoding="UTF-9"?><OpenDataAccessConfig>

<DriverName>CustomDriver_version1.0</DriverName>...

</OpenDataAccessConfig>

3 Place the following files in the subfolder:

■ The ODA driver configuration file, odaconfig.xml.

■ Any report library files that are required.

■ For an Actuate iServer node, you must also place in the subdirectory any Java driver files that the run-time interfaces require.

■ For a client system, you also must place the following files in the subfolder:

❏ The driver design-time executable file, if there is one

❏ The Java driver files that the design-time and run-time interfaces require

Page 417: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 395

C h a p t e r

17Chapter 17Configuration file XML

schema referenceThis chapter contains the following topics:

■ About providing user access to custom data sources

■ Providing, naming, and placing your configuration file

■ Understanding the schema of odaconfig.xml

■ Using the elements of odaconfig.xml

Page 418: Accessing Data

396 A c c e s s i n g D a t a

About providing user access to custom data sourcesA user chooses the data source from a list of possible types of data sources in an Actuate design tool. You can create a custom data source that appears in this list. The list does not distinguish between custom and native data sources. You specify the name that appears in the list in the odaconfig.xml configuration file, in the connection’s DisplayName. When the user chooses the data source type, the driver provides a design-time user interface to specify the query.

You create the configuration file and install the file on the same file system as the Actuate product with which the report developer creates the report design. The Actuate design tool reads the configuration file when it starts. Actuate iServer uses the configuration file to load the custom data driver during report generation. Each ODA driver has a unique configuration file, odaconfig.xml.

The configuration file specifies the ODA interface version of the driver. This file also defines the structure, contents, and semantics of requests and responses between the open data source and the Actuate design tool or Actuate iServer. For example, odaconfig.xml defines the connection type and data sources that the driver supports and maps external data types to ODA data types, which the Actuate design tool subsequently maps to its data types. When it starts, the Actuate design tool reads odaconfig.xml to gather information about the driver. During report generation, the Factory uses the configuration file to load the ODA driver.

For an example of an ODA driver including the configuration file and data source builder, see the open data access flat file example in \Actuate10\oda\Examples\FlatFileExample. This example also includes run-time classes for access by e.Report Designer Professional.

Providing, naming, and placing your configuration fileWhen writing an ODA configuration file, you must adhere to the following rules:

■ Name the file odaconfig.xml.

■ Install odaconfig.xml in a specific location on the client machine and on Actuate iServer. For more information about where to install odaconfig.xml, see Accessing Data using Actuate e.Report Designer Professional, or Accessing Data using e.Spreadsheet Technology.

Page 419: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 397

Understanding the schema of odaconfig.xmlThe following schema shows the structure of the odaconfig.xml file. A report developer can modify the values in odaconfig.xml for a particular driver. The XML parser that Actuate uses does not recognize changes to the schema itself.

For a definition of each element, see “Using the elements of odaconfig.xml,” later in this chapter.

<?xml version="1.0" encoding="UTF-8"?><!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)

by Xiaojun (ABC) --><!--W3C Schema generated by XMLSPY v5 rel. 4 U (http://

www.xmlspy.com)--><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

elementFormDefault="qualified"><xs:element name="AlternativeOdaDataTypes">

<xs:complexType><xs:sequence>

<xs:element ref="OdaScalarDataType" maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="Connection">

<xs:complexType><xs:sequence>

<xs:element name="Name" type="xs:string"/><xs:element name="DisplayName" type="xs:string"/><xs:element ref="Properties" minOccurs="0"/><xs:element ref="DesignerSpecificProperties"/>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="DataSource">

<xs:complexType><xs:sequence>

<xs:element name="Name" type="xs:string"/><xs:element name="DisplayName" type="xs:string"/><xs:element ref="Properties" minOccurs="0"/><xs:element name="DataTypeMappings">

<xs:complexType><xs:sequence>

<xs:element ref="DataTypeMapping" maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

Page 420: Accessing Data

398 A c c e s s i n g D a t a

</xs:element><xs:element ref="DesignerSpecificProperties"

maxOccurs="unbounded"/></xs:sequence>

</xs:complexType></xs:element><xs:element name="DataSources">

<xs:complexType><xs:sequence>

<xs:element ref="DataSource" maxOccurs="unbounded"/></xs:sequence>

</xs:complexType></xs:element><xs:element name="DesignTimeInterface">

<xs:complexType><xs:sequence>

<xs:element name="Executable" type="xs:string"/><xs:element name="Arguments" type="xs:string"

minOccurs="0"/><xs:element name="WarnValueFormatAdjustment"

type="xs:boolean" minOccurs="0"></xs:element>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="DesignerSpecificProperties">

<xs:complexType><xs:sequence>

<xs:element ref="DesignerSpecific"maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="DesignerSpecific" type="DesignerSpecificType"/><xs:element name="InterfaceType">

<xs:simpleType><xs:restriction base="xs:string">

<xs:enumeration value="C"/><xs:enumeration value="Java"/>

</xs:restriction></xs:simpleType>

</xs:element><xs:element name="DataTypeMapping"

type="NativeDataTypeType"/><xs:element name="OSType">

<xs:simpleType>

Page 421: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 399

<xs:restriction base="xs:string"><xs:enumeration value="Windows"/><xs:enumeration value="Solaris"/><xs:enumeration value="HP-UX"/><xs:enumeration value="AIX"/><xs:enumeration value="LINUX"/><xs:enumeration value="All"/>

</xs:restriction></xs:simpleType>

</xs:element><xs:element name="OpenDataAccessConfig">

<xs:complexType><xs:sequence>

<xs:element name="DriverName" type="xs:string"/><xs:element ref="VendorInfo"/><xs:element name="ODAInterfaceVersion"

type="xs:float"/><xs:element ref="DesignTimeInterface"/><xs:element ref="RunTimeInterface"/><xs:element ref="Connection"/><xs:element ref="DataSources"/>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="Properties">

<xs:complexType><xs:sequence>

<xs:element ref="Property" maxOccurs="unbounded"/></xs:sequence>

</xs:complexType></xs:element><xs:element name="Property" type="PropertyType"/><xs:element name="RunTimeInterface">

<xs:complexType><xs:sequence>

<xs:element ref="InterfaceType"/><xs:element name="DriverInitEntryPoint"

type="xs:string"/><xs:element ref="DriverLibraries"/><xs:element name="TraceLogging" type="TraceLogging"

minOccurs="0"/><xs:element name="StreamedResultSetBufferSize"

type="xs:unsignedShort" minOccurs="0"></xs:element>

</xs:sequence></xs:complexType>

</xs:element>

Page 422: Accessing Data

400 A c c e s s i n g D a t a

<xs:element name="VendorInfo"><xs:complexType>

<xs:sequence><xs:element name="ProductName" type="xs:string"/><xs:element name="Version" type="xs:string"/><xs:element name="Vendor" type="xs:string"/><xs:element name="VendorURL" type="xs:string"

minOccurs="0"/><xs:element name="VendorPhone" type="xs:string"

minOccurs="0"/><xs:element name="CopyrightNotice" type="xs:string"

minOccurs="0"/></xs:sequence>

</xs:complexType></xs:element><xs:complexType name="PropertyType">

<xs:sequence><xs:element name="Name" type="xs:string"/><xs:element name="DisplayName" type="xs:string"

minOccurs="0"/><xs:element name="Value" type="xs:string"/><xs:element name="SelectValueList" type="ArrayOfString"

minOccurs="0"/></xs:sequence>

</xs:complexType><xs:complexType name="NativeDataTypeType">

<xs:sequence><xs:element name="NativeDataType" type="xs:string"/><xs:element name="NativeDataTypeCode" type="xs:short"/><xs:element ref="OdaScalarDataType"/><xs:element ref="AlternativeOdaDataTypes"

minOccurs="0"/></xs:sequence>

</xs:complexType><xs:element name="OdaScalarDataType">

<xs:simpleType><xs:restriction base="xs:string">

<xs:enumeration value="Date"/><xs:enumeration value="Double"/><xs:enumeration value="Integer"/><xs:enumeration value="String"/><xs:enumeration value="Time"/><xs:enumeration value="Timestamp"/><xs:enumeration value="Decimal"/>

</xs:restriction></xs:simpleType>

</xs:element>

Page 423: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 401

<xs:element name="DriverLibraries"><xs:complexType>

<xs:sequence><xs:element ref="LibrariesForOS"

maxOccurs="unbounded"/><xs:element name="SetJavaThreadContextClassLoader"

type="xs:boolean" minOccurs="0"></xs:element>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="LibrariesForOS" type="LibrariesForOSType"/><xs:complexType name="ArrayOfString">

<xs:sequence><xs:element name="String" type="xs:string"

maxOccurs="unbounded"/></xs:sequence>

</xs:complexType><xs:complexType name="LibrariesForOSType">

<xs:sequence><xs:element ref="OSType"/><xs:element name="LibraryName" type="xs:string"

maxOccurs="unbounded"/><xs:element name="Location" type="xs:string"

minOccurs="0"/></xs:sequence>

</xs:complexType><xs:complexType name="DesignerSpecificType">

<xs:sequence><xs:element name="DesignerName" type="xs:string"/><xs:element name="ListOfProperties">

<xs:complexType><xs:sequence>

<xs:element ref="Property"maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element></xs:sequence>

</xs:complexType><xs:complexType name="TraceLogging">

<xs:sequence><xs:element name="LogLevel" type="xs:short"/><xs:element name="LogFilenamePrefix" type="xs:string"/><xs:element name="LogDirectory" type="xs:string"

minOccurs="0"/><xs:element name="JavaLogFormatterClass"

type="xs:string" minOccurs="0"/>

Page 424: Accessing Data

402 A c c e s s i n g D a t a

</xs:sequence></xs:complexType>

</xs:schema>

Using the elements of odaconfig.xmlThe following example shows a configuration file for accessing a flat file data source. You can view this file in \Actuate10\oda\Examples\FlatFileExample. This example uses a report object library (.rol) file to enable e.Report Designer Professional to access subclasses of AcOdaConnection and AcOdaSource classes.

<?xml version="1.0" encoding="UTF-8" ?> - <!-- Configuration file for flat file example of Open Data Access

Framework --> <OpenDataAccessConfig

xmlns:xsd="http://www.actuate.com/XMLSchemas/odaConfigv1"> <driverName>AcOdaFlatFileExampleDriver</driverName> <VendorInfo>

<ProductName>Actuate Open Data Access Flat File Example Driver

</ProductName> <Version>9</Version> <Vendor>Actuate Corporation</Vendor> <VendorURL>http://www.actuate.com</VendorURL> <VendorPhone>888-422-8828</VendorPhone> <CopyrightNotice>Copyright (C) 2003-2004 Actuate

Corporation</CopyrightNotice> </VendorInfo> <OdaInterfaceVersion>1.3</OdaInterfaceVersion> <DesignTimeInterface>

<Executable>javaw</Executable> <Arguments>

-classpathc:\oda\AcOdaFlatFileExampleDriver\

AcOdaFlatFileExampleDesigner.jar;c:\oda\AcOdaFlatFileExampleDriver\

AcOdaInterfaces.jar;c:\oda\AcOdaFlatFileExampleDriver\

AcOdaFlatFileExampleRuntime.jar;c:\oda\AcOdaFlatFileExampleDriver\

PullParser_SMALL.jar com.actuate.oda.sample.FlatFileExample

</Arguments>

Page 425: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 403

</DesignTimeInterface> <RunTimeInterface>

<InterfaceType>Java</InterfaceType> <DriverInitEntryPoint>

com.actuate.oda.sample.runtime.ConnectionFactoryImpl</DriverInitEntryPoint> <DriverLibraries>

<LibrariesForOS> <OSType>Windows</OSType> <LibraryName>AcOdaFlatFileExampleRuntime.jar</LibraryName> <LibraryName>AcOdaInterfaces.jar</LibraryName>

</LibrariesForOS> </DriverLibraries>

</RunTimeInterface> <Connection>

<Name>OdaFlatFileExampleConnection</Name> <DisplayName>Oda Flat file example connection</DisplayName> <Properties>

<Property> <Name>SourceFile</Name> <Value />

</Property> </Properties> <DesignerSpecificProperties>

<DesignerSpecific> <DesignerName>ERD</DesignerName> <ListOfProperties>

<Property> <Name>ClassName</Name> <Value>OdaFlatFileExampleConnection</Value>

</Property> <Property>

<Name>DesignLibrary</Name> <Value>AcOdaFlatFileExample.rol</Value>

</Property> </ListOfProperties>

</DesignerSpecific> </DesignerSpecificProperties>

</Connection> <DataSources>

<DataSource> <Name>AcODAFlatFileDataSource</Name> <DisplayName>Flat file data source example</DisplayName> <DataTypeMappings>

<DataTypeMapping>

Page 426: Accessing Data

404 A c c e s s i n g D a t a

A l t e r n a t i v e O d a D a t a T y p e s

<NativeDataType>String</NativeDataType> <NativeDataTypeCode>1</NativeDataTypeCode> <OdaScalarDataType>String</OdaScalarDataType>

</DataTypeMapping> </DataTypeMappings> <DesignerSpecificProperties>

<DesignerSpecific> <DesignerName>ERD</DesignerName> <ListOfProperties>

<Property><Name>ClassName</Name> <Value>ODAFlatFileExampleSource</Value>

</Property> <Property>

<Name>DesignLibrary</Name> <Value>AcOdaFlatFileExample.rol</Value>

</Property> </ListOfProperties>

</DesignerSpecific> </DesignerSpecificProperties>

</DataSource> </DataSources>

</OpenDataAccessConfig>

An odaconfig.xml configuration file describes an open data source to the designer tool. The rest of this section serves as a reference guide for the elements of an odaconfig.xml configuration file.

AlternativeOdaDataTypesA sequence of OdaScalarDataType elements

Schema <xs:element name="AlternativeOdaDataTypes"><xs:complexType>

<xs:sequence><xs:element ref="OdaScalarDataType"

maxOccurs="unbounded"/></xs:sequence>

</xs:complexType></xs:element>

Elements OdaScalarDataTypeThe ODA data type

Page 427: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 405

A r r a y O f S t r i n g

ArrayOfStringList of String elements

Schema <xs:complexType name="ArrayOfString"><xs:sequence>

<xs:element name="String" type="xs:string" maxOccurs="unbounded"/>

</xs:sequence>/xs:complexType>

Elements StringThe String data type

ConnectionEach driver supports a single type of connection and can support multiple instances of that connection type.

Schema <xs:element name="Connection"><xs:complexType>

<xs:sequence><xs:element name="Name" type="xs:string"/><xs:element name="DisplayName" type="xs:string"/><xs:element ref="Properties" minOccurs="0"/><xs:element ref="DesignerSpecificProperties"/>

</xs:sequence></xs:complexType>

</xs:element>

Elements DesignerSpecificPropertiesDefines a list of custom properties for the ODA connection. The Actuate design tool identified by DesignerName in DesignerSpecificType displays these properties.

DisplayNameThe connection name that appears in a user interface.

NameAn identifier for the connection.

PropertiesAn optional element that defines public properties of the connection. A property is a name-value pair. The name is unique. The value is the default value to use in the report design. If specified in the configuration file and supported by the Actuate design tool, the value of DisplayName appears in the design tool’s property editor and SelectValueList provides a static list of values to select for a property.

Page 428: Accessing Data

406 A c c e s s i n g D a t a

D a t a S o u r c e

DataSourceEach driver can support multiple data sources. A separate DataSource section of the configuration file defines each data source.

Schema <xs:element name="DataSource"><xs:complexType>

<xs:sequence><xs:element name="Name" type="xs:string"/><xs:element name="DisplayName" type="xs:string"/><xs:element ref="Properties" minOccurs="0"/><xs:element name="DataTypeMappings">

<xs:complexType><xs:sequence>

<xs:element ref="DataTypeMapping" maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element><xs:element ref="DesignerSpecificProperties"

maxOccurs="unbounded"/></xs:sequence>

</xs:complexType></xs:element>

Elements DataTypeMappingsA sequence of elements that map the data source’s native data types to ODA data types. e.Spreadsheet Designer uses the ODA data types. e.Report Designer Professional map ODA data types to Actuate Basic data types.

DesignerSpecificPropertiesDefines a list of custom properties for the ODA data source class. The Actuate design tool identified by DesignerName in DesignerSpecificType displays these properties. DesignerName for e.Report Designer Professional is ERD. DesignerName for e.Spreadsheet Designer is ESD. In e.Report Designer Professional, each data source requires a ClassName and a DesignLibrary value. e.Spreadsheet Designer does not require these values.

DisplayNameThe name for the data source in the Actuate design tool.

NameA unique identifier for the data source.

PropertiesAn optional element for the public properties of the data source, including the name, value, and optionally other information about the properties. If specified in the configuration file and supported by the Actuate design tool, the value of

Page 429: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 407

D a t a S o u r c e s

DisplayName appears in the design tool’s property editor and SelectValueList provides a static list of values to select for a property.

DataSourcesA sequence of DataSource elements

Schema <xs:element name="DataSources"><xs:complexType>

<xs:sequence><xs:element ref="DataSource" maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element>

Elements DataSourceAn element that defines a data source

DataTypeMappingAn element that maps the data source’s native data types to ODA data types. e.Spreadsheet Designer uses the ODA data types. e.Report Designer Professional maps ODA data types to Actuate Basic data types.

DataTypeMapping also supports designating optional alternative data types that the user can change in the design environment. Implement all feasible data type mappings to ensure accurate conversions. For example, if a result set column is a native Integer type, the driver should support getString( ) to convert the Integer value to a string using a format specific to the data source.

Schema <xs:element name="DataTypeMapping" type="NativeDataTypeType"/>

DataTypeMappingsA sequence of DataTypeMapping elements that map the data source’s native data types to ODA data types. e.Spreadsheet Designer uses the ODA data types. e.Report Designer Professional map ODA data types to Actuate Basic data types.

Schema <xs:element name="DataTypeMappings"><xs:complexType>

<xs:sequence><xs:element ref="DataTypeMapping"

maxOccurs="unbounded"/></xs:sequence>

Page 430: Accessing Data

408 A c c e s s i n g D a t a

D e s i g n e r S p e c i f i c

</xs:complexType></xs:element>

Elements DataTypeMappingAn element that maps a native data type of the data source to an ODA data type.

DesignerSpecificDefines a list of custom properties for the ODA connection

Schema <xs:element name="DesignerSpecific" type="DesignerSpecificType"/>

DesignerSpecificPropertiesA sequence of elements that list of custom properties for the ODA connection.

Schema <xs:element name="DesignerSpecificProperties"><xs:complexType>

<xs:sequence><xs:element ref="DesignerSpecific"

maxOccurs="unbounded"/></xs:sequence>

</xs:complexType></xs:element>

Elements DesignerSpecificAn element that lists a custom property for the ODA connection

DesignerSpecificTypeDefines a list of custom properties for the ODA connection. The Actuate design tool identified by DesignerName in DesignerSpecificType displays these properties:

■ AddToDriver

If AddToDriver is false, the Actuate design tool identified by DesignerName does not display this data source in its list of data source types. By default, AddToDriver is true.

■ ClassName

ClassName, required by e.Report Designer Professional, must specify a subclass of AcOdaConnection. e.Spreadsheet Designer does not require this property.

Page 431: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 409

D e s i g n T i m e I n t e r f a c e

■ DesignLibrary

The value of DesignLibrary, required by e.Report Designer Professional, can be a full path or a file name with a relative path. DesignLibrary can be an ROL, ROD, or BAS file. e.Spreadsheet Designer does not require this property.

Schema <xs:complexType name="DesignerSpecificType"><xs:sequence>

<xs:element name="DesignerName" type="xs:string"/><xs:element name="ListOfProperties">

<xs:complexType><xs:sequence>

<xs:element ref="Property"maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element></xs:sequence>

</xs:complexType>

Elements DesignerName

The Actuate design tool. DesignerName for e.Report Designer Professional is ERD. DesignerName for e.Spreadsheet Designer is ESD.

ListOfPropertiesAn unbounded sequence of properties

DesignTimeInterfaceSpecifies the executable file with which to build the data source

Schema <xs:element name="DesignTimeInterface"><xs:complexType>

<xs:sequence><xs:element name="Executable" type="xs:string"/><xs:element name="Arguments" type="xs:string"

minOccurs="0"/><xs:element name="WarnValueFormatAdjustment"

type="xs:boolean" minOccurs="0"></xs:element>

</xs:sequence></xs:complexType>

</xs:element>

Elements ArgumentsIf you use arguments, place them in a single line. In the optional Arguments element, use quotation marks to enclose a command or argument that contains

Page 432: Accessing Data

410 A c c e s s i n g D a t a

D r i v e r L i b r a r i e s

spaces. If you omit the quotation marks, a command error occurs. The following example shows a Java CLASSPATH and Java class:

-classpath c:\oda\AcOdaFlatFileExampleDriver\AcOdaFlatFileExampleDesigner.jar;

c:\oda\AcOdaFlatFileExampleDriver\AcOdaInterfaces.jar;c:\oda\AcOdaFlatFileExampleDriver\

AcOdaFlatFileExampleRuntime.jar;c:\oda\AcOdaFlatFileExampleDriver\PullParser_SMALL.jar

com.actuate.oda.sample.FlatFileExample

ExecutableA required element that specifies either an absolute path to an executable file or no path. If you do not specify a path, the executable file must be in either the directory that contains the driver’s configuration file or in any directory that the PATH variable contains. In the Executable element, use quotation marks to enclose a command or argument that contains spaces. If you omit the quotation marks, a command error occurs.

WarnValueFormatAdjustmentAn optional element that specifies warning the user in the following circumstances. By default, e.Report Designer Professional and e.Spreadsheet Designer issue a warning when adjusting a value’s format. For example, the designer can adjust the value 123.45 to 123,45 to convert an input parameter value to the French locale. As another example, the e.Report Designer Professional truncates trailing zeroes after a decimal separator in double values. A warning is useful in these cases so that the user can see the change. In some cases, however, the value format changes are only internal and a warning is inappropriate. If you do not want a warning, set the value to False.

DriverLibrariesA sequence of LibrariesForOS elements, optionally paired with SetJavaThreadContextClassLoader elements

Schema <xs:element name="DriverLibraries"><xs:complexType>

<xs:sequence><xs:element ref="LibrariesForOS"

maxOccurs="unbounded"/><xs:element name="SetJavaThreadContextClassLoader"

type="xs:boolean" minOccurs="0"></xs:element>

</xs:sequence></xs:complexType>

</xs:element>

Page 433: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 411

I n t e r f a c e T y p e

Elements LibrariesForOSLibrariesForOS, a child element of DriverLibraries, defines the required library files for each operating system of a machine that hosts the Factory.

SetJavaThreadContextClassLoaderIf you create an open data access (ODA) driver using a Java package such as Log4J that relies on the current Java thread’s context class loader to load its related classes, you can set this optional element to true to avoid class loader conflict. This sets the current thread’s context class loader to the one designated to load the driver’s run-time libraries. The default value is false.

InterfaceTypeSpecifies whether the driver is written in C or Java

Schema xs:element name="InterfaceType"><xs:simpleType>

<xs:restriction base="xs:string"><xs:enumeration value="C"/><xs:enumeration value="Java"/>

</xs:restriction></xs:simpleType>

</xs:element>

Elements C

Java

LibrariesForOsLibrariesForOS, a child element of DriverLibraries, defines the required library files for each operating system of a machine that hosts the Factory.

Schema <xs:element name="LibrariesForOS" type="LibrariesForOSType"/>

LibrariesForOsTypeLibrariesForOsType defines the required library files for each operating system of a machine that hosts the Factory. The following properties define LibrariesForOS:

Schema <xs:complexType name="LibrariesForOSType"><xs:sequence>

<xs:element ref="OSType"/><xs:element name="LibraryName" type="xs:string"

maxOccurs="unbounded"/>

Page 434: Accessing Data

412 A c c e s s i n g D a t a

L i s t O f P r o p e r t i e s

<xs:element name="Location" type="xs:string"minOccurs="0"/>

</xs:sequence></xs:complexType>

Elements LibraryNameIn LibraryName, provide the name of a driver library, such as a Java archive (.jar) file or an operating system library such as a DLL file on Windows. LibraryName must be a file name and file extension without a path, such as OdaLib.jar. A run-time ODA driver can have multiple libraries. Place all libraries for a driver in the same directory.

LocationIn the optional element Location, specify a path to the directory that contains the driver libraries. If you do not specify a location, the Factory loads the driver libraries from the directory containing the driver.

OSTypeIn OSType, specify the operating system. Valid values are Windows, Solaris, HP-UX, AIX, Linux, or All.

ListOfPropertiesAn unbounded sequence of properties

Schema <xs:element name="ListOfProperties"><xs:complexType><xs:sequence>

<xs:element ref="Property"maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element>

Elements PropertyContains the name, value and optionally other information for a property

NativeDataTypeTypeAn element that maps the data source’s native data types to ODA data types. e.Spreadsheet Designer uses the ODA data types. e.Report Designer Professional map ODA data types to Actuate Basic data types.

NativeDataTypeType also supports designating optional alternative data types that the user can change in the design environment. Implement all feasible data type mappings to ensure accurate conversions. For example, if a result set column

Page 435: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 413

O d a S c a l a r D a t a T y p e

is a native Integer type, the driver should support getString( ) to convert the Integer value to a string using a format specific to the data source.

Schema <xs:complexType name="NativeDataTypeType"><xs:sequence>

<xs:element name="NativeDataType" type="xs:string"/><xs:element name="NativeDataTypeCode" type="xs:short"/><xs:element ref="OdaScalarDataType"/><xs:element ref="AlternativeOdaDataTypes"

minOccurs="0"/></xs:sequence>

</xs:complexType>

Elements AlternativeOdaDataTypesAlternativeOdaDataTypes are optional additional data types that Actuate’s design tools support for this native type. In e.Report Designer Professional, when an alternative data type is assigned, the report developer can change the data type mapping for a column. In e.Spreadsheet Designer, the OdaScalarDataType is always used.

NativeDataTypeNativeDataType is the data type of the column in the open data source.

NativeDataTypeCodeNativeDataTypeCode is the code the open data source uses for the native data type.

OdaScalarDataTypeOdaScalarDataType is the corresponding ODA data type that Actuate’s design tools support.

OdaScalarDataTypeThe types of scalar data types used by ODA

Schema <xs:element name="OdaScalarDataType"><xs:simpleType>

<xs:restriction base="xs:string"><xs:enumeration value="Date"/><xs:enumeration value="Double"/><xs:enumeration value="Integer"/><xs:enumeration value="String"/><xs:enumeration value="Time"/><xs:enumeration value="Timestamp"/><xs:enumeration value="Decimal"/>

</xs:restriction></xs:simpleType>

</xs:element>

Page 436: Accessing Data

414 A c c e s s i n g D a t a

O p e n D a t a A c c e s s C o n f i g

Elements Date

Decimal

Double

Integer

String

Time

Timestamp

OpenDataAccessConfigSpecifies the access information for the custom ODA driver

Schema <xs:element name="OpenDataAccessConfig"><xs:complexType>

<xs:sequence><xs:element name="DriverName" type="xs:string"/><xs:element ref="VendorInfo"/><xs:element name="ODAInterfaceVersion"

type="xs:float"/><xs:element ref="DesignTimeInterface"/><xs:element ref="RunTimeInterface"/><xs:element ref="Connection"/><xs:element ref="DataSources"/>

</xs:sequence></xs:complexType>

</xs:element>

Elements ConnectionEach driver supports a single type of connection and can support multiple instances of that connection type.

DataSourcesEach driver can support multiple data sources. A sequence of DataSource elements defines the data sources.

DesignTimeInterfaceSpecifies the executable file with which to build the data source

DriverNameA unique, case-sensitive identifier for each driver. The name must be the same as the name of the folder containing the ODA driver files. Thus, the name must contain only characters that the operating system can interpret as a part of a folder name.

Page 437: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 415

O S T y p e

ODAInterfaceVersionA mandatory element that supports backward compatibility for future versions of the design-time and run-time interfaces. The value must be a Float. If the ODA driver was compiled using Actuate 7 Service Pack 2, the value is 1. If you compile your driver using the interfaces for Actuate 8 then the value is 1.1. If you compile using Actuate 8 Service Pack 1, the value is 1.2. If you compile using Actuate 10, the value is 1.3.

RuntimeInterfaceDefines the run-time interface

VendorInfoSpecifies information about the ODA driver and its vendor. Actuate’s design tools do not use this information.

OSTypeThe type of operating system that works with the driver

Schema <xs:element name="OSType"><xs:simpleType>

<xs:restriction base="xs:string"><xs:enumeration value="Windows"/><xs:enumeration value="Solaris"/><xs:enumeration value="HP-UX"/><xs:enumeration value="AIX"/><xs:enumeration value="LINUX"/><xs:enumeration value="All"/>

</xs:restriction></xs:simpleType>

</xs:element>

Elements AIX

All

HP-UX

LINUX

Solaris

Windows

PropertiesAn unbounded sequence of properties

Page 438: Accessing Data

416 A c c e s s i n g D a t a

P r o p e r t y

Schema <xs:element name="Properties"><xs:complexType>

<xs:sequence><xs:element ref="Property" maxOccurs="unbounded"/>

</xs:sequence></xs:complexType>

</xs:element>

Elements PropertyContains the name, value and optionally other information for a property

PropertyAn element of type PropertyType, containing the name, value and optionally other information for a property

Schema <xs:element name="Property" type="PropertyType"/>

PropertyTypeContains the name, value and optionally other information for a property

Schema <xs:complexType name="PropertyType"><xs:sequence>

<xs:element name="Name" type="xs:string"/><xs:element name="DisplayName" type="xs:string"

minOccurs="0"/><xs:element name="Value" type="xs:string"/><xs:element name="SelectValueList" type="ArrayOfString"

minOccurs="0"/></xs:sequence>

</xs:complexType>

Elements DisplayNameAn optional string to use when displaying the property to users

NameThe name is unique

SelectValueListAn optional array of strings to present to the user as choices for the property value

ValueThe value is the default value to use in the report design.

Page 439: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 417

R u n T i m e I n t e r f a c e

RunTimeInterfaceDefines the run-time interface

Schema <xs:element name="RunTimeInterface"><xs:complexType>

<xs:sequence><xs:element ref="InterfaceType"/><xs:element name="DriverInitEntryPoint"

type="xs:string"/><xs:element ref="DriverLibraries"/><xs:element name="TraceLogging" type="TraceLogging"

minOccurs="0"/><xs:element name="StreamedResultSetBufferSize"

type="xs:unsignedShort" minOccurs="0"></xs:element>

</xs:sequence></xs:complexType>

</xs:element>

Elements DriverInitEntryPointThe entry point for the Factory after it loads the required ODA library. For a Java interface, the value is a custom class that implements IConnectionFactory. The Factory uses this name to create a Java object that creates the Java connection object.

DriverLibrariesDefines any libraries the custom driver uses but does not load. Use this element to list libraries that the Factory should load with the ODA driver. For ODA drivers with InterfaceType Java, these libraries must be .jar or .zip files. You can define libraries for multiple operating systems using this element. You must include AcOdaInterfaces.jar, which contains the ODA run-time interfaces. For more information about these interfaces, see Accessing Data using Actuate e.Report Designer Professional, or Accessing Data using e.Spreadsheet Technology.

InterfaceTypeThe programming language used to write the custom ODA data driver. In Actuate 8, Actuate 9, and Actuate 10, the value must be Java.

LibrariesForOSLibrariesForOS, a child element of DriverLibraries, defines the required library files for each operating system of a machine that hosts the Factory.

StreamedResultSetBufferSizeOptional element for internal use only.

TraceLoggingOptional element that defines the log configuration information. This information is used by the classes and interface in the com.actuate.oda.util.logging package,

Page 440: Accessing Data

418 A c c e s s i n g D a t a

T r a c e L o g g i n g

such as Logger and LogManager. For more information about these classes and interface, see Accessing Data using Actuate e.Report Designer Professional, or Accessing Data using e.Spreadsheet Technology.

TraceLoggingDefines the log configuration information. This information is used by the classes and interface in the com.actuate.oda.util.logging package, such as Logger and LogManager. For more information about these classes and interface, see Accessing Data using Actuate e.Report Designer Professional, or Accessing Data using e.Spreadsheet Technology.

Schema <xs:complexType name="TraceLogging"><xs:sequence>

<xs:element name="LogLevel" type="xs:short"/><xs:element name="LogFilenamePrefix" type="xs:string"/><xs:element name="LogDirectory" type="xs:string"

minOccurs="0"/><xs:element name="JavaLogFormatterClass"

type="xs:string" minOccurs="0"/></xs:sequence>

</xs:complexType>

Elements JavaLogFormatterClassAn optional element to specify the class to use to format the log records. If no class is used, then the logger uses the SimpleFormatter class. For more information about the SimpleFormatter class, see Accessing Data using Actuate e.Report Designer Professional, or Accessing Data using e.Spreadsheet Technology.

LogDirectoryIn LogDirectory, specify the absolute path of the directory to use for log files. If not specified, the default log directory is the log subdirectory under the ODA driver directory: <Actuate_install_directory>/oda/<driver_dir>/log/.

LogFilenamePrefixIn LogFilenamePrefix, specify the prefix for log files. Log files are named in the following format: <prefix>-<date and time>.log.

LogLevelIn LogLevel, specify the lowest level of log records to publish. For a list of log levels, see the fields defined for Class Level in Accessing Data using Actuate e.Report Designer Professional, or Accessing Data using e.Spreadsheet Technology.

Page 441: Accessing Data

C h a p t e r 1 7 , C o n f i g u r a t i o n f i l e X M L s c h e m a r e f e r e n c e 419

V e n d o r I n f o

VendorInfoSpecifies information about the ODA driver and its vendor. Actuate’s design tools do not use this information.

Schema <xs:element name="VendorInfo"><xs:complexType>

<xs:sequence><xs:element name="ProductName" type="xs:string"/><xs:element name="Version" type="xs:string"/><xs:element name="Vendor" type="xs:string"/><xs:element name="VendorURL" type="xs:string"

minOccurs="0"/><xs:element name="VendorPhone" type="xs:string"

minOccurs="0"/><xs:element name="CopyrightNotice" type="xs:string"

minOccurs="0"/></xs:sequence>

</xs:complexType></xs:element>

Elements ProductNameRequired element that provides the name of the custom ODA driver

VersionRequired element that provides the version of the custom ODA driver

VendorRequired element that provides the name of the company or other organization that created the custom ODA driver

VendorURLOptional element to provide a URL for the vendor

VendorPhoneOptional element to provide a phone number for the vendor

CopyrightNoticeOptional element to provide a copyright notice for the custom ODA driver

Page 442: Accessing Data

420 A c c e s s i n g D a t a

Page 443: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 421

C h a p t e r

18Chapter 18Custom data driver

XML referenceThis chapter contains the following topics:

■ About communicating the structure of your data source

■ Data source builder reference

Page 444: Accessing Data

422 A c c e s s i n g D a t a

A r r a y O f I n p u t F i e l d D e f i n i t i o n

About communicating the structure of your data sourceA report developer uses a custom driver from an Actuate design tool, such as e.Report Designer Professional or e.Spreadsheet Designer. To access a data source, the custom driver must provide an application that provides information about the data source and allows the report developer to further specify the parameters and properties of a data stream component. A data source builder is the application that provides this information and capability.

Design tools use XML files and a request-and-response format to communicate with the data source builder. The design tool passes the names of the data stream definition XML request and response files to the data source builder as additional command-line arguments. The data source builder parses XML request files and creates XML response files.

This chapter is a reference guide to the XML schema that is used in this communication. These XML elements define the structure, content, and semantics of the ODA XML request and response streams. Your data source builder must recognize and use these XML elements.

Data source builder referenceThis section provides an alphabetical list of XML elements that the data source builder uses.

ArrayOfInputFieldDefinitionList of input parameter field definitions

Schema <xs:complexType name="ArrayOfInputFieldDefinition"> <xs:sequence>

<xs:element name="InputFieldDefinition"type="actu:InputFieldDefinition" maxOccurs="unbounded" />

</xs:sequence> </xs:complexType>

Elements InputFieldDefinitionThe properties of an input parameter field

See also InputFieldDefinition

Page 445: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 423

A r r a y O f I n p u t P a r a m e t e r D e f i n i t i o n

ArrayOfInputParameterDefinitionList of input parameter definitions

Schema <xs:complexType name="ArrayOfInputParameterDefinition"><xs:sequence>

<xs:element name="InputParameterDefinition"type="actu:InputParameterDefinition" maxOccurs="unbounded" />

</xs:sequence> </xs:complexType>

Elements InputParameterDefinitionThe properties of an input parameter

See also InputParameterDefinition

ArrayOfNameValuePairList of NameValuePair elements

Schema <xs:complexType name="ArrayOfNameValuePair"> <xs:sequence>

<xs:element name="NameValuePair" type="actu:NameValuePair" maxOccurs="unbounded" />

</xs:sequence> </xs:complexType>

Elements NameValuePairThe NameValuePair data type

ArrayOfOutputFieldDefinitionList of output parameter field definitions

Schema <xs:complexType name="ArrayOfOutputFieldDefinition"> <xs:sequence maxOccurs="unbounded">

<xs:element name="OutputFieldDefinition"type="actu:OutputFieldDefinition" />

</xs:sequence> </xs:complexType>

Elements OutputFieldDefinitionThe properties of an output parameter field

See also OutputFieldDefinition

Page 446: Accessing Data

424 A c c e s s i n g D a t a

A r r a y O f O u t p u t P a r a m e t e r D e f i n i t i o n

ArrayOfOutputParameterDefinitionList of output parameter definitions

Schema <xs:complexType name="ArrayOfOutputParameterDefinition"> <xs:sequence maxOccurs="unbounded">

<xs:element name="OutputParameterDefinition"type="actu:OutputParameterDefinition" />

</xs:sequence> </xs:complexType>

Elements OutputParameterDefinitionThe properties of an output parameter

See also OutputParameterDefinition

ArrayOfPropertyList of property name-value pairs

Schema <xs:complexType name="ArrayOfProperty"> <xs:sequence>

<xs:element name="Property" type="actu:Property" maxOccurs="unbounded" />

</xs:sequence> </xs:complexType>

Elements PropertyA name-value pair that describes an object

See also Property

ArrayOfResultColumnList of result columns that are found in each row of the result set

Schema <xs:complexType name="ArrayOfResultColumn"> <xs:sequence>

<xs:element name="ResultColumn" type="actu:ResultColumn"maxOccurs="unbounded" />

</xs:sequence> </xs:complexType>

Elements ResultColumnThe properties of a result set column

See also ResultColumn

Page 447: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 425

A r r a y O f S t r i n g

ArrayOfStringList of String elements

Schema <xs:complexType name="ArrayOfString"> <xs:sequence>

<xs:element name="String" type="xs:string" maxOccurs="unbounded" />

</xs:sequence> </xs:complexType>

Elements StringThe String data type

AxisTypeAxis type of a result set column. AxisType has one of the following values:

■ Dimension Member

■ Dimension Attribute

■ Measure

This information is used by information objects and provides information to users and applications about how to use the column.

Schema <xs:simpleType name="AxisType" final="restriction"><xs:restriction base="xs:string">

<xs:enumeration value="DimensionMember"/><xs:enumeration value="DimensionAttribute"/><xs:enumeration value="Measure"/>

</xs:restriction></xs:simpleType>

Elements DimensionAttribute

DimensionMember

Measure

ColumnAxisInfoMultidimensional attributes of a result set column

Page 448: Accessing Data

426 A c c e s s i n g D a t a

C o n n e c t i o n P r o p e r t i e s

Schema <xs:complexType name="ColumnAxisInfo"><xs:all>

<xs:element name="AxisType" type="actu:AxisType"></xs:element><xs:element name="OnColumnLayout" type="xs:boolean"

minOccurs="0"></xs:element>

</xs:all></xs:complexType>

AxisTypeAxis type of a result set column

OnColumnLayoutThe recommended layout in a report. The default value is true. If true, the recommended layout is as a column. This information is used by presentation tools such as a crosstab to present a default layout.

See also AxisType

ConnectionPropertiesProperties of the open data source connection

Schema <xs:complexType name="ConnectionProperties"> <xs:complexContent>

<xs:extension base="actu:ArrayOfProperty" /> </xs:complexContent>

</xs:complexType>

DataStreamDefinitionThe properties that define the data stream to use in a report or query design. DataStreamDefinition is an element of both DesignSessionRequest and DesignSessionResponse.

Schema <xs:complexType name="DataStreamDefinition"> <xs:all>

<xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="Type" type="xs:string"> </xs:element> <xs:element name="ShortDescription" type="xs:string"

minOccurs="0"> </xs:element> <xs:element name="Command" type="xs:string"> </xs:element>

Page 449: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 427

D a t a S t r e a m D e f i n i t i o n

<xs:element name="PublicProperties"type="actu:ArrayOfProperty" minOccurs="0">

</xs:element> <xs:element name="PrivateProperties"

type="actu:ArrayOfProperty" minOccurs="0"> </xs:element> <xs:element name="InputParameters"

type="actu:ArrayOfInputParameterDefinition"minOccurs="0">

</xs:element> <xs:element name="OutputParameters"

type="actu:ArrayOfOutputParameterDefinition"minOccurs="0">

</xs:element><xs:element name="PrimaryResultSet"

type="actu:ResultSetDefinition" minOccurs="0"> </xs:element>

</xs:all> </xs:complexType>

Elements CommandThe command or query to execute to retrieve the result set. Command or query syntax is specific to the data source and must be recognized by the driver when the report or query runs. A command typically retrieves a result set but also can perform other tasks, such as updating a file.

InputParametersDefinitions of input parameters to map as report parameters. A report or query developer can edit the report parameters in the design tool. For example, the report developer can change the definition of the parameter, its control type, and so on.

NameThe external name of the data stream

OutputParametersDefinitions of output parameters

PrimaryResultSetThe ResultSetDefinition for the result set that the data stream returns.

PrivatePropertiesPrivate properties of the open data source. A report or query developer cannot edit these properties in the design tool.

PublicPropertiesNamed properties of the open data source. A report or query developer can edit these properties in the design tool. Each public property maps by name to a corresponding property in the AFC class for the data source. If a public property is specified in the design session interface but not in the corresponding AFC class, the design tool ignores the property.

Page 450: Accessing Data

428 A c c e s s i n g D a t a

D e s i g n S e s s i o n R e q u e s t

ShortDescriptionA business description of the data stream

TypeThe type of the data stream, which is specific to the data source provider.

See also InputParameterDefinitionOutputParameterDefinitionResultSetDefinition

DesignSessionRequestThe request that defines the data that the design tool passes to an ODA data design tool at the start of the design session

Schema <xs:complexType name="DesignSessionRequest"><xs:all>

<xs:element name="SessionLocale"type="actu:SessionLocale">

</xs:element><xs:element name="SessionEditMode"

type="actu:SessionEditMode" minOccurs="0"/><xs:element name="ExternalDesignState"

type="actu:ExternalState"minOccurs="0"></xs:element> <xs:element name="PublicConnectionProperties"

"type="actu:ConnectionProperties" minOccurs="0" /> <xs:element name="PrivateConnectionProperties"

type="actu:ConnectionProperties" minOccurs="0" /> <xs:element name="DataStreamDefinition"

type="actu:DataStreamDefinition" minOccurs="0" /></xs:all>

</xs:complexType>

Elements DataStreamDefinitionThe properties of a data stream

ExternalDesignStateAn optional element that retrieves the private state of the data source builder when the builder exits. The data source builder uses this information to return to the state of its last session.

PrivateConnectionPropertiesProperties of the connection that a report developer cannot edit in the design tool.

PublicConnectionPropertiesProperties of the connection that a report or query developer can edit for an ODA connection component.

Page 451: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 429

D e s i g n S e s s i o n R e s p o n s e

SessionEditModeSpecifies whether users can make changes in the ODA design tool.

SessionLocaleSpecifies the application locale of the Actuate design tool. The application locale specifies the time and date format, currency format, and other characteristics of the data. The data source builder uses the same locale as the Actuate design tool, if possible. If the Actuate design tool uses the Japanese locale, the data source builder uses the Japanese locale in its design session. If your data source builder code does not support the specified locale, it should display a message to the user that lists the supported locales. The user can then change the Actuate design tool’s locale to a supported locale.

See also DataStreamDefinition

DesignSessionResponseDefinition of the data stream and connection that an ODA data source builder returns when the builder exits.

Schema <xs:complexType name="DesignSessionResponse"> <xs:all>

<xs:element name="ResponseState"type="actu:ResponseState">

</xs:element><xs:element name="ExternalDesignState"

type="actu:ExternalState" minOccurs="0"></xs:element><xs:element name="PublicConnectionProperties"

type="actu:ConnectionProperties" minOccurs="0" /> <xs:element name="PrivateConnectionProperties"

type="actu:ConnectionProperties" minOccurs="0" /><xs:element name="DataStreamDefinition"

type="actu:DataStreamDefinition" minOccurs="0" /></xs:all>

</xs:complexType>

Elements DataStreamDefinitionThe properties of a data stream.

ExternalDesignStateAn optional element that specifies the private state of the data source builder when it exits. The data source builder uses this information to return to the state of its last session.

PrivateConnectionPropertiesThe properties of the connection that cannot be edited in the design tool.

Page 452: Accessing Data

430 A c c e s s i n g D a t a

D y n a m i c C o n d i t i o n R e f e r e n c e

PublicConnectionPropertiesThe properties of the connection that a report or query developer can edit for an ODA connection component.

ResponseStateThe state of the ODA data source builder when it exits. Valid values are:

■ OK indicates that the data source builder session succeeded. The design tool can consume and save the data.

■ UserCancelled indicates that the user stopped the data source builder session.

■ LoginFailed indicates that the data source builder is not able to establish a connection using ConnectionProperties in DesignSessionRequest.

See also DataStreamDefinition

DynamicConditionReferenceDescription of the data source column that an ad hoc parameter filters.

Schema <xs:complexType name="DynamicConditionReference"><xs:all>

<xs:element name="Identifier" type="xs:string"/><xs:element name="IdentifierNativeTypeCode"

type="xs:short"/></xs:all>

</xs:complexType>

Elements IdentifierThe name of the referenced data source column.

IdentifierNativeTypeCodeThe native data type of the referenced column in the data source.

DynamicQueryDefinition of the input parameter’s dynamic query, if any. Specifying DynamicQuery enables an ODA host, such as e.Report Designer Professional, to provide users with a dynamic list of values from which they can select top-level scalar parameter values.

Page 453: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 431

E x t e r n a l S t a t e

Schema <xs:complexType name="DynamicQuery"><xs:all>

<xs:element name="IsEnabled" type="xs:boolean"default="true" minOccurs="0"/>

<xs:element name="QueryText" type="xs:string"minOccurs="0"/>

<xs:element name="ValueColumn" type="xs:string"minOccurs="0"/>

<xs:element name="DisplayNameColumn" type="xs:string"minOccurs="0"/>

</xs:all></xs:complexType>

Elements DisplayNameColumnThe result set column name whose values provide localized descriptions of the values in valueColumn. If you specify a value for DisplayNameColumn, the user selects from the list of values in that column, and the query uses the ValueColumn value that appears in the same data row as the selected DisplayNameColumn value. For example, set valueColumn to the name of the column that contains company identifier codes for use in the query, and set DisplayNameColumn to the name of the column that provides the company names. By setting DisplayNameColumn, you enable users to pick from a list of company names instead of the corresponding codes used by the query.

IsEnabledSpecifies whether the dynamic query is enabled. The default value is true. If false, the QueryText remains but is not used.

QueryTextThe Actuate SQL query.

ValueColumnThe result set column name whose selected value is used in the query. The ValueColumn must be set to one of the column names defined in the dynamic query’s primary result set. If DisplayNameColumn is not specified, then the user selects directly from the retrieved values from the ValueColumn column.

ExternalStatePrivate state of the previous data source builder session.

Schema <xs:complexType name="ExternalState"><xs:all>

<xs:element name="Version" type="xs:string"></xs:element><xs:element name="StateInfo" type="actu:StateInfo"></xs:element>

Page 454: Accessing Data

432 A c c e s s i n g D a t a

H o r i z o n t a l A l i g n m e n t

</xs:all></xs:complexType>

Elements StateInfoPrivate data that is formatted by the data source builder to describe the state of its last design session. Can be either String or binary format.

VersionThe version of the external state’s data format.

HorizontalAlignmentHorizontalAlignment values are left, center, right, or automatic. The default value is Automatic. If the HorizontalAlignment value is automatic, the design tool determines the alignment based on its own default rules.

Schema <xs:simpleType name="HorizontalAlignment" final="restriction"><xs:restriction base="xs:string">

<xs:enumeration value="Automatic"/><xs:enumeration value="Left"/><xs:enumeration value="Center"/><xs:enumeration value="Right"/>

</xs:restriction></xs:simpleType>

Elements Automatic

Center

Left

Right

InputFieldDefinitionDefinition of an input parameter field.

Schema <xs:complexType name="InputFieldDefinition"> <xs:all>

<xs:element name="Name" type="xs:string"> </xs:element><xs:element name="DisplayName" type="xs:string"

minOccurs="0"><xs:element name="Description" type="xs:string"

minOccurs="0"></xs:element><xs:element name="DataType" type="actu:OdaScalarDataType"></xs:element>

Page 455: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 433

I n p u t F i e l d D e f i n i t i o n

<xs:element name="IsHidden" type="xs:boolean"minOccurs="0">

</xs:element><xs:element name="IsRequired" type="xs:boolean"

minOccurs="0"> </xs:element><xs:element name="DefaultValue" type="xs:string"

minOccurs="0"> </xs:element><xs:element name="SelectValueList"

type="actu:ArrayOfString minOccurs="0"> </xs:element><xs:element name="SelectNameValueList"

type="actu:ArrayOfNameValuePair” minOccurs="0"> </xs:element><xs:element name="FieldControlType" minOccurs="0">

<xs:simpleType> <xs:restriction base="xs:string">

<xs:enumeration value="ControlList" /> <xs:enumeration value="ControlListAllowNew" /><xs:enumeration value="ControlTextBox" />

</xs:restriction> </xs:simpleType>

</xs:element> </xs:all>

</xs:complexType>

Elements DataTypeThe ODA scalar type of the input parameter field.

DefaultValueThe default value of the input parameter field. Use the XML data format that corresponds to the ODA data type of the input parameter field. For example, an input parameter with the timestamp data type should have the following format:

yyyy-mm-ddThh:mm:ss

DescriptionThe description of the input parameter field.

DisplayNameThe display name of the input parameter field.

FieldControlTypeThe type of control for the input parameter field. Valid values are:

■ ControlList

■ ControlListAllowNew

■ ControlTextBox

Page 456: Accessing Data

434 A c c e s s i n g D a t a

I n p u t P a r a m e t e r D e f i n i t i o n

IsHiddenIndicates whether the input parameter field is hidden or visible.

IsRequiredIndicates whether the input parameter field is required.

NameA unique name for the input parameter field.

SelectValueListDeprecated. Use SelectNameValueList.

SelectNameValueListA list of selectable values and their corresponding display names for the input parameter field. For each value, use the XML data format that corresponds to the ODA data type of the input parameter field. For example, an input parameter with the timestamp data type should have the following format:

yyyy-mm-ddThh:mm:ss

InputParameterDefinitionDefinition of a scalar or complex input parameter. An input parameter consists of attributes such as the parameter name, data type, default value, and so on. A complex parameter also contains a collection of fields, which are defined in the RecordDefinition element.

Schema <xs:complexType name="InputParameterDefinition"> <xs:all>

<xs:element name="Group" type="xs:string" minOccurs="0"> </xs:element><xs:element name="Name" type="xs:string"> </xs:element><xs:element name="DataType" type="actu:OdaDataType"> </xs:element><xs:element name="DefaultValue" type="xs:string"

minOccurs="0"><xs:element name="Description" type="xs:string"

minOccurs="0"></xs:element><xs:element name="IsRequired" type="xs:boolean"

minOccurs="0"> </xs:element><xs:element name="IsPassword" type="xs:boolean"

minOccurs="0"> </xs:element><xs:element name="IsHidden" type="xs:boolean"

minOccurs="0"> </xs:element>

Page 457: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 435

I n p u t P a r a m e t e r D e f i n i t i o n

<xs:element name="DisplayName" type="xs:string"minOccurs="0">

</xs:element><xs:element name="SelectValueList"

type="actu:ArrayOfString" minOccurs="0"> </xs:element><xs:element name="SelectNameValueList"

type="actu:ArrayOfNameValuePair" minOccurs="0"> </xs:element><xs:element name="DynamicValueList"

type="actu:DynamicQuery" minOccurs="0"> </xs:element><xs:element name="DynamicCondition"

type="actu:DynamicConditionReference" minOccurs="0"> </xs:element><xs:element name="ControlType" minOccurs="0">

<xs:simpleType> <xs:restriction base="xs:string">

<xs:enumeration value="ControlRadioButton" /><xs:enumeration value="ControlList" /> <xs:enumeration value="ControlListAllowNew" /> <xs:enumeration value="ControlCheckBox" /> <xs:enumeration value="ControlTextBox" />

</xs:restriction> </xs:simpleType>

</xs:element><xs:element name="RecordDefinition"

type="actu:ArrayOfInputFieldDefinition" minOccurs="0"> </xs:element>

</xs:all> </xs:complexType>

Elements ControlTypeThe type of control. Valid values are:

■ ControlRadioButton

■ ControlList

■ ControlListAllowNew

■ ControlCheckBox

■ ControlTextBox

DataTypeThe ODA data type of the input parameter.

DefaultValueThe default value of the input parameter. If a user can use the parameter to provide an expression that specifies additional conditions, provide the default value in QBE syntax. For information about the QBE syntax in each design tool, see Working with Reports using Actuate Information Console. If a user can provide

Page 458: Accessing Data

436 A c c e s s i n g D a t a

I n p u t P a r a m e t e r D e f i n i t i o n

only a specific value for the parameter, use the XML data format that corresponds to the ODA data type of the input parameter field. For example, an input parameter with the timestamp data type should have the following format:

yyyy-mm-ddThh:mm:ss

DescriptionThe description of the input parameter field.

DisplayNameThe display name of the input parameter.

DynamicConditionAn optional element that describes the data source column that is filtered by an ad hoc parameter. This element only applies to a scalar input parameter.

DynamicValueListA dynamic list of values that a user can select for a scalar input parameter.

GroupThe parameter group to which the input parameter belongs.

IsHiddenIndicates whether the input parameter is hidden.

IsPasswordIndicates whether to mask the input parameter value.

IsRequiredIndicates whether the input parameter is required.

Name The name of the input parameter.

RecordDefinitionThe definition of complex input parameter fields.

SelectValueListDeprecated. Use SelectNameValueList.

SelectNameValueListA list of selectable values and their corresponding display names for the input parameter. If a user can use the parameter to provide an expression that specifies additional conditions, use QBE syntax to create each value. For information about QBE syntax, Working with Reports using Actuate Information Console. If a user can provide only a specific value for the parameter, create each value using the XML data format that corresponds to the ODA data type of the input parameter. For example, an input parameter with the timestamp data type should have the following format:

yyyy-mm-ddThh:mm:ss

Page 459: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 437

N a m e V a l u e P a i r

NameValuePairThe definition of a name and its corresponding value.

Schema <xs:complexType name="NameValuePair"> <xs:all>

<xs:element name="Name" type="xs:string" /> <xs:element name="Value" type="xs:string" />

</xs:all> </xs:complexType>

Elements NameThe name that corresponds to the value. For example, the name can be the display name for an input parameter value. The string can be empty.

ValueThe value. The string can be empty.

OdaDataTypeOpen data access data types. The definition and range of values for each data type is specific to the programming language the ODA data source uses. For example, an ODA driver that is implemented in Java maps its native data types, which are expressed as java.sql.Types, to the corresponding ODA data type. The design tool maps and converts the ODA data types to one of its data types using the DataTypeMapping element of odaconfig.xml. For example, the native data type DOUBLE maps to the ODA data type double. You also can assign an alternate ODA data type to a native type, as shown in the following example:

<DataTypeMapping><NativeDataType>DOUBLE</NativeDataType><NativeDataTypeCode>8</NativeDataTypeCode><OdaScalarDataType>Double</OdaScalarDataType><AlternativeODADataTypes>

<OdaScalarDataType>Integer</OdaScalarDataType><OdaScalarDataType>String</OdaScalarDataType>

</AlternativeODADataTypes></DataTypeMapping>

Schema <xs:simpleType name="OdaDataType" final="restriction"><xs:restriction base="xs:string">

<xs:enumeration value="Date" /> <xs:enumeration value="Double" /> <xs:enumeration value="Integer" /> <xs:enumeration value="String" /> <xs:enumeration value="Structure" /> <xs:enumeration value="Table" />

Page 460: Accessing Data

438 A c c e s s i n g D a t a

O d a S c a l a r D a t a T y p e

<xs:enumeration value="Time" /> <xs:enumeration value="Timestamp" /> <xs:enumeration value="Decimal" /> <xs:enumeration value="Blob" /> <xs:enumeration value="Clob" />

</xs:restriction> </xs:simpleType

Elements Blob

Clob

Date

Decimal

Double

Integer

String

Structure

Table

Time

Timestamp

OdaScalarDataTypeOpen data access scalar data types. The definition and range of values for each data type is specific to the programming language that the ODA data source uses.

Schema <xs:simpleType name="OdaScalarDataType" final="restriction"> <xs:restriction base="xs:string">

<xs:enumeration value="Date" /> <xs:enumeration value="Double" /> <xs:enumeration value="Integer" /> <xs:enumeration value="String" /> <xs:enumeration value="Time" /> <xs:enumeration value="Timestamp" /> <xs:enumeration value="Decimal"/><xs:enumeration value="Blob"/><xs:enumeration value="Clob"/>

</xs:restriction> </xs:simpleType>

Page 461: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 439

O u t p u t F i e l d D e f i n i t i o n

Elements Blob

Clob

Date

Decimal

Double

Integer

String

Time

Timestamp

OutputFieldDefinitionDefinition of an output parameter field

Schema <xs:complexType name="OutputFieldDefinition"> <xs:all>

<xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="Description" type="xs:string"

minOccurs="0"></xs:element> <xs:element name="DisplayName" type="xs:string"

minOccurs="0"></xs:element> <xs:element name="NativeTypeCode" type="xs:short"> </xs:element> <xs:element name="NativeTypeName" type="xs:string"> </xs:element>

</xs:all> </xs:complexType>

Elements DescriptionA description of the parameter

DisplayNameThe display name of the output parameter or output parameter field

NameThe name of the output parameter or output parameter field

NativeTypeCodeThe native type code of the output parameter or output parameter field. odaconfig.xml maps the native data type of the open source to an ODA data type.

Page 462: Accessing Data

440 A c c e s s i n g D a t a

O u t p u t P a r a m e t e r D e f i n i t i o n

Then, the design tool uses the ODA data type to map to its own native data type. A value of 0 means that the open source native type is unknown.

NativeTypeNameThe native type name of the output parameter or output parameter field

OutputParameterDefinitionDefinition of a complex output parameter. A complex output parameter consists of attributes, such as the parameter name, data type, default value, and so on. It also contains a collection of fields, which are defined in the RecordDefinition element.

Schema <xs:complexType name="OutputParameterDefinition"> <xs:all>

<xs:element name="Attributes"type="actu:OutputFieldDefinition">

</xs:element> <xs:element name="RecordDefinition"

type="actu:ArrayOfOutputFieldDefinition" minOccurs="0"> </xs:element>

</xs:all> </xs:complexType>

Elements RecordDefinitionThe definition of a complex output parameter field

PropertyA property name-value pair

Schema <xs:complexType name="Property"> <xs:all>

<xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="Value" type="xs:string"> </xs:element>

</xs:all> </xs:complexType>

Elements NameThe property name

ValueThe property value

Page 463: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 441

R e s p o n s e S t a t e

ResponseStateIndicates to the design tool how to proceed after data source builder exits

Schema <xs:simpleType name="ResponseState" final="restriction"><xs:restriction base="xs:string">

<xs:enumeration value="Ok" /> <xs:enumeration value="UserCancelled" /><xs:enumeration value="LoginFailed" /> <xs:enumeration value="ProviderError" />

</xs:restriction></xs:simpleType>

Elements LoginFailedIndicates that the data source builder is not able to establish a connection using the connection properties in DesignSessionRequest

OkIndicates that the data source builder session succeeded. The design tool can consume and save the data.

UserCancelledIndicates that the user stopped the data source builder session

ProviderErrorIndicates that a failure occurred that is unrelated to a login failure or a user cancelling

ResultColumnDefinition of a result set column

Schema <xs:complexType name="ResultColumn"> <xs:all>

<xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="Position" type="xs:unsignedShort"> </xs:element> <xs:element name="DisplayName" type="xs:string"

minOccurs="0"></xs:element> <xs:element name="NativeTypeCode" type="xs:short"> </xs:element> <xs:element name="NativeTypeName" type="xs:string"> </xs:element> <xs:element name="DisplayLength" type="xs:short"

minOccurs="0"></xs:element>

Page 464: Accessing Data

442 A c c e s s i n g D a t a

R e s u l t C o l u m n

<xs:element name="DisplayFormat" type="xs:string">minOccurs="0">

</xs:element> <xs:element name="TextFormat" default="Plain"

minOccurs="0"><xs:simpleType>

<xs:restriction base="xs:string"><xs:enumeration value="Plain"/><xs:enumeration value="HTML"/><xs:enumeration value="RTF"/>

</xs:restriction></xs:simpleType>

</xs:element><xs:element name="HorizontalAlignment" </xs:element><xs:element name="Wrap" default="None" minOccurs="0">

<xs:simpleType><xs:restriction base="xs:string">

<xs:enumeration value="None"/><xs:enumeration value="Word"/>

</xs:restriction></xs:simpleType>

</xs:element><xs:element name="Heading" type="xs:string" minOccurs="0"></xs:element> <xs:element name="Description" type="xs:string"

minOccurs="0"></xs:element> <xs:element name="HelpText" type="xs:string"

minOccurs="0"></xs:element> <xs:element name="Lineage" type="xs:string" minOccurs="0"></xs:element> <xs:element name="Axis" type="actu:ColumnAxisInfo"

minOccurs="0"></xs:element>

</xs:all> </xs:complexType>

Elements AxisThe axis metadata information for a column that is retrieved from a multidimensional data source

DescriptionA description of the column

DisplayFormatThe preferred format in which to display this data in the report output

Page 465: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 443

R e s u l t C o l u m n

DisplayLengthThe default display length of the data column. The design tool uses this value to set the default length of the corresponding data control. A value of -1 means that the length is unknown.

DisplayNameThe business name of the column. The design tool uses this name as a default column label and as a reference name in the value expression of a data control.

HeadingThe name of the column in the column header in the data source.

HelpTextThe balloon help text for this column. A user can access this balloon text for additional information about the column, such as when the user is selecting a value for a filter condition.

HorizontalAlignmentHorizontal alignment of the column value within the available display space.

LineageThe original source of the column value. This value provides context information to help a user diagnose problems with the value. This element does not apply to derived values.

NameThe name of data row column. This is the name that the run-time driver recognizes. The design tool uses this name as an identifier in dialog boxes for sorting, filtering, and other tasks.

NativeTypeCodeThe native data type code of the column. odaconfig.xml maps the native data type of the open source to an ODA data type. Then, the design tool uses the ODA data type to map to one of its data types. A value of 0 means that the native type is unknown.

NativeTypeNameThe native data type name of the column. This name appears in such tools as the data row editor.

PositionThe 1-based position of a column within the result set when the report or Actuate query runs.

TextFormatIndicates whether the data column’s string values are in plain text, HTML, or RTF format. The default value is Plain.

Page 466: Accessing Data

444 A c c e s s i n g D a t a

R e s u l t S e t D e f i n i t i o n

WrapIndicates whether to apply word wrapping. The default value is None. If None, there is no word wrapping. A value of Word enables word wrapping.

See also ColumnAxisInfoHorizontalAlignment

ResultSetDefinitionThe definition of a single result set that the data stream returns. Each ResultSetDefinition is a named collection of data columns. A result set maps to a Data Row component in the design tool. A data stream must have at least one result set. You define the result set in terms of data columns.

Schema <xs:complexType name="ResultSetDefinition"><xs:all>

<xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="ResultSetColumns"

type="actu:ArrayOfResultColumn"> </xs:element>

</xs:all> </xs:complexType>

Elements NameThe name of the result set

ResultSetColumnsA collection of data columns for this result set

See also ResultColumn

SessionEditModeSpecifies whether users can make changes in the ODA design tool. SessionEditMode can have one of the following values:

■ Editable

The default value. This value indicates that the Actuate design tool will accept and use changes that a user makes using the ODA design tool.

■ ReadOnly

This value indicates that the Actuate design tool will not use changes that a user makes using the ODA design tool. To avoid frustrating users, the ODA design tool should not permit a user to make changes when you use the ReadOnly setting.

Page 467: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 445

S e s s i o n L o c a l e

Schema <xs:simpleType name="SessionEditMode" final="restriction"><xs:restriction base="xs:string">

<xs:enumeration value="Editable"/><xs:enumeration value="ReadOnly"/>

</xs:restriction></xs:simpleType>

SessionLocaleThe user locale on the client machine that hosts the design tool. For example, if the primary design tool runs in Japanese, the data source builder uses the Japanese locale in its design session. SessionLocale can differ from the default locale set in the design tool. Not all data source builders honor all locales. For definitions of the values for SessionLocale, see Working in Multiple Locales using Actuate Basic Technology.

Schema <xs:simpleType name="SessionLocale" final="restriction"><xs:restriction base="xs:string">

<xs:enumeration value="ar_AE"/><xs:enumeration value="ar_BH"/><xs:enumeration value="ar_DZ"/><xs:enumeration value="ar_EG"/><xs:enumeration value="ar_IQ"/><xs:enumeration value="ar_JO"/><xs:enumeration value="ar_KW"/><xs:enumeration value="ar_LB"/><xs:enumeration value="ar_LY"/><xs:enumeration value="ar_MA"/><xs:enumeration value="ar_OM"/><xs:enumeration value="ar_QA"/><xs:enumeration value="ar_SA"/><xs:enumeration value="ar_SY"/><xs:enumeration value="ar_TN"/><xs:enumeration value="ar_YE"/><xs:enumeration value="bg_BG"/><xs:enumeration value="cs_CZ"/><xs:enumeration value="da_DK"/><xs:enumeration value="de_AT"/><xs:enumeration value="de_CH"/><xs:enumeration value="de_DE"/><xs:enumeration value="de_LI"/><xs:enumeration value="el_GR"/><xs:enumeration value="en_AU"/><xs:enumeration value="en_BZ"/><xs:enumeration value="en_CA"/><xs:enumeration value="en_GB"/>

Page 468: Accessing Data

446 A c c e s s i n g D a t a

S e s s i o n L o c a l e

<xs:enumeration value="en_IE"/><xs:enumeration value="en_NZ"/><xs:enumeration value="en_US"/><xs:enumeration value="en_ZA"/><xs:enumeration value="es_ES"/><xs:enumeration value="es_MX"/><xs:enumeration value="et_EE"/><xs:enumeration value="fa_IR"/><xs:enumeration value="fi_FI"/><xs:enumeration value="fr_CA"/><xs:enumeration value="fr_CH"/><xs:enumeration value="fr_FR"/><xs:enumeration value="he_IL"/><xs:enumeration value="hr_HR"/><xs:enumeration value="hu_HU"/><xs:enumeration value="id_ID"/><xs:enumeration value="in_ID"/><xs:enumeration value="it_CH"/><xs:enumeration value="it_IT"/><xs:enumeration value="iw_IL"/><xs:enumeration value="ja_JP"/><xs:enumeration value="ko_KR"/><xs:enumeration value="lv_LV"/><xs:enumeration value="nl_BE"/><xs:enumeration value="nl_NL"/><xs:enumeration value="no_NO"/><xs:enumeration value="no_NY"/><xs:enumeration value="pl_PL"/><xs:enumeration value="pt_BR"/><xs:enumeration value="pt_PT"/><xs:enumeration value="ro_RO"/><xs:enumeration value="ru_RU"/><xs:enumeration value="sk_SK"/><xs:enumeration value="sl_SI"/><xs:enumeration value="sq_AL"/><xs:enumeration value="sr_YU"/><xs:enumeration value="sv_FI"/><xs:enumeration value="sv_SE"/><xs:enumeration value="th_TH"/><xs:enumeration value="tr_TR"/><xs:enumeration value="uk_UA"/><xs:enumeration value="zh_CN"/><xs:enumeration value="zh_HK"/><xs:enumeration value="zh_SG"/><xs:enumeration value="zh_TW"/>

</xs:restriction></xs:simpleType>

Page 469: Accessing Data

C h a p t e r 1 8 , C u s t o m d a t a d r i v e r X M L r e f e r e n c e 447

S t a t e I n f o

StateInfoThe state of the previous data source builder session

Schema <xs:complexType name="StateInfo"> <xs:choice>

<xs:element name="StateInfoString" type="xs:string"> </xs:element> <xs:element name="StateInfoBlob" type="xs:base64Binary"> </xs:element>

</xs:choice> </xs:complexType>

Elements StateInfoStringState information in String format

StateInfoBlobState information in binary format. Encode the string in base64 format. For more information about the base64 encoding scheme, see RFC 2045 at http://www.ietf.org/rfc/rfc2045.txt.

Page 470: Accessing Data

448 A c c e s s i n g D a t a

Page 471: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 449

C h a p t e r

19Chapter 19Custom data driver

Java referenceThis chapter contains the following topics:

■ About Java interfaces and Java classes for creating a custom data driver

■ Open data access Java reference

Page 472: Accessing Data

450 A c c e s s i n g D a t a

About Java interfaces and Java classes for creating a custom data driver

This chapter lists the Java interfaces and classes that implement run-time open data access (ODA) functionality. Use these interfaces and classes to create a custom driver.

The ODA run-time interface is modeled after JDBC so that its usage model is intuitive to a Java driver developer who is familiar with JDBC. The interface covers a subset of JDBC capabilities that suit reporting applications. The interface excludes JDBC features that are related to write and update operations, java.io stream processing, complex result set types and concurrency modes, and so on.

The ODA run-time interfaces support capabilities that are not defined in the JDBC model. The primary extended capabilities include:

■ Access to result sets by name.

■ Use of complex, non-scalar parameters, including the ability to use structure and table types as input and output parameters.

■ Support for any type of data source.

■ Support for using a statement with any query command text. This functionality is not limited to SQL statement syntax.

■ Using the same connection to create different types of data source-specific statements.

■ Assigning statement-specific properties before execution.

All ODA interface indexes are 1-based. Because Java data structures are typically 0-based, the ODA driver must be able to translate between 0-based and 1-based indexes.

The class that is the entry point to the ODA driver must implement the IDriver interface. Methods that are defined by this interface provide access to parameters, statements, and result sets. Actuate products use calls to IConnectionMetaData, IDataSourceMetaData, and IParameterMetaData methods to determine the functionality of the driver.

Each interface or class entry in this chapter includes a general description of the interface or class and a summary of its fields and methods. A detailed listing of methods for each interface or class includes the syntax, parameters, any return value, and whether the method throws an exception. Some methods are optional. If you do not want to implement an optional method, just declare the method, and throw the UnsupportedOperationException. The message of the UnsupportedOperationException should contain at least the name of the class

Page 473: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 451

and method to provide the context of the exception, as shown in the following example:

public class MyStatementClass extends IStatement{

public void setInt( int parameterId, int value ){

// is not supported by this Statement classthrow new UnsupportedOperationException"MyStatementClass.setInt( int parameterId,

int value )" );}

}

For an example of an ODA driver that includes the configuration file, data source builder, and run-time classes, see the open data access flat file example that is installed with Client Integration Technology in \Actuate10\ODA\Examples\Flat File Example.

Open data access Java referenceThis section provides an alphabetical list of the open data access Java interfaces and classes.

Page 474: Accessing Data

452 A c c e s s i n g D a t a

F i l e H a n d l e r

Class FileHandlerSyntax public class FileHandler extends StreamHandler

Description FileHandler is a class that publishes LogRecords to a specified file. LogManager.getLogger( ) sets a new FileHandler if the log directory has changed or the log file name has changed.

ConstructorsSyntax public FileHandler(java.lang.String filename)

Constructs a FileHandler object to publish LogRecords to the specified file. The LogRecords are formatted using the default SimpleFormatter class. Calling publish( ) creates the physical file and any applicable parent directories.

Parameters filenameThe file in which the LogRecords are published

Syntax public FileHandler(java.lang.String filename, LogFormatter formatter)

Constructs a FileHandler object to publish LogRecords to the specified, pre-existing file. The LogRecords are formatted using the specified LogFormatter. If the FileHandler instance exists, calling publish( ) creates the physical file and any applicable parent directories.

Parameters filenameThe file in which the LogRecords are published

formatterThe LogFormatter to use to format the LogRecords

Method summaryTable 19-1 lists the methods for class FileHandler.

Methods inherited from class com.actuate.oda.util.logging.StreamHandler

finalize, flush, isLoggable, setFormatter, setOutputStream

Table 19-1 Methods for Class FileHandler

Method Description

close( ) Closes the current FileHandler.

publish( ) Publishes a record. It also creates the log file and parent directories if they do not exist.

Page 475: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 453

F i l e H a n d l e r . c l o s e

Methods inherited from class com.actuate.oda.util.logging.Handler

getFilter, getFormatter, getLevel, getLoggingErrorHandler, reportError, setFilter, setLevel, setLogginErrorHandler

Methods inherited from class java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

FileHandler.closeSyntax public void close()

Closes the current FileHandler

FileHandler.publishSyntax public void publish(LogRecord record)

Publishes a record to the log file. If necessary, it creates the log file and parent directories before it publishes a record to the log file.

Parameters recordThe record to publish to the log file

Interface FilterSyntax public interface Filter

Description Use a Filter to provide more control over what is logged. Each Handler object can have an associated Filter. The Handler calls isLoggable( ) to check whether to publish a record.

Method summaryTable 19-2 describes the method for interface Filter.

Table 19-2 Method for interface Filter

Method Description

isLoggable( ) Checks whether the record should be published.

Page 476: Accessing Data

454 A c c e s s i n g D a t a

F i l t e r . i s L o g g a b l e

Filter.isLoggableSyntax public boolean isLoggable(LogRecord record)

Description Checks whether to publish the record

Parameters recordThe log record to check

Returns True if the log record should be published

Page 477: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 455

H a n d l e r

Class HandlerSyntax public abstract class Handler extends Object

Description Handler is an abstract class that obtains records from a Logger and outputs them to a specified destination. This class is inherited by all log handlers that publish records to a console, file, or other destinations. For example, StreamHandler inherits this class and publishes records to a stream.

ConstructorSyntax public Handler( )

Constructs a Handler.

Method summaryTable 19-3 lists the methods for class Handler.

Table 19-3 Methods for class Handler

Method Description

close( ) Closes the current Handler and frees resources

flush( ) Flushes the buffered output.

getFilter( ) Gets the Filter that is associated with this Handler.

getFormatter( ) Gets the LogFormatter that is associated with this Handler.

getLevel( ) Gets the Level that is associated with this Handler.

getLoggingErrorHandler( ) Gets the LoggingErrorHandler that is associated with this Handler.

isLoggable( ) Checks whether the specified record should be logged.

publish( ) Formats and publishes a record.

reportError( ) Reports an error to the that is associated LoggingErrorHandler.

setFilter( ) Sets the Filter to use for this Handler.

setFormatter( ) Sets the LogFormatter to use for this Handler.

setLevel( ) Sets the Level to use for this Handler.

setLoggingErrorHandler( ) Sets the LoggingErrorHandler to use for this Handler.

Page 478: Accessing Data

456 A c c e s s i n g D a t a

H a n d l e r . c l o s e

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Handler.closeSyntax public void close( )

Closes the current Handler

Handler.flushSyntax public abstract void flush( )

Flushes the buffered output

Handler.getFilterSyntax public Filter getFilter( )

Gets the Filter that is associated with this Handler

Returns The associated Filter instance

Handler.getFormatterSyntax public LogFormatter getFormatter( )

Gets the LogFormatter that is associated with this Handler

Returns The associated LogFormatter instance

Handler.getLevelSyntax public Level getLevel( )

Gets the log level set for the Handler. The log level limits the records that are published.

Returns The level instance for this Handler

Page 479: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 457

H a n d l e r . g e t L o g g i n g E r r o r H a n d l e r

Handler.getLoggingErrorHandlerSyntax public LoggingErrorHandler getLoggingErrorHandler( )

Gets the error handler that is associated with this Handler

Returns A LoggingErrorHandler instance

Handler.isLoggableSyntax public boolean isLoggable(LogRecord record)

Checks whether to log the specified record by determining that the record has a high enough log level, passes the associated Filter, and passes any other checks that the Handler specifies.

Parameters recordThe log record to check

Returns True to log the log record

Handler.publishSyntax public void publish(LogRecord record)

Publishes a record to the appropriate destination if it has a sufficiently high log level, and passes any associated Filter. Publish( ) also formats the record, if necessary.

Parameters recordThe log record to format and publish

Handler.reportErrorSyntax public void reportError(java.lang.String message, javal.lang.Exception exception,

int errorCode)

Reports an error to the associated LoggingErrorHandler

Parameters errorCodeThe error code of the error

exceptionThe exception that caused the error

Page 480: Accessing Data

458 A c c e s s i n g D a t a

H a n d l e r . s e t F i l t e r

messageThe error message

Handler.setFilterSyntax public void setFilter(Filter filter)

Sets the Filter for this Handler

Parameters filterThe filter to set

Handler.setFormatter Syntax public void setFormatter(LogFormatter formatter)

Sets the formatter that will format the log records

Parameters formatterThe formatter to set

Handler.setLevelSyntax public void setLevel(Level level)

Sets the log level to limit the records that this Handler publishes

Parameters levelThe log level to set

Handler.setLoggingErrorHandlerSyntax public void setLoggingErrorHandler(LoggingErrorHandler errorHandler)

Sets the LoggingErrorHandler for this Handler

Parameters errorHandlerThe error handler to use for this Handler

Interface IBlobSyntax public interface IBlob

Page 481: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 459

I B l o b . g e t B i n a r y S t r e a m

Description IBlob is an interface for processing a binary large object (BLOB) data value. You need to implement this interface only if your ODA driver supports the BLOB data type. The methods in this interface require getting a handle for the IBLOB object. If the BLOB is used in an ODA result set column, use IResultSet.getBlob( ) to obtain a handle for the IBLOB object. If the BLOB is used in an ODA output parameter, use ICallStatement.getBlob( ) to obtain a handle for the IBLOB object. A BLOB cannot be used as an ODA input parameter.

Method summaryTable 19-4 lists the methods for interface IBlob.

IBlob.getBinaryStreamSyntax public InputStream getBinaryStream( ) throws OdaException

Returns a handle to the entire BLOB value

Returns The contents of the BLOB as a Java input stream of uninterpreted bytes

Throws OdaException if a data source error occurs

IBlob.getBytesSyntax public byte[ ] getBytes( long position, int length ) throws OdaException

An optional method that returns part of the BLOB value, starting from the position that is indicated by the position parameter, and continuing for the number of bytes that the length parameter specifies. If the BLOB contains fewer bytes after the specified position than the number that the length parameter requires, getBytes( ) returns the BLOB value up to the end of the BLOB.

This method has a default implementation to provide this functionality when you do not implement this method explicitly. Consider implementing this method if you can optimize processing the BLOB based on your knowledge of the type of data that it contains.

Table 19-4 Methods for interface IBlob

Method Description

getBinaryStream( ) Returns the entire BLOB value as a Java input stream

getBytes( ) Returns a Java input stream that contains a part of the BLOB value, starting from the specified position in the BLOB and continuing for the specified number of bytes

length( ) Returns the number of bytes in the BLOB value

Page 482: Accessing Data

460 A c c e s s i n g D a t a

I B l o b . l e n g t h

Parameters lengthThe number of bytes to return. Using a negative value for length returns all bytes through the end of the BLOB.

positionThe position of the starting byte. The first byte in the BLOB is at position 1.

Returns A Java byte array that contains a specific part of the contents of the BLOB that is identified by its position

Throws OdaException if a data source error occurs.

IBlob.lengthSyntax public long length( ) throws OdaException

An optional method that returns the number of bytes in a BLOB

Returns The number of bytes in a BLOB

Throws OdaException if a data source error occurs

Interface IClobSyntax public interface IClob

Description IClob is an interface for processing a character large object (CLOB) data value. You need to implement this interface only if your ODA driver supports the CLOB data type. The methods in this interface require getting a handle for the ICLOB object. If the CLOB is used in an ODA result set column, use IResultSet.getClob( ) to obtain a handle for the ICLOB object. If the CLOB is used in an ODA output parameter, use ICallStatement.getClob( ) to obtain a handle for the ICLOB object. A CLOB cannot be used as an ODA input parameter.

Method summaryTable 19-5 lists the methods for interface IClob.

Table 19-5 Methods for interface IClob

Method Description

getCharacterStream( ) Returns the entire CLOB value as a Java input stream

getSubString( ) Returns a String that contains part of the CLOB value

length( ) Returns the number of characters in the CLOB value

Page 483: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 461

I C l o b . g e t C h a r a c t e r S t r e a m

IClob.getCharacterStreamSyntax public Reader getCharacterStream( ) throws OdaException

Returns a handle to the value of the entire CLOB

Returns A java.io.Reader object that contains the CLOB value

Throws OdaException if a data source error occurs

IClob.getSubStringSyntax public String getSubString( long position, int length ) throws OdaException

An optional method that returns the part of the CLOB value, starting from the position that is indicated by the position parameter, and continuing for the number of characters that the length parameter specifies. If the CLOB contains fewer characters after the specified position than the number that the length parameter specifies, getSubString( ) returns the CLOB value through the end of the CLOB.

This method has a default implementation to provide this functionality when you do not implement this method explicitly. Consider implementing this method if you can optimize processing the CLOB based on your knowledge of the type of data that it contains.

Parameters lengthThe number of characters to return. Using a negative value for length returns all characters through the end of the CLOB.

positionThe position of the starting character. The first character in the CLOB is at position 1.

Returns A string that contains part of the CLOB value

Throws OdaException if a data source error occurs

IClob.lengthSyntax public long length( ) throws OdaException

An optional method that returns the number of characters in a CLOB

Returns The number of characters in a CLOB

Throws OdaException if a data source error occurs

Page 484: Accessing Data

462 A c c e s s i n g D a t a

I C a l l S t a t e m e n t

Interface ICallStatementSyntax public interface ICallStatement extends IStatement

Description ICallStatement is an interface for callable statements. ICallStatement implements the mandatory methods that it inherits from IStatement, except executeQuery( ). ICallStatement is required only if the ODA driver supports:

■ Accessing result sets by name

■ Using complex input or output parameters

All callable statement implementations, such as stored procedures and R/3 BAPIs, implement this interface.

Call ICallStatement interface methods only after calling IStatement.prepare( ).

Method summaryTable 19-6 lists the methods for interface ICallStatement.

Table 19-6 Methods for interface ICallStatement

Method Description

findOutParameter( ) Returns the 1-based index of the specified output scalar or structure parameter.

getBigDecimal( ) Returns the decimal value from the specified output parameter.

getBlob( ) Returns the BLOB value from the specified output parameter.

getClob( ) Returns the CLOB value from the specified output parameter.

getDate( ) Returns the java.sql.Date value from the specified output parameter.

getDouble( ) Returns the double value from the specified output parameter.

getInt( ) Returns the integer value from the specified output parameter.

getMetaDataOf( ) Returns the metadata of the specified result.

getResultSet( ) A mandatory method that returns the named result as an IResultSet object instance or returns null.

getResultSetNames( ) An optional method that returns the names of result sets that this ICallStatement can return.

Page 485: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 463

I C a l l S t a t e m e n t . f i n d O u t P a r a m e t e r

Methods inherited from interface com.actuate.oda.IStatement

close, execute, execute, executeQuery, executeQuery, findInParameter, getMaxRows, getMetaData, getMetaData, getMoreResults, getParameterMetaData, getParameterType, getParameterType, getResultSet, getSortSpec, prepare, setBigDecimal, setBigDecimal, setDate, setDate, setDouble, setDouble, setInt, setInt, setMaxRows, setProperty, setPropertyInfo, setSortSpec, setString, setString, setTime, setTime, setTimestamp

ICallStatement.findOutParameterSyntax public int findOutParameter(java.lang.String parameterName)

throws OdaException

getRow( ) An optional method that returns the structure value from the specified output parameter.

getSortSpec( ) Returns the associated SortSpec instance specifying how to sort the result set columns.

getString( ) Returns the String value from the specified output parameter.

(continues)

getTime( ) Returns the java.sql.Time value from the specified output parameter.

getTimestamp( ) Returns the java.sql.Timestamp value from the specified output parameter.

setNewRow( ) An optional method that returns an instance of IRowSet that represents the specified single row input parameter.

setNewRowSet( ) An optional method that returns an instance of IRowSet that represents the specified table input parameter.

setSortSpec( ) Specifies the SortSpec instance to determine sorting of the result set columns.

wasNull( ) Specifies whether the last output parameter a get method reads is null.

Table 19-6 Methods for interface ICallStatement (continued)

Method Description

Page 486: Accessing Data

464 A c c e s s i n g D a t a

I C a l l S t a t e m e n t . g e t B i g D e c i m a l

Returns the 1-based index of the specified output scalar or structure parameter. Implement this method when the driver supports output parameters and named parameters.

Parameters parameterNameThe name of the output parameter

Returns The index of the output parameter

Throws OdaException if a data source error occurs

ICallStatement.getBigDecimalSyntax public BigDecimal getBigDecimal(int parameterId) throws OdaException

Returns the decimal value from the output parameter at the specified position

Parameters parameterIdThe 1-based index position of the parameter

Returns The decimal value

Throws OdaException if a data source error occurs

Syntax public BigDecimal getBigDecimal(java.lang.String parameterName) throws OdaException

Returns the decimal value from the output parameter with the specified name

Parameters parameterNameName of the parameter

Returns The decimal value

Throws OdaException if a data source error occurs

ICallStatement.getBlobSyntax public IBlob getIBlob(int index) throws OdaException

Returns BLOB value in an output parameter, using the parameter position to identify the desired parameter. After using ICallStatement.getBlob( ), an ODA driver must keep the IBLOB object and the BLOB’s data accessible until the driver closes the result set.

Parameters parameterIdThe 1-based index of the parameter

Returns The BLOB value. Returns null if the parameter has a null value.

Throws OdaException if a data source error occurs

Page 487: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 465

I C a l l S t a t e m e n t . g e t C l o b

Syntax public IBlob getIBlob(java.lang.String columnName) throws OdaException

Returns the BLOB value in an output parameter, using the parameter name to identify the desired parameter. After using ICallStatement.getBlob( ), an ODA driver must keep the IBLOB object and the BLOB’s data accessible until the driver closes the result set.

Parameters parameterNameName of the parameter

Returns The BLOB value. Returns null if the parameter has a null value.

Throws OdaException if a data source error occurs

ICallStatement.getClobSyntax public IClob getIClob(int index) throws OdaException

Returns CLOB value in an output parameter, using the parameter position to identify the desired parameter. After using ICallStatement.getClob( ), an ODA driver must keep the ICLOB object and the CLOB’s data accessible until the driver closes the result set.

Parameters parameterIdThe 1-based index of the parameter

Returns The CLOB that represents the value. Returns null if the parameter has a null value.

Throws OdaException if a data source error occurs

Syntax public IClob getIClob(java.lang.String columnName) throws OdaException

Returns CLOB value in an output parameter, using the parameter name to identify the desired parameter. After using ICallStatement.getClob( ), an ODA driver must keep the ICLOB object and the CLOB’s data accessible until the driver closes the result set.

Parameters parameterNameName of the parameter

Returns The CLOB value. Returns null if the parameter has a null value.

Throws OdaException if a data source error occurs

ICallStatement.getDateSyntax public java.sql.Date getDate(java.lang.String parameterName)

throws OdaException

Page 488: Accessing Data

466 A c c e s s i n g D a t a

I C a l l S t a t e m e n t . g e t D o u b l e

Returns the java.sql.Date value for a named output parameter. Implement this method when the driver supports output parameters, named parameters, and the Date data type.

Parameters parameterNameThe name of the parameter

Returns The java.sql.Date value of the named parameter

Throws OdaException if a data source error occurs

Syntax public Date getDate(int parameterId)throws OdaException

Returns the java.sql.Date value of an output parameter that is identified by index. Implement this method when the driver supports output parameters and the Date data type.

Parameters parameterIdThe 1-based index of the parameter

Returns The java.sql.Date value of the parameter

Throws OdaException if a data source error occurs

ICallStatement.getDoubleSyntax public double getDouble(java.lang.String parameterName)

throws OdaException

Returns the double value of a named output parameter. Implement this method when the driver supports output parameters, named parameters, and the Double data type.

Parameters parameterNameThe name of the output parameter

Returns The double value

Throws OdaException if a data source error occurs

Syntax public double getDouble(int parameterId)throws OdaException

Returns the double value for an output parameter that is identified by index. Implement this method when the driver supports output parameters and the double data type.

Parameters parameterId The 1-based index of the parameter

Returns The double value

Throws OdaException if a data source error occurs

Page 489: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 467

I C a l l S t a t e m e n t . g e t I n t

ICallStatement.getIntSyntax public int getInt(java.lang.String parameterName)

throws OdaException

Returns the integer of an output parameter that is identified by name. Implement this method when the driver supports output parameters, named parameters, and the integer data type.

Parameters parameterNameThe name of the parameter

Returns The integer value

Throws OdaException if a data source error occurs

Syntax public int getInt(int parameterId)throws OdaException

Returns the integer value of an output parameter that is identified by index. Implement this method when the driver supports output parameters and the integer data type.

Parameters parameterId The 1-based index of the parameter

Returns The integer value

Throws OdaException if a data source error occurs

ICallStatement.getMetaDataOfSyntax public IResultSetMetaData getMetaDataOf(String resultSetName)

throws OdaException

Returns an instance of IResultSetMetaData. Implement this method when the driver supports named result sets.

Parameters resultSetName The name of the result set

Returns The metadata of the specified result

Throws OdaException if a data source error occurs

ICallStatement.getResultSetSyntax public com.actuate.oda.IResultSet getResultSet(java.lang.String resultSetName)

throws OdaException

Page 490: Accessing Data

468 A c c e s s i n g D a t a

I C a l l S t a t e m e n t . g e t R e s u l t S e t N a m e s

Returns the specified result as an IResultSet object instance, or returns null. Call this method once for each result set.

Parameters resultSetNameThe name of the target result set

Returns An IResultSet object instance or null

Throws OdaException if a data source error occurs

ICallStatement.getResultSetNamesSyntax public java.lang.String[] getResultSetNames( )

throws OdaException

An optional method that returns the names of result sets that the current ICallStatement can return

Returns An array of result set names

Throws OdaException if a data source error occurs

ICallStatement.getRowSyntax public com.actuate.oda.IRowSet getRow(java.lang.String parameterName)

throws OdaException

An optional method that returns the structure value from an output parameter that is identified by name. Does not return table structures. Implement this method when the driver supports named complex output parameters.

Parameters parameterNameThe name of the output parameter

Returns The structure value

Throws OdaException if a data source error occurs

Syntax public com.actuate.oda.IRowSet getRow(int parameterId)throws OdaException

An optional method that returns the structure value from an output parameter that is identified by index. Does not return table structures. Implement this method when the driver supports complex output parameters.

Parameters parameterIdThe 1-based index of the parameter

Returns The structure value

Throws OdaException if data source error occurs

Page 491: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 469

I C a l l S t a t e m e n t . g e t S o r t S p e c

ICallStatement.getSortSpecSyntax public SortSpec getSortSpec(java.lang.String resultSetName) throws

OdaException

Returns the associated SortSpec instance that specifies how to sort the result set columns

Parameters resultSetNameThe name of the result set

Returns The SortSpec that is associated with the specified result set or null if no SortSpec is associated

Throws OdaException if a data source error occurs

ICallStatement.getStringSyntax public java.lang.String getString(java.lang.String parameterName)

throws OdaException

Returns the String value from an output parameter that is identified by name. You can implement this method to return the String representation of a non-String type parameter. The format of the returned string is implementation-dependent. Implement this method when the driver supports output parameters, named parameters, and the String data type.

Parameters parameterNameThe name of the parameter

Returns The String value

Throws OdaException if data source error occurs

Syntax public java.lang.String getString(int parameterId) throws OdaException

Returns the String value from an output parameter that is identified by index. You can use this method to return the String representation of a non-String type parameter. The format of the returned string is implementation-dependent. Implement this method when the driver supports output parameters and the String data type.

Parameters parameterIdThe 1-based index of the parameter

Returns The String value of the specified output parameter

Throws OdaException if a data source error occurs

Page 492: Accessing Data

470 A c c e s s i n g D a t a

I C a l l S t a t e m e n t . g e t T i m e

ICallStatement.getTimeSyntax public java.sql.Time getTime(java.lang.String parameterName)

throws OdaException

Returns the java.sql.Time value for an output parameter that is identified by name. Implement this method when the driver supports output parameters, named parameters, and the Time data type.

Parameters parameterNameThe name of the parameter

Returns The Time value of the parameter

Throws OdaException if a data source error occurs

Syntax public java.sql.Time getTime(int parameterId)throws OdaException

Returns the java.sql.Time value for an output parameter that is identified by index. Implement this method when the driver supports output parameters and the Time data type.

parameterIdThe 1-based index of the parameter

Returns The Time value of the parameter

Throws OdaException if a data source error occurs

ICallStatement.getTimestampSyntax public java.sql.Timestamp getTimestamp(java.lang.String parameterName)

throws OdaException

Returns the java.sql.Timestamp value for an output parameter that is identified by name. Implement this method when the driver supports output parameters, named parameters, and the Timestamp data type.

Parameters parameterNameThe name of the parameter

Returns The Timestamp value

Throws OdaException if data source error occurs

Syntax public java.sql.Timestamp getTimestamp(int parameterId)throws OdaException

Page 493: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 471

I C a l l S t a t e m e n t . s e t N e w R o w

Returns the java.sql.Timestamp value for an output parameter that is identified by index. Implement this method when the driver supports output parameters and the Timestamp data type.

Parameters parameterIdThe 1-based index of the parameter

Returns The Timestamp value

Throws OdaException if a data source error occurs

ICallStatement.setNewRowSyntax public com.actuate.oda.IRowSet setNewRow(java.lang.String parameterName)

throws OdaException

An optional method that returns an instance of IRowSet that represents the specified single row input parameter. Implement this method when the driver supports named complex input parameters. The client calls the IRowSet setter methods to populate the input parameter. For example:

IRowSet myStruct = myStatement.setNewRow( "MyStructureName” );myStruct.next();myStruct.setString( 1, "myValue” );

Parameters parameterNameThe name of the input parameter

Returns An IRowSet instance

Throws OdaException if data source error occurs

Syntax public com.actuate.oda.IRowSet setNewRow(int parameterId)throws OdaException

An optional method that returns an instance of IRowSet that represents the specified single row input parameter. Implement this method when the driver supports complex input parameters. The client calls the IRowSet setter methods to populate the input parameter. For example:

IRowSet myStruct = myStatement.setNewRow( 1 );myStruct.next();myStruct.setString( 1, “myValue” );

Parameters parameterIdThe 1-based index of the parameter

Returns An instance of IRowSet

Throws OdaException if a data source error occurs

Page 494: Accessing Data

472 A c c e s s i n g D a t a

I C a l l S t a t e m e n t . s e t N e w R o w S e t

ICallStatement.setNewRowSetSyntax public com.actuate.oda.IRowSet setNewRowSet(java.lang.String

parameterName) throws OdaException

An optional method that returns an instance of IRowSet that represents the specified table input parameter. Implement this method when the driver supports named complex input parameters. The client calls the IRowSet setter methods to populate the input parameter. For example:

IRowSet myTable = myStatement.setNewRowSet( “MyStructureName” );myTable.add( );myTable.setString( 1, “myValue1” );myTable.add( );myTable.setString( 1, “myValue2” );

Parameters parameterNameThe name of the parameter

Returns An IRowSet instance

Throws OdaException if a data source error occurs

Syntax public com.actuate.oda.IRowSet setNewRowSet(int parameterId)throws OdaException

An optional method that returns an instance of IRowSet that represents the specified table input parameter. Implement this method when the driver supports complex input parameters. The client calls the IRowSet setter methods to populate the input parameter. For example:

IRowSet myTable = myStatement.setNewRowSet( 1 );myTable.add();myTable.setString( 1, “myValue1” );myTable.add();myTable.setString( 1, “myValue2” );

Parameters parameterIdThe 1-based index of the parameter

Returns An instance of IRowSet

Throws OdaException if a data source error occurs

ICallStatement.setSortSpecSyntax public void setSortSpec(java.lang.String resultSetName, SortSpec sortBy) throws

OdaException

Page 495: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 473

I C a l l S t a t e m e n t . w a s N u l l

Associates the specified SortSpec instance with the specified result set columns to indicate how to sort the result set. Calling setSortSpec( ) with a null argument clears the previously associated SortSpec. If no sort specification is set, then the rows of a result set have an implementation-specific ordering, and the getSortSpec( ) method returns null.

Parameters resultSetNameThe name of the result set

sortByThe SortSpec instance to associate

Throws OdaException if the specified sort specification is not valid or is not supported by the driver

ICallStatement.wasNullSyntax public boolean wasNull( ) throws OdaException

Indicates whether the value of the last output parameter a getter method read is null. Implement this method when the driver supports output parameters. In each getter method, set any data structures used by wasNull( ).

Returns True if the last call to a get method is null

Throws OdaException if a data source error occurs

Interface IConnectionSyntax public interface IConnection

Description Defines the connection interface. This interface provides access to the rest of the open data access framework. Some IDataSourceMetaData methods, such as getDataSourceObjects( ), expect or require an open connection.

Method summaryTable 19-7 lists the methods for interface IConnection.

Table 19-7 Methods for interface IConnection

Method Description

close( ) A mandatory method that closes the connection.

(continues)

Page 496: Accessing Data

474 A c c e s s i n g D a t a

I C o n n e c t i o n . c l o s e

IConnection.closeSyntax public void close( ) throws OdaException

A mandatory method that closes the connection

Throws OdaException if a data source error occurs

IConnection.commitSyntax public void commit( ) throws OdaException

An optional method that makes permanent all changes that were implemented since the previous commit or roll-back. Use this method if the driver can manage transactions.

Throws OdaException if a data source error occurs

commit( ) An optional method that makes permanent all changes that have been implemented since the previous commit or roll-back.

createStatement( ) A mandatory method that returns an IStatement instance that is based on the data source type.

getMetaData( ) A mandatory method that returns an instance of IConnectionMetaData that contains information about the capabilities of this driver. Alternatively, this method returns an instance of IDataSourceMetaData that is based on the data source type.

isOpened( ) A mandatory method that verifies that the connection is open.

open( ) A mandatory method that establishes a connection that is based on specified connection properties.

rollback( ) An optional method that undoes all changes that were made since the previous commit or rollback.

Table 19-7 Methods for interface IConnection (continued)

Method Description

Page 497: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 475

I C o n n e c t i o n . c r e a t e S t a t e m e n t

IConnection.createStatementSyntax public com.actuate.oda.IStatement createStatement(java.lang.String

dataSourceType) throws OdaException

A mandatory method that returns an IStatement instance that is based on the data source type. The data source type is implementation-dependent. For example, the valid data source type for SAP MDX is MDX.

Parameters dataSourceTypeA String representation of the class of the data source type

Returns An IStatement object instance

Throws OdaException if a data source error occurs

IConnection.getMetaDataSyntax public com.actuate.oda.IConnectionMetaData getMetaData( )

throws OdaException

A mandatory method that returns an instance of IConnectionMetaData that contains information about the capabilities of the driver. Can be called before opening the connection.

Returns An IConnectionMetaData object instance

Throws OdaException if a data source error occurs

Syntax public com.actuate.oda.IDataSourceMetaData getMetaData(java.lang.String dataSourceType) throws OdaException

A mandatory method that returns an instance of IDataSourceMetaData that is based on the data source type. The data source type is implementation-dependent. For example, the valid data source type for SAP ODS is ODS. Can be called before opening the connection.

Parameters dataSourceTypeString representation of the class of the data source type

Returns An IDataSourceMetaData object instance

Throws OdaException if a data source error occurs

IConnection.isOpenedSyntax public boolean isOpened( ) throws OdaException

Page 498: Accessing Data

476 A c c e s s i n g D a t a

I C o n n e c t i o n . o p e n

A mandatory method that verifies that a connection has been established. Can be called before calling IConnection.open. If isOpened( ) depends on objects that open( ) instantiates, isOpened( ) should verify that those objects are instantiated.

Returns True if a connection is established

Throws OdaException if a data source error occurs

IConnection.openSyntax public void open(java.util.Properties connProperties) throws OdaException

A mandatory method that establishes a connection that is based on specified connection properties

Parameters connPropertiesThe properties that are necessary to establish a connection

Throws OdaException if a data source error occurs

IConnection.rollbackSyntax public void rollback( ) throws OdaException

An optional method that undoes all changes that were implemented since the previous commit or rollback. Use this method if the driver can manage transactions.

Throws OdaException if a data source error occurs

Interface IConnectionFactorySyntax public interface IConnectionFactory

Description IConnectionFactory is the interface from which all connection factory implementations derive.

Method summary

Page 499: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 477

I C o n n e c t i o n F a c t o r y . g e t C o n n e c t i o n

Table 19-8 lists the methods for interface IConnectionFactory.

IConnectionFactory.getConnectionSyntax public com.actuate.oda.IConnection getConnection(java.lang.String

connectionClassName) throws OdaException

A mandatory method that returns an IConnection object that can establish a connection to the target object. The specified connection is the fully qualified class name of the connection class.

Parameters connectionClassNameAn optional String that represents the class name of the IConnection. A null or empty String returns the default IConnection object for the IConnectionFactory.

Returns An instance of IConnection

Throws OdaException if a data source error occurs

See also IConnection

IConnectionFactory.setLogConfigurationSyntax public void setLogConfiguration(int logLevel, java.lang.String logDirectory,

java.lang.String logPrefix, java.lang.String formatterClassName) throws OdaException

Sets the logging configuration of the ODA run-time driver. An ODA driver can handle the logging configuration internally or use the ODA logging classes and interface in the com.actuate.oda.util.logging package.

Parameters formatterClassNameThe fully qualified class name of a LogFormatter implementation class

logDirectoryThe absolute path of the log directory

Table 19-8 Methods for interface IConnectionFactory

Method Description

getConnection( ) A mandatory method that returns an IConnection object that can establish a connection to the target system.

setLogConfiguration( ) Sets the logging configuration for the ODA run-time driver.

Page 500: Accessing Data

478 A c c e s s i n g D a t a

I C o n n e c t i o n M e t a D a t a

logLevelThe minimum level of log records to publish

logPrefixThe prefix to use in the log-file name

Throws OdaException if an ODA driver error occurs

See also LogManager.createLogger( )

Interface IConnectionMetaDataSyntax public interface IConnectionMetaData

Description Comprehensive information about the connection.

The features that a connection supports depends on the driver that works with it. In addition, a driver can implement a feature that the connection does not offer. An ODA driver implements IConnectionMetaData to describe the connection and the driver to the Actuate design tool. For example, IConnectionMetaData describes the maximum number of connections that the driver can support and the maximum number of statements that the driver can support for a data source type. The data provider must ensure that IConnectionMetaData matches the capabilities of the driver. An IConnectionMetaData method throws OdaException if it gets information about a feature that the driver does not support.

All IConnectionMetaData methods can be called before the connection is open.

Method summaryTable 19-9 lists the methods for interface IConnectionMetaData.

Table 19-9 Methods for interface IConnectionMetaData

Method Description

getConnection( ) A mandatory method that returns the connection that produced this metadata object.

getDriverMajorVersion( ) A mandatory method that returns the major version number of this ODA driver.

getDriverMinorVersion( ) A mandatory method that returns the minor version number of this ODA driver.

getDriverName( ) A mandatory method that returns the name of this ODA driver.

getDriverVersion( ) A mandatory method that returns the version number of this ODA driver as a String.

Page 501: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 479

I C o n n e c t i o n M e t a D a t a . g e t C o n n e c t i o n

IConnectionMetaData.getConnectionSyntax public com.actuate.oda.IConnection getConnection( ) throws OdaException

A mandatory method that returns the connection that produced this metadata object

Returns The connection that produced this metadata object

Throws OdaException if a data source error occurs

IConnectionMetaData.getDriverMajorVersionSyntax public int getDriverMajorVersion( )

A mandatory method that returns this ODA driver’s major version number

Returns The ODA driver’s major version number

IConnectionMetaData.getDriverMinorVersionSyntax public int getDriverMinorVersion( )

A mandatory method that returns this ODA driver’s minor version number

Returns The ODA driver’s minor version number

getMaxConnections( ) A mandatory method that returns the maximum number of active connections that the driver can support.

getMaxStatements( ) A mandatory method that returns the maximum number of active statements for any data source types that the driver can support for this connection.

getOdaMajorVersion( ) A mandatory method that returns the major version number of the ODA interface that this driver supports.

getOdaMinorVersion( ) A mandatory method that returns the minor version number of the ODA interface that this driver supports.

Table 19-9 Methods for interface IConnectionMetaData (continued)

Method Description

Page 502: Accessing Data

480 A c c e s s i n g D a t a

I C o n n e c t i o n M e t a D a t a . g e t D r i v e r N a m e

IConnectionMetaData.getDriverNameSyntax public java.lang.String getDriverName( ) throws OdaException

A mandatory method that returns the name of this ODA driver

Returns The ODA driver’s name

Throws OdaException if a data source error occurs

IConnectionMetaData.getDriverVersionSyntax public java.lang.String getDriverVersion( ) throws OdaException

A mandatory method that returns the version number of this ODA driver as a String

Returns The ODA driver’s version number

Throws OdaException if a data source error occurs

IConnectionMetaData.getMaxConnectionsSyntax public int getMaxConnections( ) throws OdaException

A mandatory method that returns the maximum number of active connections that the driver can support

Returns The maximum number of connections of any type that can be open concurrently. Returns 0 if there is no limit or the limit is unknown.

Throws OdaException if a data source error occurs

IConnectionMetaData.getMaxStatementsSyntax public int getMaxStatements( ) throws OdaException

A mandatory method that returns the maximum number of active statements of data source types that the driver can support for this connection

Returns The maximum number of any type of statements that can be prepared and executed concurrently. Returns 0 if there is no limit or the limit is unknown.

Throws OdaException if a data source error occurs

Page 503: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 481

I C o n n e c t i o n M e t a D a t a . g e t O d a M a j o r V e r s i o n

IConnectionMetaData.getOdaMajorVersionSyntax public int getOdaMajorVersion( ) throws OdaException

A mandatory method that returns the major version number of the ODA interface that this driver supports

Returns The major version number for the ODA interface

Throws OdaException if a data source error occurs

IConnectionMetaData.getOdaMinorVersionSyntax public int getOdaMinorVersion( ) throws OdaException

A mandatory method that returns the minor version number of the ODA interface that this driver supports

Returns The minor version number for the ODA interface

Throws OdaException if a data source error occurs

Interface IDataSourceMetaDataSyntax public interface IDataSourceMetaData

Description Comprehensive information about the data source.

Data source metadata describes the features that a data source supports. A driver can also implement a feature the underlying data source does not offer. The methods in IDataSourceMetaData return information about the capabilities of a specified driver and a specified data source. For example, IDataSourceMetaData can indicate whether the data source supports getting multiple IResultSet objects from a single call to the method IStatement.execute( ) or whether the data source supports input or output parameters. Ensure that IDataSourceMetaData matches the capabilities of the driver. An IDataSourceMetaData method throws OdaException if it gets information about a feature that the driver does not support.

Page 504: Accessing Data

482 A c c e s s i n g D a t a

I D a t a S o u r c e M e t a D a t a

Some IDataSourceMetaData methods are callable before the connection is open. Other methods require an open connection. For example:

IDataSourceMetaData metadata = connection.getMetaData( ... ); metadata.supportsInParameters();connection.open(); // connection is not opened metadata.getDataSourceObjects( ... );

// requires an open connection

Field summaryTable 19-10 lists the fields for interface IDataSourceMetaData.

Method summaryTable 19-11 lists the methods for interface IDataSourceMetaData.

Table 19-10 Fields for interface IDataSourceMetaData

Field Description

public static final int sortModeColumnOrder

A constant that indicates that each sorted column can have a different sort order.

public static final int sortModeNone

A constant that indicates that dynamic sorting is not supported.

public static final int sortModeSingleColumn

A constant that indicates that only one column can be sorted.

public static final int sortModeSingleOrder

A constant that indicates that all sorted columns must be in the same sort order.

public static final int sqlStateSQL99

A constant that indicates that OdaException.getSQLState returns a SQL99 SQLSTATE value.

public static final int sqlStateXOpen

A constant that indicates that OdaException.getSQLState returns an X/Open SQL CLI SQLSTATE value.

Table 19-11 Methods for interface IDataSourceMetaData

Method Description

getConnection( ) A mandatory method that returns the connection that produced this metadata object.

getDataSourceMajorVersion( )

A mandatory method that returns the major version number of the data source.

Page 505: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 483

I D a t a S o u r c e M e t a D a t a . g e t C o n n e c t i o n

IDataSourceMetaData.getConnectionSyntax public com.actuate.oda.IConnection getConnection( ) throws OdaException

getDataSourceMinorVersion( )

A mandatory method that returns the minor version number of the data source.

getDataSourceObjects( )

An optional method that returns the collection of objects in a data source catalog.

getDataSourceProductName( )

Returns the name of this data source product. Mandatory.

getDataSourceProductVersion( )

A mandatory method that returns the version number of this data source product as a String.

getSortMode( ) A mandatory method that returns the type of sorting that the data source supports.

getSQLStateType( ) Indicates whether the SQLSTATE that OdaException.getSQLState( ) returns is X/Open SQL CLI or SQL99. Mandatory.

supportsInParameters( )

A mandatory method that indicates whether the data source supports input parameters to IStatement.

supportsMultipleOpenResults( )

A mandatory method that indicates whether the data source supports returning multiple IResultSet objects simultaneously from an ICallStatement object.

supportsMultipleResultSets( )

A mandatory method that indicates whether the data source supports getting multiple IResultSet objects from a single call to the method IStatement.execute( ).

supportsNamedParameters( )

A mandatory method that indicates whether the data source supports specified parameters of IStatement by name.

supportsNamedResultSets( )

A mandatory method that indicates whether this data source supports getting one or more IResultSet objects by name.

supportsOutParameters( )

A mandatory method that indicates whether this data source supports output parameters to ICallStatement.

Table 19-11 Methods for interface IDataSourceMetaData (continued)

Method Description

Page 506: Accessing Data

484 A c c e s s i n g D a t a

I D a t a S o u r c e M e t a D a t a . g e t D a t a S o u r c e M a j o r V e r s i o n

A mandatory method that returns the connection that produced this metadata object

Returns The connection that produced this metadata object

Throws OdaException if a data source error occurs

IDataSourceMetaData.getDataSourceMajorVersionSyntax public int getDataSourceMajorVersion( ) throws OdaException

A mandatory method that returns the major version number of the underlying data source

Returns The major version number of the data source

Throws OdaException if a data source error occurs

IDataSourceMetaData.getDataSourceMinorVersionSyntax public int getDataSourceMinorVersion( ) throws OdaException

A mandatory method that returns the minor version number of the underlying data source

Returns The minor version number of the data source

Throws OdaException if a data source error occurs

IDataSourceMetaData.getDataSourceObjectsSyntax public com.actuate.oda.IResultSet getDataSourceObjects(java.lang.String

catalog, java.lang.String schema, java.lang.String object, java.lang.String version) throws OdaException

An optional method that returns the collection of objects that are in a data source catalog. Valid arguments to this method are implementation-dependent. Each driver must define the metadata for the IResultSet that is returned. Using driver-specific classes and methods, a driver can extend the metadata that is returned.

Parameters catalogThe data source object catalog

objectThe search pattern for the data source object name

Page 507: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 485

I D a t a S o u r c e M e t a D a t a . g e t D a t a S o u r c e P r o d u c t N a m e

schemaThe search pattern for the schema or owner name of the data source object. Can be empty if it does not apply to the connected data source.

versionThe data source object version

Returns An IResultSet instance of the data source objects

Throws OdaException if a data source error occurs

IDataSourceMetaData.getDataSourceProductNameSyntax public java.lang.String getDataSourceProductName( ) throws OdaException

A mandatory method that returns the name of the data source product

Returns The data source product’s name

Throws OdaException if a data source error occurs

IDataSourceMetaData.getDataSourceProductVersion

Syntax public java.lang.String getDataSourceProductVersion( ) throws OdaException

A mandatory method that returns the version number of the data source product as a String

Returns The version number of the data source

Throws OdaException if a data source error occurs

IDataSourceMetaData.getSortModeSyntax public int getSortMode( )

Returns the sort mode that this data source supports. The sort mode is one of the following constants:

■ sortModeColumnOrder

■ sortModeNone

■ sortModeSingleColumn

■ sortModeSingleOrder

Page 508: Accessing Data

486 A c c e s s i n g D a t a

I D a t a S o u r c e M e t a D a t a . g e t S Q L S t a t e T y p e

Returns An integer that indicates which sort mode the data source supports

See also Class SortSpec

IDataSourceMetaData.getSQLStateTypeSyntax public int getSQLStateType( ) throws OdaException

A mandatory method that indicates whether the SQLSTATE that OdaException.getSQLState( ) returns is X/Open SQL CLI or SQL99

Returns The type of SQLSTATE, which is either sqlStateXOpen or sqlStateSQL99

Throws OdaException if a data source error occurs

IDataSourceMetaData.supportsInParametersSyntax public boolean supportsInParameters( ) throws OdaException

A mandatory method that indicates whether the data source supports input parameters to IStatement

Returns True if the data source supports input parameters

Throws OdaException if a data source error occurs

IDataSourceMetaData.supportsMultipleOpenResults

Syntax public boolean supportsMultipleOpenResults( ) throws OdaException

A mandatory method that indicates whether the data source supports returning multiple IResultSet objects simultaneously from an ICallStatement object

Returns True if an ICallStatement object can return multiple IResultSet objects simultaneously

Throws OdaException if a data source error occurs

IDataSourceMetaData.supportsMultipleResultSetsSyntax public boolean supportsMultipleResultSets( ) throws OdaException

A mandatory method that indicates whether the data source supports getting multiple IResultSet objects from a single call to IStatement.execute( )

Page 509: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 487

I D a t a S o u r c e M e t a D a t a . s u p p o r t s N a m e d P a r a m e t e r s

Returns True if a single call to IStatement.execute( ) can get multiple IResultSet objects

Throws OdaException if a data source error occurs

IDataSourceMetaData.supportsNamedParametersSyntax public boolean supportsNamedParameters( ) throws OdaException

A mandatory method that indicates whether the data source supports named parameters to IStatement

Returns True if the data source supports named parameters

Throws OdaException if a data source error occurs

IDataSourceMetaData.supportsNamedResultSetsSyntax public boolean supportsNamedResultSets( ) throws OdaException

A mandatory method that indicates whether the data source supports getting one or more IResultSet objects by name

Returns True if the data source supports getting one or more IResultSet objects by name

Throws OdaException if a data source error occurs

IDataSourceMetaData.supportsOutParametersSyntax public boolean supportsOutParameters( ) throws OdaException

A mandatory method that indicates whether the data source supports output parameters to ICallStatement

Returns True if the data source supports output parameters

Throws OdaException if a data source error occurs

Interface IParameterMetaDataSyntax public interface IParameterMetaData

Description IParameterMetaData is an optional interface that represents metadata for parameters of a prepared statement. All indexes in this interface are 1-based.

Field summary

Page 510: Accessing Data

488 A c c e s s i n g D a t a

I P a r a m e t e r M e t a D a t a

Table 19-12 lists the fields for interface IParameterMetaData.

Method summaryTable 19-13 lists the methods for interface IParameterMetaData.

Table 19-12 Fields for interface IParameterMetaData

Fields Description

public static final int parameterModeIn

A constant that indicates that the parameter is an input parameter.

public static final int parameterModeInOut

A constant that indicates that the parameter is both input and output.

public static final int parameterModeOut

A constant that indicates that the parameter is an output parameter.

public static final int parameterModeUnknown

A constant that indicates that the input or output mode of the parameter is unknown.

public static final int parameterNoNulls

A constant that indicates that the parameter does not allow null values.

public static final int parameterNullable

A constant that indicates that the parameter allows null values.

public static final int parameterNullableUnknown

A constant that indicates that the nullability of the parameter is unknown.

Table 19-13 Methods for interface IParameterMetaData

Method Description

getParameterCount( ) A mandatory method that returns the number of parameters that are in the prepared statement object for which this IParameterMetaData object contains information.

getParameterMode( ) A mandatory method that returns the input or output mode of the specified parameter.

getParameterType( ) A mandatory method that returns the java.sql.Types type of the specified parameter.

getParameterTypeName( ) A mandatory method that returns the data source-specific type name for the specified parameter.

getPrecision( ) An optional method that returns the maximum number of digits that can appear to the right of the decimal point for the specified parameter.

Page 511: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 489

I P a r a m e t e r M e t a D a t a . g e t P a r a m e t e r C o u n t

IParameterMetaData.getParameterCountSyntax public int getParameterCount( ) throws OdaException

A mandatory method that returns the number of parameters in the prepared statement object for which the IParameterMetaData object contains information

Returns The number of parameters

Throws OdaException if a data source error occurs

IParameterMetaData.getParameterModeSyntax public int getParameterMode(int param) throws OdaException

A mandatory method that returns the input and output mode of the specified parameter

Parameters paramThe 1-based index of the parameter

Returns The input and output mode of the parameter. Valid values are:

■ parameterModeUnknown

■ parameterModeIn

■ parameterModeInOut

■ parameterModeOut

Throws OdaException if a data source error occurs

getScale( ) An optional method that returns the maximum number of digits that can appear to the right of the decimal point for the specified parameter. getScale( ) typically applies to numeric data types, but the ODA data source determines which java.sql.Types apply.

isNullable( ) An optional method that indicates whether the data source supports null values for the specified parameter.

Table 19-13 Methods for interface IParameterMetaData (continued)

Method Description

Page 512: Accessing Data

490 A c c e s s i n g D a t a

I P a r a m e t e r M e t a D a t a . g e t P a r a m e t e r T y p e

IParameterMetaData.getParameterTypeSyntax public int getParameterType(int param) throws OdaException

A mandatory method that returns the java.sql.Types type of the specified parameter. All java.sql.Types data types, such as ARRAY, INTEGER, and STRUCT, are valid return values. An ODA provider does not necessarily return all types.

Parameters paramThe 1-based index of the parameter

Returns The java.sql.Types type of the parameter

Throws OdaException if a data source error occurs

IParameterMetaData.getParameterTypeNameSyntax public java.lang.String getParameterTypeName(int param) throws OdaException

A mandatory method that returns the data source type name for the specified parameter type

Parameters paramThe 1-based index of the parameter

Returns The name of the parameter type

Throws OdaException if a data source error occurs

IParameterMetaData.getPrecisionSyntax public int getPrecision(int param) throws OdaException

An optional method that returns the maximum number of digits that can appear to the right of the decimal point for the specified parameter. getPrecision( ) typically applies only to numeric data types. The ODA data source determines which java.sql.Types apply. The maximum precision that is allowed on a data type can vary depending on the data source.

Parameters paramThe 1-based index of the parameter

Returns The precision of the parameter or -1 if precision is not applicable

Throws OdaException if a data source error occurs

Page 513: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 491

I P a r a m e t e r M e t a D a t a . g e t S c a l e

IParameterMetaData.getScaleSyntax public int getScale(int param) throws OdaException

An optional method that returns the maximum number of digits that can appear to the right of the decimal point for the specified parameter. getScale( ) typically applies only to numeric data types. The ODA data source determines which java.sql.Types apply. The data source determines the maximum scale for a data type.

Parameters paramThe 1-based index of the parameter

Returns The scale of the parameter or -1 if scale does not apply

Throws OdaException if a data source error occurs

IParameterMetaData.isNullableSyntax public int isNullable(int param) throws OdaException

An optional method that indicates whether the specified parameter supports null values

Parameters paramThe 1-based index of the parameter

Returns The nullability of the parameter. Valid values are:

■ parameterNullableUnknown

■ parameterNoNulls

■ parameterNullable

Throws OdaException if a data source error occurs

Interface IResultSetSyntax public interface IResultSet

Description IResultSet is the interface for all result sets. An IResultSet object maintains a cursor that points to its current data row. Initially, the cursor is before the first row. The next( ) method moves the cursor to the next row until there are no more rows or until it reaches the maximum number of rows that can be returned.

The ODA host typically sets the MaxRows property for the result set to zero to retrieve the entire result set. To ensure that the ODA driver returns the correct result set, you must test explicitly for a maxRows size of zero in next( ).

Page 514: Accessing Data

492 A c c e s s i n g D a t a

I R e s u l t S e t

Method summaryTable 19-14 lists the methods for interface IResultSet.

Table 19-14 Methods for interface IResultSet

Method Description

close( ) A mandatory method that closes the cursor for the current IResultSet.

findColumn( ) An optional method that returns the column index of the specified column name.

getBigDecimal( ) Returns the decimal value of the specified column in the current row.

getBlob( ) Gets the value of the specified column in the current row as an IBlob.

getClob( ) Gets the value of the specified column in the current row as an IClob.

getDate( ) Gets the value of the specified column in the current row as a java.sql.Date.

getDouble( ) Gets the value of the specified column in the current row as a double.

getInt( ) Gets the value of the specified column in the current row as an int.

getMetaData( ) A mandatory method that returns the metadata that is associated with the current IResultSet.

getRow( ) An optional method that returns the 1-based index position of the current row.

getString( ) Gets the value of the specified column in the current row as a String.

getTime( ) Gets the value of the specified column in the current row as a java.sql.Time.

getTimestamp( ) Gets the value of the specified column in the current row as a java.sql.Timestamp.

next( ) A mandatory method that moves the cursor down one row from its current position.

setFetchSize( ) Deprecated. Use setMaxRows( ).setMaxRows( ) Specifies the maximum number of rows that can be fetched

from this result set.

Page 515: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 493

I R e s u l t S e t . c l o s e

IResultSet.closeSyntax public void close( ) throws OdaException

A mandatory method that closes the cursor that is associated with the current IResultSet

Throws OdaException if a data source error occurs

IResultSet.findColumnSyntax public int findColumn(java.lang.String columnName) throws OdaException

An optional method that returns the column index of the column that is identified by name. Implement this method when the driver supports access to result set columns by name.

Parameters columnNameThe name of the column

Returns The 1-based column index

Throws OdaException if a data source error occurs

IResultSet.getBigDecimalSyntax public BigDecimal getBigDecimal(int index) throws OdaException

Returns the decimal value of the column that is identified by its position in the current row

Parameters indexThe position of the column

Returns The decimal value

Throws OdaException if a data source error occurs

Syntax public BigDecimal getBigDecimal(java.lang.String columnName) throws OdaException

wasNull( ) A mandatory method that checks whether the value retrieved from the previous get method was invalid or null. Call immediately after the get method.

Table 19-14 Methods for interface IResultSet (continued)

Method Description

Page 516: Accessing Data

494 A c c e s s i n g D a t a

I R e s u l t S e t . g e t B l o b

Returns the decimal value of the column in the current row that is identified by name

Parameters columnNameName of the column

Returns The decimal value

Throws OdaException if a data source error occurs

IResultSet.getBlobSyntax public IBlob getIBlob(int index) throws OdaException

Returns the BLOB value in the current row for a column, using the column position to identify the desired column. After using IResultSet.getBlob( ), an ODA driver must keep the IBLOB object and the BLOB’s data accessible until the driver closes the result set.

Parameters indexThe position of the column

Returns The BLOB value. Returns null if the specific column has a null value.

Throws OdaException if a data source error occurs

Syntax public IBlob getIBlob(java.lang.String columnName) throws OdaException

Returns the BLOB value in the current row for a column, using the column name to identify the desired column. After using IResultSet.getBlob( ), an ODA driver must keep the IBLOB object and the BLOB’s data accessible until the driver closes the result set.

Parameters columnNameThe column name

Returns The BLOB value. Returns null if the specific column has a null value.

Throws OdaException if a data source error occurs

IResultSet.getClobSyntax public IClob getIClob(int index) throws OdaException

Returns CLOB value in the current row for a column, using the column position to identify the desired column. After using IResultSet.getClob( ), an ODA driver must keep the ICLOB object and the CLOB’s data accessible until the driver closes the result set.

Parameters indexThe position of the column

Page 517: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 495

I R e s u l t S e t . g e t D a t e

Returns The CLOB value. Returns null if the specific column has a null value.

Throws OdaException if a data source error occurs

Syntax public IClob getIClob(java.lang.String columnName) throws OdaException

Returns CLOB value in the current row for a column, using the column name to identify the desired column. After using IResultSet.getClob( ), an ODA driver must keep the ICLOB object and the CLOB’s data accessible until the driver closes the result set.

Parameters columnNameThe column name

Returns The CLOB value. Returns null if the specific column has a null value.

Throws OdaException if a data source error occurs

IResultSet.getDateSyntax public java.sql.Date getDate(int index) throws OdaException

Gets the value of the column in the current row as a java.sql.Date. Mandatory if the driver supports the Date data type.

Parameters indexThe 1-based column index

Returns The java.sql.Date value of the specified column of the current row

Throws OdaException if a data source error occurs

Syntax public Date getDate(String columnName) throws OdaException

Gets the value of the specified column in the current row as a java.sql.Date. Mandatory if the driver supports the Date data type and accessing result set columns by name.

Parameters columnNameThe column name

Returns The java.sql.Date value of the specified column of the current row

Throws OdaException if a data source error occurs

IResultSet.getDoubleSyntax public double getDouble(int index) throws OdaException

Gets the value of the specified column in the current row as a double. Mandatory if the driver supports the double data type.

Page 518: Accessing Data

496 A c c e s s i n g D a t a

I R e s u l t S e t . g e t I n t

Parameters indexThe 1-based column index

Returns The double value of the specified column of the current row

Throws OdaException if a data source error occurs

Syntax public double getDouble(String columnName) throws OdaException

Gets the value of the specified column in the current row as a double. Mandatory if the driver supports the double data type and accessing result set columns by name.

Parameters columnNameThe column name

Returns The double value of the specified column of the current row

Throws OdaException if a data source error occurs

IResultSet.getIntSyntax public int getInt(int index) throws OdaException

Gets the value of the specified column in the current row as an int. Mandatory if the driver supports the integer data type.

Parameters indexThe 1-based column index

Returns The integer value of the specified column of the current row

Throws OdaException if a data source error occurs

Syntax public int getInt(String columnName) throws OdaException

Gets the value of the specified column in the current row as an int. Mandatory if the driver supports the integer data type and accessing result set columns by name.

Parameters columnName The column name

Returns The integer value of the specified column of the current row

Throws OdaException if a data source error occurs

IResultSet.getMetaDataSyntax public com.actuate.oda.IResultSetMetaData getMetaData( )

throws OdaException

Page 519: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 497

I R e s u l t S e t . g e t R o w

A mandatory method that returns the metadata that is associated with the current IResultSet

Returns The metadata for the IResultSet

Throws OdaException if a data source error occurs

IResultSet.getRowSyntax public int getRow( ) throws OdaException

An optional method that returns the current row’s 1-based index position

Returns The 1-based index position of the current row

Throws OdaException if a data source error occurs

IResultSet.getStringSyntax public java.lang.String getString(int index) throws OdaException

Gets the value of the specified column in the current row as a String. Mandatory if the driver supports the String data type. getString( ) can provide the String value of a non-String column. The format of the string that is returned is implementation-dependent.

Parameters indexThe 1-based column index

Returns The string value of the specified column of the current row

Throws OdaException if a data source error occurs

Syntax public String getString(String columnName) throws OdaException

Gets the value of the named column in the current row as a String. Mandatory if the driver supports the String data type and accessing result set columns by name. getString( ) can provide the String value of a non-String column. The format of the string that is returned is implementation-dependent.

Parameters columnNameThe column name

Returns The string value of the specified column of the current row

Throws OdaException if a data source error occurs

Page 520: Accessing Data

498 A c c e s s i n g D a t a

I R e s u l t S e t . g e t T i m e

IResultSet.getTimeSyntax public java.sql.Time getTime(int index) throws OdaException

Gets the value of the specified column in the current row as a java.sql.Time. Mandatory if the driver supports the Time data type.

Parameters indexThe 1-based column index

Returns The java.sql.Time value of the specified column of the current row

Throws OdaException if a data source error occurs

Syntax public Time getTime(String columnName) throws OdaException

Gets the value of the named column in the current row as a java.sql.Time. Mandatory if the driver supports the Time data type and accessing result set columns by name.

Parameters columnName The column name

Returns The java.sql.Time value of the specified column of the current row

Throws OdaException if a data source error occurs

IResultSet.getTimestampSyntax public java.sql.Timestamp getTimestamp(int index) throws OdaException

Gets the value of the specified column in the current row as a java.sql.Timestamp. Mandatory if the driver supports the Timestamp data type.

Parameters indexThe 1-based column index

Returns The java.sql.Timestamp value of the specified column of the current row

Throws OdaException if a data source error occurs

Syntax public Timestamp getTimestamp(String columnName) throws OdaException

Gets the value of the named column in the current row as a java.sql.Timestamp. Mandatory if the driver supports the Timestamp data type and accessing result set columns by name.

Parameters columnName The column name

Returns The java.sql.Timestamp value of the specified column of the current row

Throws OdaException if a data source error occurs

Page 521: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 499

I R e s u l t S e t . n e x t

IResultSet.nextSyntax public boolean next( ) throws OdaException

A mandatory method that moves the cursor down one row from its current position

Returns True if there is a subsequent data row and the maximum rows limit has not been reached

Throws OdaException if a data source error occurs

Example public boolean next( ) throws OdaException{

if( m_maxRows != 0 && m_rowsReturned >= m_maxRows )return false;

// else process the next row}

IResultSet.setMaxRowsSyntax public void setMaxRows(int max) throws OdaException

Specifies the maximum number of rows to fetch from this result set. This value should not be greater than the maximum number of rows that is specified in the related IStatement. A value of zero means that there is no limit.

Parameters maxThe maximum number of rows to fetch from this IResultSet

Throws OdaException if a data source error occurs

IResultSet.wasNullSyntax public boolean wasNull( ) throws OdaException

A mandatory method that checks whether the value of the previous getter method is invalid or null. Call immediately after the get method. In each getter method, set any data structures used by wasNull( ).

Returns True if the previous get method call was invalid or null

Throws OdaException if a data source error occurs

Page 522: Accessing Data

500 A c c e s s i n g D a t a

I R e s u l t S e t M e t a D a t a

Interface IResultSetMetaDataSyntax public interface IResultSetMetaData

Description IResultSetMetaData is the metadata interface for all metadata implementations. IResultSetMetaData represents a row that contains metadata for each column that corresponds to the result set.

All indexes in this interface are 1-based.

Field summaryTable 19-15 lists the fields for interface IResultSetMetaData.

Method summaryTable 19-16 lists the methods for interface IResultSetMetaData.

Table 19-15 Fields for interface IResultSetMetaData

Field Description

public static final int columnNoNulls

A constant that indicates that a column does not allow null values.

public static final int columnNullable

A constant that indicates that a column allows null values.

public static final int columnNullableUnknown

A constant that indicates that the nullability of the values for a column is unknown.

Table 19-16 Methods for interface IResultSetMetaData

Method Description

getColumnCount( ) A mandatory method that returns the number of columns in the corresponding IResultSet object.

getColumnDisplayLength( ) A mandatory method that returns the display length of a specified column.

getColumnLabel( ) A mandatory method that returns the suggested title of a specified column for use in the column heading and data row variable name.

getColumnName( ) A mandatory method that returns the name of a specified column.

getColumnType( ) A mandatory method that returns the java.sql.Types type of a specified column.

Page 523: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 501

I R e s u l t S e t M e t a D a t a . g e t C o l u m n C o u n t

IResultSetMetaData.getColumnCountSyntax public int getColumnCount( ) throws OdaException

A mandatory method that returns the number of columns in the corresponding IResultSet object

Returns The number of columns

Throws OdaException if a data source error occurs

IResultSetMetaData.getColumnDisplayLengthSyntax public int getColumnDisplayLength(int index) throws OdaException

A mandatory method that returns the display length of the specified column

Parameters indexThe 1-based column index

Returns The column’s display length

Throws OdaException if a data source error occurs

IResultSetMetaData.getColumnLabelSyntax public java.lang.String getColumnLabel(int index) throws OdaException

A mandatory method that returns the suggested title of a specified column for use in the column heading and data row variable name

getColumnTypeName( ) A mandatory method that returns the type name of a specified column.

getPrecision( ) An optional method that returns the maximum number of decimal digits in a specified column.

getScale( ) An optional method that returns the maximum number of digits that can appear to the right of the decimal point in a specified column.

isNullable( ) An optional method that indicates the nullability of values in a specified column.

Table 19-16 Methods for interface IResultSetMetaData (continued)

Method Description

Page 524: Accessing Data

502 A c c e s s i n g D a t a

I R e s u l t S e t M e t a D a t a . g e t C o l u m n N a m e

Parameters indexThe 1-based column index

Returns The recommended column title

Throws OdaException if a data source error occurs

IResultSetMetaData.getColumnNameSyntax public java.lang.String getColumnName(int index) throws OdaException

A mandatory method that returns the name of the specified column

Parameters indexThe 1-based column index

Returns The column name

Throws OdaException if a data source error occurs

IResultSetMetaData.getColumnTypeSyntax public int getColumnType(int index) throws OdaException

A mandatory method that returns the type of the specified column. All java.sql.Types data types, such as ARRAY, INTEGER, and STRUCT, are valid return values. An ODA driver or data source does not necessarily return every type.

Parameters indexThe 1-based column index

Returns The java.sql.Types type of the column

Throws OdaException if a data source error occurs

IResultSetMetaData.getColumnTypeNameSyntax public java.lang.String getColumnTypeName(int index) throws OdaException

A mandatory method that returns the type name of the specified column

Parameters indexThe 1-based column index

Returns The column type name

Throws OdaException if a data source error occurs

Page 525: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 503

I R e s u l t S e t M e t a D a t a . g e t P r e c i s i o n

IResultSetMetaData.getPrecisionSyntax public int getPrecision(int index) throws OdaException

An optional method that returns the maximum number of decimal digits of the specified column. getPrecision( ) typically applies only to numeric data types. The driver determines which java.sql.Types apply. The maximum precision that is allowed on a data type can vary depending on the data source.

Parameters indexThe 1-based column index

Returns The column precision. Returns -1 if precision does not apply.

Throws OdaException if a data source error occurs

IResultSetMetaData.getScaleSyntax public int getScale(int index) throws OdaException

An optional method that returns the maximum number of digits that can appear to the right of the decimal point for the specified column. getScale( ) typically applies only to numeric data types. The ODA data source determines which java.sql.Types apply and sets the maximum scale for a data type.

Parameters indexThe 1-based column index

Returns The column scale or -1 if scale does not apply

Throws OdaException if a data source error occurs

IResultSetMetaData.isNullableSyntax public int isNullable(int index) throws OdaException

An optional method that indicates the nullability of values in the specified column

Parameters indexThe 1-based column index

Returns The nullability status of the specified column. Valid values are:

■ columnNoNulls

■ columnNullable

■ columnNullableUnknown

Page 526: Accessing Data

504 A c c e s s i n g D a t a

I R o w S e t

Throws OdaException if a data source error occurs

Interface IRowSetSyntax public interface IRowSet extends IResultSet

Description IRowSet is an interface for representing a complex structure or table. All complex structures or tables implement this interface. IRowSet is useful for representing complex parameter data values at run time. A collection of one row can be used as a structure.

This interface is required only if the driver supports complex input or output parameters. A complex parameter’s metadata can be obtained from its inherited getMetaData( ) method.

An implementation of IRowSet must implement the mandatory methods that it inherits from IResultSet.

Method summaryTable 19-17 lists the methods for interface IRowSet.

Table 19-17 Methods for interface IRowSet

Method Description

absolute( ) A mandatory method that moves the cursor to the specified row.

add( ) Appends a new row to the end of this collection, and moves the cursor to the new row’s position.

clear( ) An optional method that removes all the elements from this collection.

isEmpty( ) A mandatory method that determines whether this collection contains any elements.

previous( ) An optional method that moves the cursor up one element from its current position.

setBigDecimal( ) Sets the decimal value at the designated column.

setDate( ) Sets the date value at the specified column.

setDouble( ) Sets the double value at the specified column.

setInt( ) Sets the integer value at the specified column.

setString( ) Sets the string value at the specified column.

setTime( ) Sets the time value at the specified column.

setTimestamp( ) Sets the time stamp value at the specified column.

Page 527: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 505

I R o w S e t . a b s o l u t e

Methods inherited from interface com.actuate.oda.IResultSet

close, findColumn, getBigDecimal, getBigDecimal, getDate, getDate, getdouble, getDouble, getInt, getInt, getMetaData, getRow, getString, getString, getTime, getTime, getTimestamp, getTimestamp, next, setMaxRows, wasNull

IRowSet.absoluteSyntax public boolean absolute(int rowIndex) throws OdaException

A required method that moves the cursor to the specified row

Parameters rowIndexThe 1-based row number

Returns True if the cursor moves successfully to the row

Throws OdaException if a data source error occurs

IRowSet.addSyntax public int add( ) throws OdaException

Appends a new row to the end of this collection and moves the cursor to the position of the new row. Mandatory only for input parameters.

Returns Zero if add( ) fails to add a new row. Otherwise, returns the 1-based row index of the new row.

Throws OdaException if a data source error occurs

IRowSet.clearSyntax public void clear( ) throws OdaException

An optional method that removes all elements from this collection

Throws OdaException if a data source error occurs

size( ) A mandatory method that returns the number of elements that are in this collection.

Table 19-17 Methods for interface IRowSet (continued)

Method Description

Page 528: Accessing Data

506 A c c e s s i n g D a t a

I R o w S e t . i s E m p t y

IRowSet.isEmptySyntax public boolean isEmpty( ) throws OdaException

A mandatory method that determines whether this collection contains elements

Returns True if the collection is empty

Throws OdaException if a data source error occurs

IRowSet.previousSyntax public boolean previous( ) throws OdaException

An optional method that moves the cursor up one element from its current position

Returns True if the cursor moves to a valid row

Throws OdaException if a data source error occurs

IRowSet.setBigDecimalSyntax public void setBigDecimal(int columnIndex, BigDecimal value)

throws OdaException

Sets the decimal value of the column that is identified by its position in the current row

Parameters columnIndexThe 1-based index position of the column

valueThe decimal value

Throws OdaException if a data source error occurs

Syntax public void setBigDecimal(java.lang.String columnName, BigDecimal value) throws OdaException

Sets the decimal value of the column in the current row that is identified by name

Parameters columnNameName of the column

valueThe decimal value

Throws OdaException if a data source error occurs

Page 529: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 507

I R o w S e t . s e t D a t e

IRowSet.setDateSyntax public void setDate(int columnIndex, java.sql.Date value) throws OdaException

Sets the date value at the specified column. Mandatory only for input parameters. Implement this method when the driver supports the Date data type.

Parameters columnIndexThe 1-based index of the column

valueThe java.sql.Date value

Throws OdaException if a data source error occurs

Syntax public void setDate(java.lang.String columnName, java.sql.Date value)throws OdaException

Sets the date value at the column that is identified by name. Mandatory only for input parameters that support setting columns by name. Implement this method when the driver supports the Date data type.

Parameters columnNameThe name of the column

valueThe java.sql.Date value

Throws OdaException if a data source error occurs

IRowSet.setDoubleSyntax public void setDouble(int columnIndex, double value) throws OdaException

Sets the double value at the specified column. Mandatory only for input parameters. Implement this method when the driver supports the double data type.

Parameters columnIndexThe 1-based index of the column

valueThe double value

Throws OdaException if a data source error occurs

Syntax public void setDouble(java.lang.String columnName, double value)throws OdaException

Page 530: Accessing Data

508 A c c e s s i n g D a t a

I R o w S e t . s e t I n t

Sets the double value at the column that is identified by name. Mandatory only for input parameters that support setting columns by name. Implement this method when the driver supports the double data type.

Parameters columnNameThe name of the column

valueThe double value

Throws OdaException if a data source error occurs

IRowSet.setIntSyntax public void setInt(int columnIndex, int value) throws OdaException

Sets the integer value at the specified column. Mandatory only for input parameters. Implement this method when the driver supports the integer data type.

Parameters columnIndexThe 1-based index of the column

valueThe integer value

Throws OdaException if a data source error occurs

Syntax public void setInt(java.lang.String columnName, int value)throws OdaException

Sets the integer value at the column that is identified by name. Mandatory only for input parameters that support setting columns by name. Implement this method when the driver supports the integer data type.

Parameters columnNameThe name of the column

valueThe integer value

Throws OdaException if a data source error occurs

IRowSet.setStringSyntax public void setString(int columnIndex, java.lang.String value)

throws OdaException

Page 531: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 509

I R o w S e t . s e t T i m e

Sets the string value at the specified column. Mandatory only for input parameters. Implement this method when the driver supports the String data type. Not all ODA drivers support setString() on a non-String type column. The format of the string parameter is implementation-dependent.

Parameters columnIndexThe 1-based index of the column

valueThe string value

Throws OdaException if a data source error occurs

Syntax public void setString(java.lang.String columnName, java.lang.String value)throws OdaException

Sets the string value at the column that is identified by name. Mandatory only for input parameters that support setting columns by name. Implement this method when the driver supports the String data type. Not all ODA drivers support setString() on a non-String type column. The format of the string parameter is implementation-dependent.

Parameters columnNameThe name of the column

valueThe string value

Throws OdaException if a data source error occurs

IRowSet.setTimeSyntax public void setTime(int columnIndex, java.sql.Time value)

throws OdaException

Sets the time value at the specified column. Mandatory only for input parameters. Implement this method when the driver supports the Time data type.

Parameters columnIndexThe 1-based index of the column

valueThe java.sql.Time value

Throws OdaException if a data source error occurs

Syntax public void setTime(java.lang.String columnName, java.sql.Time value)throws OdaException

Sets the time value at the column that is identified by name. Mandatory only for input parameters that support setting columns by name. Implement this method when the driver supports the Time data type.

Page 532: Accessing Data

510 A c c e s s i n g D a t a

I R o w S e t . s e t T i m e s t a m p

Parameters columnNameThe name of the column

valueThe java.sql.Time value

Throws OdaException if a data source error occurs

IRowSet.setTimestampSyntax public void setTimestamp(int columnIndex, java.sql.Timestamp value)

throws OdaException

Sets the time stamp value at the specified column. Mandatory only for input parameters. Implement this method when the driver supports the Timestamp data type.

Parameters columnIndexThe 1-based index of the column

valueThe java.sql.Timestamp value

Throws OdaException if a data source error occurs

Syntax public void setTimestamp(java.lang.String columnName, java.sql.Timestamp value) throws OdaException

Sets the time stamp value at the column that is identified by name. Mandatory only for input parameters that support setting columns by name. Implement this method when the driver supports the Timestamp data type.

Parameters columnNameThe name of the column

valueThe java.sql.Timestamp value

Throws OdaException if a data source error occurs

IRowSet.sizeSyntax public int size( ) throws OdaException

A mandatory method that returns the number of elements that are in this collection

Returns The size of this collection

Throws OdaException if a data source error occurs

Page 533: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 511

I S t a t e m e n t

Interface IStatementSyntax public interface IStatement

Description IStatement is the root interface in the statement hierarchy. A statement is any string that is capable of returning data when it executes. You must always prepare IStatement before you call execute( ). For example:

if ( statement.prepare( "SELECT * FROM TABLE" ) ) {// prepare succeededstatement.execute();} // else handle statement error

When an ODA driver or data source does not support a capability that a run-time interface exposes, the implementation for the statement setter methods should throw an UnsupportedOperationException. At a minimum, the message of the UnsupportedOperationException should contain the name of the class and method to provide the context of the exception, as shown in the following example:

public class MyStatementClass extends IStatement{

public void setInt( int parameterId, int value ){

// is not supported by this Statement classthrow new UnsupportedOperationException"MyStatementClass.setInt( int parameterId,

int value )" );}

}

Method summaryTable 19-18 lists the methods for interface IStatement.

Table 19-18 Methods for interface IStatement

Method Description

clearInParameters( ) An optional method to reset all input parameters to their default values.

close( ) A mandatory method that closes the current statement.

(continues)

Page 534: Accessing Data

512 A c c e s s i n g D a t a

I S t a t e m e n t

execute( ) A mandatory method that executes the statement’s prepared command, which can return one or more result sets.

executeQuery( ) A mandatory method that executes the statement’s prepared query and returns a single ResultSet object.

findInParameter( ) An optional method that returns the 1-based index of the specified input scalar or structure parameter.

getFetchSize( ) Deprecated. Use getMaxRows( ).

getMaxRows( ) Returns the maximum number of rows that can be fetched from the statement execution.

getMetaData( ) An optional method that returns the metadata of the current result set for the current prepared IStatement. Alternatively, returns the metadata of the first result set for the current IStatement with the specified command.

getMoreResults( ) Moves the cursor to the IStatement’s next result set, if there is one.

(continues)

getParameterMetaData( ) An optional method that returns the number, types, and properties of this prepared IStatement object’s parameters.

getParameterType( ) Returns the java.sql.Types type for the specified parameter.

getResultSet( ) Returns the current result as an IResultSet object instance.

getSortSpec( ) Returns the sorting specification that is associated with this IStatement.

prepare( ) A mandatory method that determines whether the command is a valid form of the implemented IStatement class.

setBigDecimal( ) Sets the designated parameter to the specified decimal value.

setDate( ) Sets the specified parameter to the given Date value.

setDouble( ) Sets the specified parameter to the given double value.

Table 19-18 Methods for interface IStatement (continued)

Method Description

Page 535: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 513

I S t a t e m e n t . c l e a r I n P a r a m e t e r s

IStatement.clearInParametersSyntax public void clearInParameters( ) throws OdaException

An optional method that resets all input parameters to their default values. If you have used other IStatement methods, such as setInt( ), to set a new value for an individual parameter, you can use this method to remove all changes from all input parameters.

Throws OdaException if a data source error occurs

IStatement.closeSyntax public void close( ) throws OdaException

A mandatory method that closes this statement

Throws OdaException if a data source error occurs

IStatement.executeSyntax public boolean execute( ) throws OdaException

setFetchSize( ) Deprecated. Use setMaxRows( ).

setInt( ) Sets the specified parameter to the given integer value.

setMaxRows( ) Specifies the maximum number of rows that can be fetched from the statement execution.

setProperty( ) An optional method that sets the named property with the specified value.

setPropertyInfo( ) An optional method that sets the properties of this IStatement.

setSortSpec( ) Specifies the sorting for this IStatement.

setString( ) Sets the specified parameter to a String value.

setTime( ) Sets the specified parameter to a Time value.

setTimestamp( ) Sets the specified parameter to a Timestamp value.

Table 19-18 Methods for interface IStatement (continued)

Method Description

Page 536: Accessing Data

514 A c c e s s i n g D a t a

I S t a t e m e n t . e x e c u t e Q u e r y

A mandatory method that executes the statement’s prepared command. Call execute( ) only after you call prepare( ). Implement this method when the driver supports getting multiple IResultSet objects from a single call. Implement executeQuery( ) when the driver supports only a single result set.

Returns True if the command executes successfully

Throws OdaException if a data source error occurs

Syntax public boolean execute(java.lang.String command) throws OdaException

An alternative to execute( ), this method is equivalent to calling prepare( command ) then execute( ). Because this method executes the statement immediately, execute(String) is available only for drivers that do not support input parameters. Implement this method when the driver supports getting multiple IResultSet objects from a single call. Implement executeQuery( ) when the driver supports only a single result set.

Parameters commandThe new command to associate with this statement

Returns True if the next result is a ResultSet object and false if there are no more results

Throws OdaException if a data source error occurs

IStatement.executeQuerySyntax public com.actuate.oda.IResultSet executeQuery( ) throws OdaException

A mandatory method that executes the statement’s prepared query and returns a single ResultSet object. Call this method only after you call prepare( ).

Returns An IResultSet instance

Throws OdaException if a data source error occurs

Syntax public com.actuate.oda.IResultSet executeQuery(java.lang.String command)throws OdaException

An alternative to executeQuery( ), this method is equivalent to calling prepare( command ) then executeQuery( ). This method executes the statement’s query and returns a single ResultSet object. It is available only for drivers that do not support input parameters.

Parameters commandThe new query to associate with this statement

Returns An IResultSet instance

Throws OdaException if a data source error occurs

Page 537: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 515

I S t a t e m e n t . f i n d I n P a r a m e t e r

IStatement.findInParameterSyntax public int findInParameter(java.lang.String parameterName)

throws OdaException

An optional method that returns the 1-based index of the specified input scalar or structure parameter. Implement this method if the driver supports named input parameters.

Parameters parameterNameThe name of the input parameter

Returns The 1-based index of the named input parameter

Throws OdaException if a data source error occurs

IStatement.getMaxRowsSyntax public int getMaxRows( ) throws OdaException

Returns the maximum number of rows that can be retrieved from each result set of this IStatement

Returns The maximum number of rows to retrieve from each result set

Throws OdaException if a data source error occurs

IStatement.getMetaDataSyntax public com.actuate.oda.IResultSetMetaData getMetaData( )

throws OdaException

Returns the metadata of the current result set for this prepared statementCall this method only after you call prepare( ). If you call this method before the IStatement is executed, the returned metadata refers to the first result set.

Returns An IResultSetMetaData instance

Throws OdaException if a data source error occurs

Syntax public com.actuate.oda.IResultSetMetaData getMetaData(java.lang.String command) throws OdaException

Returns the metadata of the first result set for this IStatement with the specified command. This method is equivalent to prepare( command ) then getMetaData().

Parameters commandThe new command to associate with this IStatement

Page 538: Accessing Data

516 A c c e s s i n g D a t a

I S t a t e m e n t . g e t M o r e R e s u l t s

Returns An IResultSetMetaData instance

Throws OdaException if a data source error occurs

IStatement.getMoreResultsSyntax public boolean getMoreResults( ) throws OdaException

Moves the cursor to the IStatement’s next result set. This method also implicitly closes the current IResultSet object that was obtained from the previous call to getResultSet( ). Implement this method when the data source supports getting multiple IResultSet objects from a single call to the IStatement.execute( ) method.

Returns True if there are more results in this IStatement instance

Throws OdaException if a data source error occurs

IStatement.getParameterMetaDataSyntax public com.actuate.oda.IParameterMetaData getParameterMetaData( )

throws OdaException

An optional method that returns the number, types, and properties of the current prepared IStatement’s parameters. Call this method only after you call prepare( ).

Returns An IParameterMetaData object that contains information about the parameters of this prepared IStatement

Throws OdaException if a data source error occurs

IStatement.getParameterTypeSyntax public int getParameterType(int parameterId) throws OdaException

Returns the java.sql.Types type for the specified parameter. All java.sql.Types data types, such as ARRAY, INTEGER, and STRUCT, are valid return values. An ODA driver does not necessarily return all types. Implement getParameterType( ) when the driver supports input or output parameters.

Parameters parameterIdThe 1-based index of the input or output parameter

Returns The type of the input or output parameter

Throws OdaException if a data source error occurs

Syntax public int getParameterType(java.lang.String parameterName) throws OdaException

Page 539: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 517

I S t a t e m e n t . g e t R e s u l t S e t

Returns the java.sql.Types type for the named parameter. All java.sql.Types data types, such as ARRAY, INTEGER, and STRUCT, are valid return values. An ODA provider does not necessarily return all types. Implement getParameterType( ) when the driver supports named input or output parameters.

Parameters parameterNameThe name of the input or output parameter

Returns The java.sql.Types type of the input or output parameter

Throws OdaException if a data source error occurs

IStatement.getResultSetSyntax public com.actuate.oda.IResultSet getResultSet( ) throws OdaException

Returns the current result as an IResultSet object instance. Call this method only once for each result set and only when the data source supports getting multiple IResultSet objects from a single call to the IStatement.execute( ) method.

Returns An IResultSet object instance

Throws OdaException if a data source error occurs

IStatement.getSortSpecSyntax public SortSpec getSortSpec( ) throws OdaException

Returns the sort specification that is associated with this IStatement

Returns The SortSpec that is associated with this IStatement or null if no SortSpec is associated

Throws OdaException if a data source error occurs

IStatement.prepareSyntax public void prepare(java.lang.String command) throws OdaException

A mandatory method that determines whether the command is a valid form of the implemented IStatement class. The command to perform this verification cannot be empty or null.

Parameters commandThe String to check

Throws OdaException if a data source error occurs

Page 540: Accessing Data

518 A c c e s s i n g D a t a

I S t a t e m e n t . s e t B i g D e c i m a l

IStatement.setBigDecimalSyntax public void setBigDecimal(int parameterID, BigDecimal value)

throws OdaException

Sets the designated parameter to the specified decimal value

Parameters parameterIdThe 1-based index position of the input parameter

valueThe decimal value

Throws OdaException if a data source error occurs

IStatement.setDateSyntax public void setDate(int parameterId, java.sql.Date value) throws OdaException

Sets the specified input parameter to a Date value. Implement this method when the driver supports the Date data type and input parameters.

Parameters parameterIdThe 1-based index of the input parameter

valueThe java.sql.Date value

Throws OdaException if a data source error occurs

Syntax public void setDate(java.lang.String parameterName, java.sql.Date value)throws OdaException

Sets the named parameter to a Date value. Implement this method when the driver supports the Date data type and named input parameters.

Parameters parameterNameThe name of the input parameter

valueThe java.sql.Date value

Throws OdaException if a data source error occurs

IStatement.setDoubleSyntax public void setDouble(int parameterId, double value) throws OdaException

Page 541: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 519

I S t a t e m e n t . s e t I n t

Sets the specified parameter to a double value. Implement this method when the driver supports the double data type and input parameters.

Parameters parameterIdThe 1-based index of the input parameter

valueThe double value

Throws OdaException if a data source error occurs

Syntax public void setDouble(java.lang.String parameterName, double value)throws OdaException

Sets the named parameter to a double value. Implement this method when the driver supports the double data type and named input parameters.

Parameters parameterNameThe name of the input parameter

valueThe double value

Throws OdaException if a data source error occurs

IStatement.setIntSyntax public void setInt(int parameterId, int value) throws OdaException

Sets the specified parameter to an integer value. Implement this method when the driver supports the Integer data type and input parameters.

Parameters parameterIdThe 1-based index of the parameter

valueAn integer value

Throws OdaException if a data source error occurs

Syntax public void setInt(java.lang.String parameterName, int value)throws OdaException

Sets the named parameter to an integer value. Implement this method when the driver supports the integer data type and named input parameters.

Parameters parameterNameThe name of the parameter

valueAn integer value

Throws OdaException if a data source error occurs

Page 542: Accessing Data

520 A c c e s s i n g D a t a

I S t a t e m e n t . s e t M a x R o w s

IStatement.setMaxRowsSyntax public void setMaxRows(int max) throws OdaException

Specifies the maximum number of rows that can be fetched in each result set of this IStatement. A value of zero means that there is no limit.

Parameters maxThe maximum number of rows to fetch

Throws OdaException if a data source error occurs

IStatement.setPropertySyntax public void setProperty(java.lang.String name, java.lang.String value)

throws OdaException

Sets the named property to the specified value. setProperty( ) supports multiple calls that use the same property name. The processing of this method is implementation-dependent. Call setProperty( ) before you call execute( ) or executeQuery( ).

Parameters nameThe name of the property

valueThe value to set to the named property

Throws OdaException if a data source error occurs

See also IStatement.setPropertyInfo

IStatement.setPropertyInfoSyntax public void setPropertyInfo(java.util.Properties info) throws OdaException

Set the property values for this IStatement. setPropertyInfo( ) supports associating a single property name with a single property value. The processing of this method is implementation-dependent. Call setPropertyInfo( ) before you call execute( ) or executeQuery( ).

Parameters infoA list of arbitrary string tag-value pairs

Throws OdaException if a data source error occurs

See also IStatement.setProperty

Page 543: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 521

I S t a t e m e n t . s e t S o r t S p e c

IStatement.setSortSpecSyntax public void setSortSpec(SortSpec sortBy) throws OdaException

Specifies the sort specification for this IStatement. Call this method before the IStatement is executed or before getMoreResults( ) is called.

After you call setSortSpec( ), you can add additional sort keys. The final sort specification is applied to the result set or sets at execution.

The ODA driver must validate the type of sort specifications that the data source supports.

Calling setSortSpec( ) with a null argument clears the previously associated SortSpec. If no sort specification is set, the rows of a result set have an implementation-specific order, and the getSortSpec( ) method returns null.

Parameters sortByThe sort specification to associate

Throws OdaException if the specified sort specification is not valid or is not supported by the driver

IStatement.setStringSyntax public void setString(int parameterId, java.lang.String value)

throws OdaException

Sets the specified parameter to the given string value. Not all open data sources or drivers support setString( ) on a non-String type parameter. Implement this method when the driver supports the String data type and input parameters. The format of the string parameter is implementation-dependent.

Parameters parameterIdThe 1-based index of the parameter

valueA String value

Throws OdaException if a data source error occurs

Syntax public void setString(java.lang.String parameterName, java.lang.String value)throws OdaException

Sets the parameter that is identified by name to the given string value. Not all open data sources or drivers support setString( ) on a non-String type parameter. Implement this method when the driver supports the String data type and named input parameters. The format of the string parameter is implementation-dependent.

Page 544: Accessing Data

522 A c c e s s i n g D a t a

I S t a t e m e n t . s e t T i m e

Parameters parameterNameThe name of the parameter

valueA String value

Throws OdaException if a data source error occurs

IStatement.setTimeSyntax public void setTime(int parameterId, java.sql.Time value)

throws OdaException

Sets the specified parameter to a Time value. Implement this method when the driver supports the Time data type and input parameters.

Parameters parameterIdThe 1-based index of the parameter

valueThe java.sql.Time value

Throws OdaException if a data source error occurs

Syntax public void setTime(java.lang.String parameterName, java.sql.Time value)throws OdaException

Sets the parameter that is identified by name to a Time value. Implement this method when the driver supports the Time data type and named input parameters.

Parameters parameterNameThe name of the parameter

valueThe java.sql.Time value

Throws OdaException if a data source error occurs

IStatement.setTimestampSyntax public void setTimestamp(int parameterId, java.sql.Timestamp value)

throws OdaException

Sets the specified parameter to a Timestamp value. Implement this method when the driver supports the Timestamp data type and input parameters.

Parameters parameterIdThe 1-based index of the parameter

Page 545: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 523

I S t a t e m e n t . s e t T i m e s t a m p

valueThe java.sql.Timestamp value

Throws OdaException if a data source error occurs

Syntax public void setTimestamp(java.lang.String parameterName, java.sql.Timestamp value) throws OdaException

Sets the parameter that is identified by name to a Timestamp value. Implement this method when the driver supports the Timestamp data type and named input parameters.

Parameters parameterNameThe name of the parameter

valueThe java.sql.Timestamp value

Throws OdaException if a data source error occurs

Page 546: Accessing Data

524 A c c e s s i n g D a t a

L e v e l

Class LevelSyntax public final class Level extends Object

Description Level indicates a log level. Use log levels to limit the types of records that are logged. When you specify a log level, you limit the records that are logged to only those that are at the specified log level or higher.

The log level is an integer value that is identified by one of the following constants, which are listed in increasing numerical value:

■ ALL

■ FINEST

■ FINER

■ FINE

■ CONFIG

■ INFO

■ WARNING

■ SEVERE

■ OFF

ConstructorSyntax public Level(java.lang.String name, int value)

Constructs a Level instance that has the specified name and log-level value

Parameters nameThe name of the Level instance

valueThe log-level value

Field summaryTable 19-19 lists the fields for class Level.

Table 19-19 Fields for class Level

Field Description

ALL A constant that indicates the value of the ALL log level. This constant is a very large negative number to ensure that it is below any other constants that are used as log-level values.

Page 547: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 525

L e v e l

Method summary

ALL_LEVEL A constant that indicates the ALL log level.

(continues)

CONFIG A constant that indicates the value of the CONFIG log level.

CONFIG_LEVEL A constant that indicates the CONFIG log level.

FINE A constant that indicates the value of the FINE log level.

FINE_LEVEL A constant that indicates the FINE log level.

FINER A constant that indicates the value of the FINER log level.

FINER_LEVEL A constant that indicates the FINER log level.

FINEST A constant that indicates the value of the FINEST log level.

FINEST_LEVEL A constant that indicates the FINEST log level.

INFO A constant that indicates the value of the INFO log level.

INFO_LEVEL A constant that indicates the INFO log level.

OFF A constant that indicates the value of the OFF log level. This constant is a very large positive number to ensure that it is above any other constants that are used as log-level values.

OFF_LEVEL A constant that indicates the OFF log level.

SEVERE A constant that indicates the value of the SEVERE log level.

SEVERE_LEVEL A constant that indicates the SEVERE log level.

WARNING A constant that indicates the value of the WARNING log level.

WARNING_LEVEL A constant that indicates the WARNING log level.

Table 19-19 Fields for class Level (continued)

Field Description

Page 548: Accessing Data

526 A c c e s s i n g D a t a

L e v e l . e q u a l s

Table 19-20 lists the methods for class Level.

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Level.equalsSyntax public Boolean equals(java.lang.Object obj)

Checks whether the current Level instance has the same log-level value as the Object that is passed in as a parameter

Parameters objThe Object to compare

Returns True if the two objects have the same log-level value

Level.getNameSyntax public java.lang.String getName( )

Gets the log-level name for the current Level instance

Returns A string that contains the log-level name

Level.hashCodeSyntax public int hashCode( )

Generates and returns a hash code that is based on the log-level value

Returns The integer value of the generated hash code

Table 19-20 Methods for class Level

Method Description

equals( ) Returns true if the two objects have the same log-level value.

hashCode( ) Returns a hash code based on the log-level value.

getLogger( ) Returns the name of the log level.

getLogLevel( ) Returns the log-level value.

Page 549: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 527

L e v e l . i n t V a l u e

Level.intValueSyntax public int intValue( )

Gets the log-level value of the current Level instance

Returns An integer that indicates the log-level value

Page 550: Accessing Data

528 A c c e s s i n g D a t a

L o g F o r m a t t e r

Class LogFormatterSyntax public abstract class LogFormatter extends Object

Description LogFormatter is an abstract class that converts log records to formatted strings based on rules that are specified in format( ). The default formatter class, SimpleFormatter, implements this class. All custom formatter classes must:

■ Inherit from the LogFormatter class

■ Implement the format( ) method

■ Be included in the DriverLibraries section of the driver’s configuration file, odaconfig.xml

ConstructorSyntax protected LogFormatter( )

Constructs a LogFormatter object

Method summaryTable 19-21 describes the method for class LogFormatter.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

LogFormatter.formatSyntax public abstract String format(LogRecord record)

Formats the specified log record as a string

Parameters recordThe log record to format

Returns The formatted string

Example public String format(LogRecord record){

Table 19-21 Method for class LogFormatter

Method Description

format( ) Format the specified log record into a string.

Page 551: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 529

L o g F o r m a t t e r . f o r m a t

// <Log Level>: <Time>-<Log Message>String ret = record.getLevel().intValue();ret += ": ";Timestamp stamp = new Timestamp(record.getMillis() );ret += stamp.toString();ret += "-"ret += record.getMessage();ret += "\n";

return ret;}

Page 552: Accessing Data

530 A c c e s s i n g D a t a

L o g g e r

Class LoggerSyntax public class Logger extends Object

Description Logger supports logging messages for an application. Create a logger using LogManager.createLogger( ).

ConstructorSyntax protected Logger(java.lang.String loggerName)

Use LogManager.createLogger instead of this constructor to create a Logger.

Method summaryTable 19-22 lists the methods for class Logger.

Table 19-22 Methods for class Logger

Method Description

config( ) Logs a CONFIG-level message.

fine( ) Logs a FINE-level message.

finer( ) Logs a FINER-level message.

finest( ) Logs a FINEST-level message.

getHandler( ) Gets the associated Handler for this logger.

getLevel( ) Gets the log level that is required to log a message with this Logger.

getName( ) Gets the name of this Logger.

info( ) Logs an INFO-level message.

isLoggable( ) Checks whether this logger can log an error or information at the specified level.

log( ) Logs a message at the specified level.

log( ) Logs an exception at the specified level.

setHandler( ) Sets the Handler for this Logger.

setLevel( ) Sets the level that is required to log messages with this Logger.

severe( ) Logs a SEVERE-level message for an error.

severe( ) Logs a SEVERE-level message for an error or exception.

warning( ) Logs a WARNING-level message.

Page 553: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 531

L o g g e r . c o n f i g

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Logger.configSyntax public void config(java.lang.String message)

Logs a CONFIG-level message

Parameters messageThe message to log

Logger.fineSyntax public void fine(java.lang.String message)

Logs a FINE-level message

Parameters messageThe message to log

Logger.finerSyntax public void finer(java.lang.String message)

Logs a FINER-level message

Parameters messageThe message to log

Logger.finestSyntax public void finest(java.lang.String message)

Logs a FINEST-level message

Parameters messageThe message to log

Page 554: Accessing Data

532 A c c e s s i n g D a t a

L o g g e r . g e t H a n d l e r

Logger.getHandlerSyntax protected Handler getHandler( )

Gets the associated Handler

Returns The associated Handler

Logger.getLevelSyntax public Level getLevel( )

Gets the log level that is specified for the Logger

Returns The associated Level

Logger.getNameSyntax public java.lang.String getName( )

Gets the name of the Logger

Returns The name of the Logger

Logger.isLoggableSyntax public boolean isLoggable(Level level)

Checks whether this logger can log the specified log level. If the Logger’s log level is OFF, no log level is loggable, because OFF is the highest level. For more information, see Class Level, earlier in this chapter.

Returns True if the specified log level is higher or equal to the Logger’s level

Logger.infoSyntax public void info(java.lang.String message)

Logs an INFO-level message

Parameters messageThe message to log

Page 555: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 533

L o g g e r . l o g

Logger.logSyntax public void log(Level level, java.lang.String message)

Logs a message at the specified level

Parameters levelThe log level of the log message

messageThe message to log

Syntax public void log(Level level, java.lang.Throwable thrown)

Logs an error or exception at the specified level

Parameters levelThe log level of the log message

throwableThe error message or exception to log

Logger.setHandlerSyntax protected void setHandler(Handler handler)

Sets the associated Handler

Returns The Handler to use with this Logger

Logger.setLevelSyntax public void setLevel(Level level)

Sets the log level that is specified for the Logger

Returns The log level required to log messages with this Logger

Logger.severeSyntax public void severe(java.lang.String message)

Logs a SEVERE-level error message

Parameters messageThe message to log

Page 556: Accessing Data

534 A c c e s s i n g D a t a

L o g g e r . w a r n i n g

Syntax public void severe(java.lang.Throwable thrown)

Logs a SEVERE-level error message or exception

Parameters thrownThe error or exception to log

Logger.warningSyntax public void warning(java.lang.String message)

Logs a WARNING-level message

Parameters messageThe message to log

Page 557: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 535

L o g g i n g E r r o r H a n d l e r

Class LoggingErrorHandlerSyntax public class LoggingErrorHandler extends Object

Description You can associate a LoggingErrorHandler with a Handler or an instance of a Handler subclass. The LoggingErrorHandler processes any exceptions that occur during logging. Without a LoggingErrorHandler, the log caller is not notified of errors that occur during logging. After you create a LoggingErrorHandler, use Handler.setLoggingErrorHandler( ) to associate the LoggingErrorHandler with the appropriate Handler.

ConstructorSyntax public LoggingErrorHandler( )

Creates a LoggingErrorHandler instance

Field summaryTable 19-23 lists the fields for class LoggingErrorHandler.

Table 19-23 Fields for class LoggingErrorHandler

Field Description

CLOSE_FAILURE A constant that indicates failure while closing an OutputStream.

FLUSH_FAILURE A constant that indicates failure while flushing an OutputStream.

FORMAT_FAILURE A constant that indicates failure while formatting.

GENERIC_FAILURE A constant that indicates a type of failure that is not covered by the other constants.

OPEN_FAILURE A constant that indicates failure while opening an OutputStream.

WRITE_FAILURE A constant that indicates failure while writing an OutputStream.

Page 558: Accessing Data

536 A c c e s s i n g D a t a

L o g g i n g E r r o r H a n d l e r . e r r o r

Method summaryTable 19-24 describes the method for class LoggingErrorHandler.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

LoggingErrorHandler.errorSyntax public void error(java.lang.String message, java.lang.Exception exception, int

errorCode)

Outputs the message, exception, and error code to System.err when a failure occurs. The error code is one of the following constants: CLOSE_FAILURE, FLUSH_FAILURE, FORMAT_FAILURE, GENERIC_FAILURE, OPEN_FAILURE, WRITE_FAILURE. For more information about these constants, see the field summary for this class.

Parameters messageThe error message

errorCodeThe error code constant

exceptionThe exception that caused the Handler to fail

Table 19-24 Methods for class LoggingErrorHandler

Method Description

error( ) Outputs the message, exception, and error code to System.err when a failure occurs.

Page 559: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 537

L o g M a n a g e r

Class LogManagerSyntax public static class LogManager extends Object

Description LogManager is a class to that maintains a set of Loggers. You can use LogManager to create and retrieve Loggers. You can use related classes to log information to the Loggers. To use LogManager, the ODA driver must specify the <TraceLogging> element in its configuration file, odaconfig.xml.

Method summaryTable 19-25 lists the methods for class LogManager.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Table 19-25 Methods for class LogManager

Method Description

createLogger( ) Returns a Logger that has the specified name and necessary log configuration information.

getLogFileName( ) Deprecated. Examine the odaconfig.xml file for the prefix and log directory that was used to create log file names.

getLogger( ) Returns a new Logger that has the specified name and log configuration information or returns an existing Logger that has the specified name and updated log configuration information.

getLogLevel( ) Deprecated. Use Logger.getLevel( ).

logConfig( ) Deprecated. Use Logger.config( ).

logException( ) Deprecated. Use Logger.exception( ).

logFine( ) Deprecated. Use Logger.fine( ).

logFiner( ) Deprecated. Use Logger.finer( ).

logFinest( ) Deprecated. Use Logger.finest( ).

logInfo( ) Deprecated. Use Logger.info( ).

logSevere( ) Deprecated. Use Logger.severe( ).

logWarning( ) Deprecated. Use Logger.warning( ).

setLogConfiguration( ) Deprecated. Use LogManager.getLogger( ).

Page 560: Accessing Data

538 A c c e s s i n g D a t a

L o g M a n a g e r . c r e a t e L o g g e r

LogManager.createLoggerSyntax public Logger createLogger(java.lang.String loggerName, int logLevel,

java.lang.String logDirectory, java.lang.String logPrefix, java.lang.String formatterClassName) throws IllegalArgumentException

Creates a Logger that has the specified name and the specified log configuration information. Specify a name that is appropriate to the application using the log to avoid name collision. Each logger must have a unique name, because the LogManager manages the loggers by name. For example, use javax.sql as the name of a logger for a javax.sql package.

The format of the log file names is <logPrefix>-YYMMDD-hhmmss.log.

If you do not specify a formatterClassName or provide a null value, the default LogFormatter class is used to convert log records to formatted strings. If you create a custom log formatter, the class must inherit from com.actuate.oda.logging.LogFormatter and implement format( ) as specified for LogFormatter.format( ).

Parameters formatterClassNameThe name of the logFormatter class to use

logDirectoryThe directory in which to store the log files

loggerNameThe name of the logger to create

logLevelThe log level that is required for messages to be logged

logPrefixThe required file-name prefix for the log-file name

Returns The created Logger instance

Throws IllegalArgumentException if a Logger of that name already exists

Page 561: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 539

L o g M a n a g e r . g e t L o g g e r

LogManager.getLoggerSyntax public static Logger getLogger(java.lang.String loggerName)

Gets the existing Logger with the specified name

Parameters loggerNameThe name of the logger to create

Returns The Logger instance with the specified name, or null if no Logger with that name exists

Syntax public static Logger getLogger(java.lang.String loggerName, int logLevel, java.lang.String logDirectory, java.lang.String logPrefix, java.lang.String formatterClassName)

If no Logger has the specified name, getLogger( ) creates the Logger with the specified name and log configuration information. If a Logger with the specified name exists, getLogger( ) updates the Logger with the specified log configuration information. The Logger continues to use the same log files unless you specify a different log directory or log prefix.

Parameters formatterClassNameThe name of the logFormatter class to use

logDirectoryThe directory to store the log files

loggerNameThe name of the logger to create

logLevelThe log level that is required for messages to be logged

logPrefixThe required file-name prefix for the log-file name

Returns The created or updated Logger instance that has the specified name

Page 562: Accessing Data

540 A c c e s s i n g D a t a

L o g R e c o r d

Class LogRecordSyntax public class LogRecord extends Object implements Serializable

Description LogRecord contains information that a Logger can log

ConstructorSyntax public LogRecord(Level level, java.lang.String message)

Constructs a LogRecord instance

Parameters levelThe level of the log message

messageThe message to log

Method summaryTable 19-26 lists the methods for class LogRecord.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

LogRecord.getLevelSyntax public Level getLevel( )

Table 19-26 Methods for class LogRecord

Method Description

getLevel( ) Gets the log level.

getMessage( ) Gets the log message.

getMillis( ) Gets the log time.

getThrown( ) Gets the associated error or exception.

setLevel( ) Sets the log level to the specified level.

setMessage( ) Sets the log message to the specified value.

setMillis( ) Sets the log time to the specified value.

setThrown( ) Sets the specified error or exception.

Page 563: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 541

L o g R e c o r d . g e t M e s s a g e

Gets the log level of the log record

Returns A log level instance

LogRecord.getMessageSyntax public String getMessage( )

Gets the log message of the log record

Returns A String that contains the log message

LogRecord.getMillisSyntax public long getMillis( )

Gets the log time of the log record

Returns The log time

LogRecord.getThrownSyntax public java.lang.Throwable getThrown( )

Gets the error or exception of the log record

Returns A Throwable instance for the error or exception

LogRecord.setLevelSyntax public void setLevel(Level level)

Sets the log level for the log record

Parameters levelThe log level

LogRecord.setMessageSyntax public void setMessage(java.lang.String message)

Sets the log message for the log record

Page 564: Accessing Data

542 A c c e s s i n g D a t a

L o g R e c o r d . s e t M i l l i s

Parameters messageThe log message

LogRecord.setMillisSyntax public void setMillis(long millis)

Sets the log time of the log record

Parameters millisThe log time

LogRecord.setThrownSyntax public void setThrown(java.lang.Throwable thrown)

Sets the error or exception for the log record

Parameters thrownThe Throwable for the error or exception

Page 565: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 543

O d a E x c e p t i o n

Class OdaExceptionSyntax public class OdaException extends Exception

Description An exception that provides information about a data source access error or other errors. An open data access exception communicates errors from the data source driver to the Actuate design tool or Actuate iServer. Each OdaException provides the following information:

■ A string that describes the error. This string is the Java Exception message, which you can retrieve using getMessage( ).

■ A SQLSTATE string, which follows the conventions of either XOPEN SQLSTATE or SQL 99. Use IDataSourceMetaData.getSQLStateType( ) to determine whether the driver returns XOPEN or SQL 99.

■ An integer error code that is specific to each vendor. The underlying data source returns this error code.

OdaException inherits from java.lang.Exception.

Externalexceptions

Actuate’s open data access framework recognizes only OdaException and RuntimeException. An open data source implementation can contain code that throws other exceptions, such as ParseException or IOException. To make these types of exceptions available to the Actuate design tool or Actuate iServer, complete the following tasks in this order:

■ Catch the exception.

■ Construct an OdaException.

■ Call OdaException.initCause( ).

■ Pass in the exception.

Localizingexceptions

OdaException provides a basis exception class for describing data source errors but does not provide a mechanism for localizing the messages. An ODA driver must provide its own message localization, if localization is required. The driver can pass localized messages into the OdaException instance or localize the message another way. You can create an exception subclass from OdaException to support message localization. For example, a subclass can have the following constructor:

public MyOdaExceptionSubClass( int errorCode,Locale locale );

MyOdaExceptionSubClass.getLocalizedMessage can look up the error message that is associated with the error number.

Non-supportedoperations

When an ODA driver or data source does not support a capability that a run-time interface exposes, the implementation for the statement setter methods should throw an UnsupportedOperationException. At a minimum, the message of the

Page 566: Accessing Data

544 A c c e s s i n g D a t a

O d a E x c e p t i o n

UnsupportedOperationException should contain the name of the class and method to provide the context of the exception, as shown in the following example:

public class MyStatementClass extends IStatement{

public void setInt( int parameterId, int value ){

// is not supported by this Statement classthrow new UnsupportedOperationException"MyStatementClass.setInt( int parameterId,

int value )" );}

}

ConstructorsSyntax public OdaException( )

Constructs an OdaException object where the message defaults to null, SQLSTATE defaults to null, and vendorCode defaults to 0

Syntax public OdaException(java.lang.String message)

Constructs an OdaException object with a message. The SQLSTATE defaults to null, and vendorCode defaults to 0.

Parameters messageA description of the exception

Syntax public OdaException(java.lang.String message, java.lang.String sqlState)

Constructs an OdaException object with a message and SQLSTATE. The vendorCode defaults to 0.

Parameters messageA description of the exception

sqlStateAn XOPEN or SQL 99 code that identifies the exception

Syntax public OdaException(java.lang.String message, java.lang.String sqlState, int vendorCode)

Constructs a fully specified OdaException object

Parameters messageA description of the exception

sqlStateAn XOPEN or SQL 99 code that identifies the exception

Page 567: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 545

O d a E x c e p t i o n . g e t C a u s e

vendorCodeAn exception code that the data source vendor specifies

Method summaryTable 19-27 lists the methods for class OdaException.

Methods inherited from class java.lang.Throwable

fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

OdaException.getCauseSyntax public java.lang.Throwable getCause( )

Returns the cause of this OdaException or null if the cause is nonexistent or unknown

Overrides getCause in class Throwable

Returns The cause of this OdaException or null if the cause is nonexistent or unknown

Table 19-27 Methods for class OdaException

Method Description

getCause( ) Returns the cause of this OdaException or null if the cause is nonexistent or unknown.

getErrorCode( ) Returns the vendor-specific exception code for this OdaException object.

getNextException( ) Returns the OdaException that is chained to this OdaException object.

getSQLState( ) Returns the SQLSTATE of this OdaException object.

initCause( ) Initializes the cause of this OdaException to the specified value.

setNextException( ) Adds an OdaException object to the end of the OdaException chain.

Page 568: Accessing Data

546 A c c e s s i n g D a t a

O d a E x c e p t i o n . g e t E r r o r C o d e

OdaException.getErrorCodeSyntax public int getErrorCode( )

Returns the vendor-specified exception code for this OdaException object

Returns The vendor’s error code

OdaException.getNextExceptionSyntax public com.actuate.oda.OdaException getNextException( )

Returns the OdaException that is chained to this OdaException object

Returns The next OdaException object in the chain or null if there are none

OdaException.getSQLStateSyntax public java.lang.String getSQLState( )

Returns the SQLSTATE of this OdaException object

Returns The SQLSTATE value

OdaException.initCauseSyntax public java.lang.Throwable initCause(java.lang.Throwable cause)

throws IllegalArgumentException, IllegalStateException

Initializes the cause of this OdaException to the specified value. Call this method only once.

Overrides initCause in class Throwable

Parameters causeThe cause of this OdaException. A null value indicates that the cause is nonexistent or unknown.

Returns A reference to this OdaException

Throws java.lang.IllegalArgumentException if the cause is this OdaException, or IllegalStateException if this method has already been called on this OdaException

Page 569: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 547

O d a E x c e p t i o n . s e t N e x t E x c e p t i o n

OdaException.setNextExceptionSyntax public void setNextException(com.actuate.oda.OdaException nextException)

Adds an OdaException object to the end of the OdaException chain

Parameters nextExceptionThe new OdaException object to add to the OdaException chain

Page 570: Accessing Data

548 A c c e s s i n g D a t a

S i m p l e F o r m a t t e r

Class SimpleFormatterSyntax public class SimpleFormatter extends LogFormatter

Description Formats the information that is provided in the LogRecord

ConstructorSyntax public SimpleFormatter( )

Constructs a SimpleFormatter instance

Method summaryTable 19-28 describes the method for class SimpleFormatter.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

SimpleFormatter.formatSyntax public java.lang.String format(LogRecord record)

Creates a formatted String that contains the information in the LogRecord

Specifiedby

format in class LogFormatter

Parameters recordThe LogRecord to format

Returns The formatted String

Table 19-28 Method for class SimpleFormatter

Method Description

format( ) Creates a formatted String that contains the information in the LogRecord.

Page 571: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 549

S o r t S p e c

Class SortSpecSyntax public class SortSpec extends Object

Description A class that encapsulates one or more sort keys to associate with an IStatement. This association enables an ODA host to dynamically specify how to sort one or more individual result set columns. This ability is particularly useful for data sources that do not accept sorting specifications, such as an ORDER BY clause, in the command text. Sort modes provide information about the types of sorting that are available. You can extend this class to provide additional ways to handle sort modes and keys.

ConstructorSyntax public SortSpec(int sortMode)

Constructs a SortSpec instance that is based on the sortMode. The sort mode can be one of the following constants:

■ sortModeColumnOrder

■ sortModeNone

■ sortModeSingleColumn

■ sortModeSingleOrder

For more information about these constants, see the Field summary section of the IDataSourceMetaData interface.

Parameters sortModeThe sort mode

Field summaryTable 19-29 lists the fields for class SortSpec.

Method summary

Table 19-29 Fields for class SortSpec

Fields Description

sortAsc A constant that indicates ascending sort order.

sortDesc A constant that indicates descending sort order.

Page 572: Accessing Data

550 A c c e s s i n g D a t a

S o r t S p e c . a d d S o r t K e y

Table 19-30 lists the methods for class SortSpec.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

SortSpec.addSortKeySyntax public void addSortKey(java.lang.String columnName, int sortOrder)

Adds a sort key to specify the dynamic sort criteria for ODA providers that support one of the following sort modes:

■ sortModeColumnOrder

■ sortModeNone

■ sortModeSingleColumn

■ sortModeSingleOrder

An IllegalStateException is thrown if the specified sort key does not conform to the sortMode of the SortSpec.

The sort criteria are specified using an ordered list of one or more sort keys. Data is sorted primarily by the first sort key. Within each first sort key value, the data is sorted by the second sort key, and so on. For each sort key, specify the column name and a sort-order constant. Sort-order constants are either sortAsc or sortDesc. For more information about the sort-order constants, see the Field summary section of this class.

Table 19-30 Methods for class SortSpec

Method Description

addSortKey( ) Adds a sort key to specify the dynamic sort criteria.

getSortColumn( ) Returns the result set column name of the sort key at the specified index position.

getSortColumns( ) Returns an array of all column names in the sort keys of a SortSpec instance that has a sortModeSingleOrder sort mode.

getSortKeyCount( ) Returns the number of sort keys that are associated with the SortSpec instance.

getSortMode( ) Returns the sort mode of this SortSpec.

getSortOrder( ) Returns the sort order for a specific sort key or all sort keys of a SortSpec instance.

toString( ) Returns a string representation of the SortSpec.

Page 573: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 551

S o r t S p e c . g e t S o r t C o l u m n

Parameters columnNameThe name of the result set column to sort

sortOrderThe value that represents the sort order

Throws ■ IllegalArgumentException if columnName is empty or if sort order is not one of the sort order constants

■ IllegalStateException in the situations that are described in Table 19-31

■ NullPointerException if columnName is null

SortSpec.getSortColumnSyntax public java.lang.String getSortColumn(int index)

Returns the result set column name of the sort key at the specified index position. The index starts at position one.

Parameters indexThe index of the sort key

Returns The name of the result set column for the specified sort key

Throws IndexOutOfBoundsException if the index is less than one or greater than the number of sort keys

SortSpec.getSortColumnsSyntax public java.lang.String[] getSortColumns

Returns an array of all column names in the sort keys of a SortSpec instance with a sortModeSingleOrder sort mode

Returns An array of column names if the SortSpec instance has sort keys or an empty array if the SortSpec instance does not have sort keys

Table 19-31 Exceptions raised when adding sortMode

sortMode Exception that is raised by attempting to add

sortModeNone Any sort key.

sortModeSingleColumn A second sort key.

sortModeSingleOrder A sort key with a sort order that doesn’t match the sort order of any existing sort keys.

Page 574: Accessing Data

552 A c c e s s i n g D a t a

S o r t S p e c . g e t S o r t K e y C o u n t

Throws IllegalStateException if the mode of the Sort Spec instance is not sortModeSingleOrder

SortSpec.getSortKeyCountSyntax public int getSortKeycount( )

Returns the number of sort keys that are associated with the SortSpec instance

Returns The number of sort keys that are associated with the SortSpec instance

SortSpec.getSortModeSyntax public int getSortMode( )

Returns the sort mode of this SortSpec. The sort mode is one of the IDataSourceMetaData sortMode field values:

■ sortModeColumnOrder

■ sortModeNone

■ sortModeSingleColumn

■ sortModeSingleOrder

Returns Returns the sort mode of the SortSpec

SortSpec.getSortOrderSyntax public int getSortOrder( )

Returns the sort order for all sort keys of a SortSpec instance with sortModeSingleOrder sort mode. Sort order constants are either sortAsc or sortDesc.

Returns The sort order that is specified for the SortSpec instance, or sortAsc if no sort order is specified for the SortSpec instance

Throws IllegalStateException if the mode of the Sort Spec instance is not sortModeSingleOrder

Syntax public int getSortOrder(int index)

Returns the sort order for the sort key at the index position. The index starts at position 1.

Parameters indexThe index position of the sort key

Page 575: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 553

S o r t S p e c . t o S t r i n g

Returns The sort order that is specified for the sort key at the index position

Throws IndexOutOfBoundsException if the index is less than one or greater than the number of sort keys

SortSpec.toStringSyntax public java.lang.String toString( )

Returns a string representation of the SortSpec

Returns A string representation of the SortSpec

Page 576: Accessing Data

554 A c c e s s i n g D a t a

S t r e a m H a n d l e r

Class StreamHandlerSyntax public class StreamHandler extends Handler

Description StreamHandler obtains records from a Logger and outputs them to a stream

ConstructorSyntax public StreamHandler( )

Constructs a StreamHandler with no output stream

Syntax public StreamHandler(OutputStream output, LogFormatter formatter)

Constructs a StreamHandler with the specified output stream and LogFormatter

Parameters formatterThe LogFormatter to use to format the records

outputThe output stream to use to publish records

Method summaryTable 19-32 lists methods for class StreamHandler.

Methods inherited from class com.actuate.oda.util.logging.Handler

getFilter, getFormatter, getLevel, getLoggingErrorHandler, reportError, setFilter, setLevel, setLoggingErrorHandler

Table 19-32 Methods for class StreamHandler

Method Description

close( ) Closes the current StreamHandler and frees up resources that the StreamHandler uses.

finalize( ) Cleans up the StreamHandler by calling StreamHandler.close( ).

flush( ) Flushes the buffered output to the output stream.

isLoggable( ) Checks whether to log the specified record and whether the StreamHandler has an associated output stream.

publish( ) Formats and publishes the specified record.

setFormatter( ) Sets the LogFormatter.

setLevel( ) Sets the Level.

setOutputStream( ) Sets the output stream.

Page 577: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 555

S t r e a m H a n d l e r . c l o s e

Methods inherited from class java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

StreamHandler.closeSyntax public void close( )

Closes the current output stream

StreamHandler.finalizeSyntax public void finalize( )

Cleans up this StreamHandler by calling StreamHandler.close( )

StreamHandler.flushSyntax public void flush( )

Flushes the buffered output to the output stream

Specifiedby

flush in class Handler

StreamHandler.isLoggableSyntax public boolean isLoggable(LogRecord record)

Checks whether to log the specified record by determining whether the record has a sufficiently high log level, the record passes the associated Filter, and the StreamHandler has an associated output stream.

Overrides isLoggable in class Handler

Parameters recordThe log record to check

Returns True to log the record

Page 578: Accessing Data

556 A c c e s s i n g D a t a

S t r e a m H a n d l e r . p u b l i s h

StreamHandler.publishSyntax public void publish(LogRecord record)

Publishes a record to the appropriate destination if it has a sufficiently high log level, passes any associated Filter, and the StreamHandler has an associated output stream. Publish( ) also formats the record, if necessary.

Specifiedby

publish in class Handler

Parameters recordThe log record to format and publish

StreamHandler.setFormatterSyntax public void setFormatter(LogFormatter formatter)

Sets the formatter that will format the log records. If the formatter is null, SimpleFormatter is the default formatter.

Overrides setFormatter in class Handler

Parameters formatterThe formatter to set

StreamHandler.setOutputStreamSyntax public void setOutputStream(OutputStream outStream)

Sets the output stream

Parameters outStreamThe output stream

Page 579: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 557

S t r i n g S u b s t i t u t i o n U t i l

Class StringSubstitutionUtilSyntax public final class StringSubstitutionUtil extends Object

Description StringSubstitutionUtil supports locating embedded delimited strings and replacing them with different strings. Strings can be substituted by index position or by name.

Typically this class is used to identify and replace parameters. For example, if variables are identified by a preceding colon, such as :MyVariable, StringSubstitutionUtil can replace :MyVariable with the string that was defined to replace that variable name.

Method summaryTable 19-33 lists methods for class StringSubstitutionUtil.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

StringSubstitutionUtil.getDelimitedStringCountSyntax public static int getDelimitedStringCount(java.lang.String text, java.lang.String

startDelimiter)

Returns the number of named and unnamed delimited strings in the text argument. An unnamed delimited string consists of only the delimiters. A named delimited string has a start delimiter that is followed immediately by a name and optionally by an end delimiter. Use this syntax if your named delimited string is not marked by an end delimiter. For example, if the start delimiter is ?, ? is an unnamed delimited string, and ?parameter1 is a named delimited string.

Parameters startDelimiterThe string that contains the delimiter

Table 19-33 Methods for class StringSubstitutionUtil

Method Description

getDelimitedStringCount( ) Returns the number of delimited strings in the text argument.

substituteByIndex( ) Substitutes strings based on their index positions.

substituteByName( ) Substitutes strings based on their names.

Page 580: Accessing Data

558 A c c e s s i n g D a t a

textThe string that contains delimited strings

Returns The number of delimited strings

Throws NullPointerException if the text or startDelimiter is null

Example getDelimitedStringCount( ) returns 3 if the startDelimiter is:

":"

and the text is:

"select :param1 , :param2 from :param3"

Syntax public static int getDelimitedStringCount(java.lang.String text, java.lang.String startDelimiter, java.lang.String endDelimiter)

Returns the number of named and unnamed delimited strings in the text argument. An unnamed delimited string consists of only the delimiters. A named delimited string has a start delimiter that is followed immediately by a name and optionally by an end delimiter. Use this syntax if your named delimited strings are labeled by delimiters at the beginning and end of the string to replace. For example, if the start delimiter is ?, and the end delimiter is :, ?: is an unnamed delimited string, and ?parameter1: is a named delimited string.

Parameters endDelimiterThe string that contains the delimiter that marks the end of the string to replace

startDelimiterThe string that contains the delimiter that marks the beginning of the string to replace

textThe string that contains delimited strings

Returns The number of delimited strings

Throws NullPointerException if the text, startDelimiter, or endDelimiter is null

Example getDelimitedStringCount( ) returns 1 if the startDelimiter is:

"<start>"

and the endDelimiter is:

"<end>"

and the text is:

"select <start>param1<end> from CUSTOMER"

Syntax public static int getDelimitedStringCount(java.lang.String text, java.lang.String startDelimiter, boolean requiresNamedDelimiters)

Returns the number of delimited strings in the text argument. An unnamed delimited string consists of only the delimiters. A named delimited string has a

Page 581: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 559

S t r i n g S u b s t i t u t i o n U t i l . g e t D e l i m i t e d S t r i n g C o u n t

start delimiter that is followed immediately by a name and optionally by an end delimiter. Use this syntax if your named delimited strings are labeled only by a start delimiter. For example, if the start delimiter is ?, ? is an unnamed delimited string, and ?parameter1 is a named delimited string.

If requiresNamedDelimiters is true, it returns the number of named delimited strings. Otherwise, it returns the number of named and unnamed delimited strings.

Parameters startDelimiterThe string that contains the delimiter

textThe string that contains delimited strings

Returns The number of delimited strings

Throws NullPointerException if the text or startDelimiter is null

Example getDelimitedStringCount( ) returns 3 if the startDelimiter is:

":"

and the text is:

"select :param1 , :param2 from :param3"

Syntax public static int getDelimitedStringCount(java.lang.String text, java.lang.String startDelimiter, java.lang.String endDelimiter, boolean requiresNamedDelimiters)

Returns the number of delimited strings in the text argument. An unnamed delimited string consists of only the delimiters. A named delimited string has a start delimiter that is followed immediately by a name and optionally by an end delimiter. Use this syntax if your named delimited strings are labeled by delimiters at the beginning and end of the string to replace. For example, if the start delimiter is ? and the end delimiter is :, ?: is an unnamed delimited string, and ?parameter1: is a named delimited string.

If requiresNamedDelimiters is true, it returns the number of named delimited strings. Otherwise, it returns the number of named and unnamed delimited strings.

Parameters endDelimiterThe string that contains the delimiter that marks the end of the string to replace

startDelimiterThe string that contains the delimiter that marks the beginning of the string to replace

textThe string that contains delimited strings

Returns The number of delimited strings

Page 582: Accessing Data

560 A c c e s s i n g D a t a

S t r i n g S u b s t i t u t i o n U t i l . s u b s t i t u t e B y I n d e x

Throws NullPointerException if the text, startDelimiter, or endDelimiter is null

Example getDelimitedStringCount( ) returns 1 if the startDelimiter is:

"<start>"

and the endDelimiter is:

"<end>"

and the text is:

"select <start>param1<end> from CUSTOMER"

StringSubstitutionUtil.substituteByIndexSyntax public static java.lang.String substituteByIndex(java.lang.String text,

java.lang.String startDelimiter, List substitutionList)

Finds strings that are marked by a start delimiter, and substitutes them based on their position in the text. Each string is replaced by the corresponding string in the indexed substitution list. A startDelimiter cannot be preceded by an alphanumeric character, an underscore, or an escape character.

Parameters startDelimiterThe string that contains the delimiter that marks the beginning of the string to replace

substitutionListThe list of values to substitute for the delimited strings

textThe string that contains delimited strings

Returns A String that contains the text with all delimited strings substituted

Throws NullPointerException if the text, startDelimiter, or substitutionList is null

Example If myList contains "ID" and "NAME":substituteByIndex("SELECT STUDENT.:COLUMN, STUDENT.:COLUMN FROM

STUDENT", ":", MyList)

returns:

"SELECT STUDENT.ID, STUDENT.NAME FROM STUDENT"

Example If myList contains "1000" and "2000":substituteByIndex("SELECT ID FROM CUSTOMER WHERE ID >=

:startRange AND ID <= :endRange", ":", MyList)

returns:

"SELECT ID FROM CUSTOMER WHERE ID >= 1000 AND ID <= 2000"

Page 583: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 561

S t r i n g S u b s t i t u t i o n U t i l . s u b s t i t u t e B y N a m e

Syntax public static java.lang.String substituteByIndex(java.lang.String text, java.lang.String startDelimiter, java.lang.String endDelimiter, List substitutionList)

Finds the beginning and end of strings that are marked by delimiters, and substitutes them based on their position in the text

Parameters endDelimiterThe string that contains the delimiter that marks the end of the string to replace

startDelimiterThe string that contains the delimiter that marks the beginning of the string to replace

substitutionListThe list of values to substitute for the delimited strings

textThe string that contains delimited strings

Returns A String that contains the text with all delimited strings substituted

Throws NullPointerException if the text, startDelimiter, endDelimiter, or substitutionList is null

Example If myList contains "STUDENT" and "NAME":

substituteByIndex("SELECT <start>TABLE<end>.<start>COLUMN<end> FROM STUDENT", "<start>","<end>", myList)

returns:

"SELECT STUDENT.NAME FROM STUDENT"

Example If myList contains "1000":

substituteByIndex("SELECT ID FROM CUSTOMER WHERE ID = <start>number<end>", "<start>","<end>", myList)

returns:

"SELECT ID FROM CUSTOMER WHERE ID = 1000"

StringSubstitutionUtil.substituteByNameSyntax public static java.lang.String substituteByName(java.lang.String text,

java.lang.String startDelimiter, Map nameValues)

Finds strings that are marked by a start delimiter, and substitutes them based on their name

Parameters nameValuesThe map of pairs of names and values to use in substituting strings

Page 584: Accessing Data

562 A c c e s s i n g D a t a

S t r i n g S u b s t i t u t i o n U t i l . s u b s t i t u t e B y N a m e

startDelimiterThe string that contains the delimiter that marks the beginning of the string to replace

textThe string that contains delimited strings

Returns A String that contains the text with all delimited strings substituted

Throws NullPointerException if the text, startDelimiter, or nameValues is null

Example If myMap specifies the following pairs:

PARAM, "PEOPLE"PARAM1, "NAME"

then:

substituteByName("SELECT ?PARAM.?PARAM1 FROM ?PARAM","?", myMap)

returns:

"SELECT PEOPLE.NAME FROM PEOPLE"

Example If myMap specifies the following pairs:

startRange, "1000"endRange, "2000"

then:

substituteByName("SELECT ID FROM CUSTOMER WHERE ID >= :startRange AND ID <= :endRange",":", myMap)

returns:

"SELECT ID FROM CUSTOMER WHERE ID >= 1000 AND ID <= 2000"

Syntax public static java.lang.String substituteByName(java.lang.String text, java.lang.String startDelimiter, java.lang.String endDelimiter, Map nameValues)

Finds the beginning and end of strings that are marked by delimiters, and substitutes them based on their name

Parameters endDelimiterThe string that contains the delimiter that marks the end of the string to replace

nameValuesThe map of pairs of names and values to use in substituting strings

startDelimiterThe string that contains the delimiter that marks the beginning of the string to replace

Page 585: Accessing Data

C h a p t e r 1 9 , C u s t o m d a t a d r i v e r J a v a r e f e r e n c e 563

S t r i n g S u b s t i t u t i o n U t i l . s u b s t i t u t e B y N a m e

textThe string that contains delimited strings

Returns A String that contains the text with all delimited strings substituted

Throws NullPointerException if the text, startDelimiter, endDelimiter, or nameValues is null

Example If myMap specifies the following pairs:

PARAM, "PEOPLE"PARAM1, "NAME"

then:

substituteByName("SELECT :PARAM:.:PARAM1: FROM :PARAM:", ":", ":", myMap)

returns:

"SELECT PEOPLE.NAME FROM PEOPLE"

Example If myMap specifies the following pair:

number, "1000"

then:

substituteByName("SELECT ID FROM CUSTOMER WHERE ID = <start>number<end> AND SID = <start>number<end>","<start>","<end>", myMap)

returns:

"SELECT ID FROM CUSTOMER WHERE ID = 1000 AND SID <= 1000"

Page 586: Accessing Data

564 A c c e s s i n g D a t a

S t r i n g S u b s t i t u t i o n U t i l . s u b s t i t u t e B y N a m e

Page 587: Accessing Data

I n d e x 565

IndexSymbols" (double quotation mark) character

column aliases and 304CSV text files and 78QBE expressions and 315SQL identifiers and 346, 352

% (percent) character 364* (asterisk) character

parameters and 137query statements and 133

* operator 359+ operator 359, (comma) character 78, 315. (period) character 312, 323/ (forward slash) character 352/ operator 359: (colon) character 150

parameter names and 312query statements and 151, 155SAP Variables and 244

:? operator 301; (semicolon) character 244= operator 306, 307? (question mark) character 155[ ] (brackets) characters

MDX queries and 253SAP Variables and 244

\ (backslash) character 364_ (underscore) character 364| (pipe sign) character 315|| operator 363– operator 359’ (single quotation mark) character

parameters and 323queries and 346

Aabsolute method 505absolute paths 18AC_CDA_LOG_LEVEL variable 256Access databases 167accessing

Column Editor 68, 70, 140custom data sources 40data 4, 5, 30, 34, 90Data Row Editor 63, 139Database Browser 106databases 176Expression Builder 304expression builder 119, 126Information Object Query Builder 292information objects 289multiple input sources 31, 48, 53multiple result sets 199–203ODA configurations 392ODA data sources 386, 387, 388, 422ODBC data sources 91Prompt editor 325Properties page 60Query Editor 106resources 12sample configurations 15sample ODA driver 386SAP BW BEx Query Builder 221SAP BW data sources 210SAP BW data streams 255, 256SAP BW InfoProviders 221SAP documentation 214, 223SAP R/3 data sources 266, 284Scratch Pad 60SQL editor 331Stored Procedure Data Source Builder 180Stored Procedure Name Editor 182stored procedures 176, 195Textual Query Editor 131

AcConnection class 100AcDataAdapter class 33, 35AcDataRowBuffer class 35AcDataSorter class 42AcDataSource class 40, 78AcDB2Connection class 100AcDBConnection class 100AcDBCursor class 100AcDBStatement class 100AcMultipleInputFilter class 35, 48

Page 588: Accessing Data

566 A c c e s s i n g D a t a

AcOdaConnection class 386, 402AcOdaInterfaces.jar 391AcOdaSource class 386, 402AcODBCConnection class 100AcOracleConnection class 100AcSAPRfmSource class 280AcSingleInputFilter class 35AcSQLQuerySource class 163AcSqlQuerySource class 161AcTextQuerySource class 161Actuate Basic

accessing stored procedures with 194–203creating locale-specific reports and 429customizing data sources and 41developing with 30implementing custom drivers with 386mapping variable types for 195throwing errors and 543

Actuate Data Integration Service Connection option 289, 290

Actuate Data Integration Service Data Source option 289, 291

Actuate Foundation Class Library 30Actuate Foundation Classes 100

See also classesActuate SQL 340, 345

See also SQL statementsActuate SQL compiler 309Actuate SQL data types 355, 356Actuate SQL expressions. See SQL

expressionsActuate SQL grammar 345, 346Actuate SQL identifiers 352Actuate SQL keywords 351ad hoc data access 288ad hoc data filters

See also information objectsapplying 430defining conditions for 313, 319, 321deleting 313, 322

ad hoc parametersSee also ad hoc data filtersadding to queries 154, 155, 156, 347assigning values to 125, 311, 319changing properties for 154creating 153, 155filtering data with 154, 155

naming 155, 156restrictions for 189setting properties for 156–157viewing properties for 156

add method 505Add new slice to Group dialog box 253Add to new group command 252adding

aggregate functions 119, 121, 371columns

to data rows 70to designs 65to queries 116, 119, 132, 352

components 6, 97conditions

to filters. See filter conditionsto queries 123–129, 151, 154, 155

configuration files to designs 17connections 5, 8, 25, 96controls to frames 184custom data source builders 387custom data sources 40, 79data filters 49, 50, 51, 53data row variables 39, 65data sources 25default connections 20, 22dynamic filters 314–316formulas 118, 119, 121functions to expressions 295functions to queries 341libraries to configurations 386ODA drivers 386parameters to expressions 150parameters to queries 323, 341, 356sorting criteria 42, 43, 550stored procedures 177–179, 183tables to queries 109, 112, 341titles to reports 148

addition operator 359AdditiveExpression declaration (SQL) 347addSortKey method 550AddToDriver property 408Adhoc Conditions page (Textual Query

Editor) 156Adhoc Parameters page (Textual Query

Editor) 156AdHocParameter declaration (SQL) 347

Page 589: Accessing Data

I n d e x 567

Advanced Properties icon 73AFC. See Actuate Foundation Classesaggregate column names 128aggregate columns 319aggregate conditions 123aggregate controls 38aggregate expressions 120, 121, 320, 321, 347aggregate filters 319

creating 319defining conditions for 320, 321, 322removing conditions for 321, 322

aggregate functionsadding to queries 121, 371creating computed fields and 119matching character patterns and 341restrictions for 344summarizing data and 121

aggregate rowsadding to queries 119creating 120–123removing columns from 122removing conditions on 128, 129selecting columns for 120, 122setting conditions for 123, 125, 127–129

aggregation 35, 225AggrExpression declaration (SQL) 347AIS connections 289, 290

See also Integration serviceAIS data sources 289, 291Alias attribute (configurations) 20Alias Name dialog box 109aliases

column names and 304, 306, 332references to 344restrictions for 332SQL queries and 352table names and 110, 112, 332

alignment 432alignment values 432ALL constant 524ALL_LEVEL constant 525AllocateCursor method 100, 195Alphabetical view (SAP data sources) 268alternate character sets 189alternate names 106

See also aliases; display namesalternative data types 407, 413

AlternativeOdaDataTypes element 413AlternativeOdaDataTypes type 404Analysis Type property 305AND operator

Boolean values 362filter conditions 311, 319join conditions 306

AndExpression declaration (SQL) 347ANSI SQL extensions 341ANSI SQL standards 340application logger 530application servers 208, 210

See also serversapplications

installing custom drivers and 422logging messages for 530ODA data sources and 388providing column information for 425

ApplicationServer property 208, 210applyIndexing pragma 380arguments. See parametersArguments element 409arithmetic operators 359ArrayOfInputFieldDefinition type 422ArrayOfInputParameterDefinition type 423ArrayOfNameValuePair type 423ArrayOfOutputFieldDefinition type 423ArrayOfOutputParameterDefinition

type 424ArrayOfProperty type 424ArrayOfResultColumn type 424ArrayOfString type 405, 425arrays

input field definitions and 422input parameter definitions and 423name-value property pairs and 424output field definitions and 423output parameter definitions and 424result set columns and 424string elements and 405, 423, 425

ASC keyword (MDX queries) 246ascending sort order 246, 549ASCII text files. See text filesasterisk (*) character

parameters and 137query statements and 133

attributes. See properties

Page 590: Accessing Data

568 A c c e s s i n g D a t a

Auto Contents group (Properties page) 74, 337

Auto Joins command 109Automatic element 432AutoSort value 42averages 371AVG function 371axes

See also MDX queriesadding attributes to 225, 228adding cross-products to 229–230building data sets for 226changing type 232creating 225–228defining multiple 227deleting 236, 245, 248filtering values on 247, 248, 249, 251including empty members in 233, 236laying out reports and 239–242moving 232removing cross-products from 230, 231restricting members returned for 247selecting data for 225sorting values on 245, 246, 247

Axes page (SAP BW BEx Query Builder)accessing 226defining cross-products on 229defining SAP BW axes on 226filtering empty members on 236laying out reports and 239moving axes on 232removing cross-products on 231removing data sets on 237removing properties on 238removing SAP BW axes and 236

axis (defined) 220Axis element 442AxisType element 426AxisType type 425

Bbacking up report files 166backslash (\) character 364balloon help 443BAPI data sources

See also SAP R/3 data sourceschanging parameters for 275

connecting to 284developing queries for 462displaying information about 272displaying parameters for 273, 274locating 268, 269, 270selecting 268

BapiAxisDataFetchSize property 256, 258BapiFsDataFetchSize property 256, 258BAPIs (business object APIs) 255, 256, 257

See also BAPI data sourcesBASC keyword (MDX queries) 246base64 encoding 447BDESC keyword (MDX queries) 246BETWEEN operator 358BEx queries. See MDX queries; SAP BW BEx

Query BuilderBigDecimal values 506, 518binary large object values. See BLOB valuesbinary streams 459BindColumn method 195BindDataRow method 243, 264BindParameter method 164Blank Report option 259blank values 137BLOB data type 459Blob element

OdaDataType type 438OdaScalarDataType type 439

BLOB values 459, 460, 464, 494Blocked layout style 241Boolean values 362

See also conditional expressionsbrackets ([ ]) characters

MDX queries and 253SAP Variables and 244

Browser page (SAP R/3 Data Source Builder) 268, 271, 272, 273

buffered output 555Builder icon 119BuildFromRow method 38building reports. See creating reports;

designing reportsbusiness names (MDX queries) 223, 224business object APIs. See BAPIsbusiness objects

See also BAPI data sourceschanging parameters for 275

Page 591: Accessing Data

I n d e x 569

connecting to 284controlling execution of 284displaying 268, 269finding 268, 269, 270, 271viewing information about 272viewing parameters in 273, 274

Business Warehouses. See SAP BW data sources

BwBapiAxisDataFetchSize property 256, 257BwBapiFsDataFetchSize property 256, 257By Filter setting 144By Query setting 144

Ccalculated columns or fields. See computed

fieldscalculations

aggregate rows and 120, 121computed fields and 39, 118limitations for 356queries and 359

CanSeek method 35CanSortDynamically method 41, 42cardinality (joins) 310, 377CardinalityType declaration (SQL) 347case conversion functions 363case conversions 105, 363case sensitivity

Actuate SQL keywords 351custom driver names 394parameter names 153string comparisons 105, 357

CASE statements 347CaseExpression declaration (SQL) 347case-insensitive comparisons 357cast expressions 356CAST keyword 356CAST statements 347CastExpression declaration (SQL) 347casting rules 356Category Path property 305CEILING function 360cells (data cubes) 220Center element 432Change Column Used dialog box 172changes

committing 474

rolling back 284, 476undoing 132

changingbusiness object parameters 275column aliases 304column names 139, 172connections 24data row variables 62, 65data sources 25default data processing 30default display lengths 105, 141display names 139file paths 168fonts 73, 335, 336formulas 119graphical queries 115, 162JVM heap size 255MDX queries 236ODA connection properties 389ODA driver configurations 387, 397parameter properties 329result sets 138–141SAP parameters 279, 281stored procedure names 182table names 171textual queries 132, 134, 162

CHAR_LENGTH function 363CHAR_LITERAL token (SQL) 346character conversions 363character large object values. See CLOB

valuescharacter matching 315, 341, 364character sets 189character strings. See stringscharacters

column aliases and 304CSV text files and 78display names and unsupported 66filter conditions and 314limits in string expressions 119, 121literal text and 346parameter values and 341query statements and 315SQL identifiers and 346truncated 66

charts 34, 38, 255check boxes 435

Page 592: Accessing Data

570 A c c e s s i n g D a t a

Check Stored Procedure setting 188Choose Axis for Order Clause dialog box 246Choose Axis to Filter on dialog box 248, 250Choose Database page 20, 25Choose Layout Style page 239class files 391class libraries 30class loader conflicts 411Class Variable dialog box 51, 79, 81, 262class variables 262, 263classes

connection components and 100custom drivers and 450data row components and 36design components and 30development environment for 30ODA drivers and 386, 387, 390, 391ODA Java reference for 451reusing 386

ClassName property 408CLASSPATHs 410clear method 505Clear Query icon 133, 254clearInParameters method 513client software 8, 95Clipboard 131CLOB data type 460Clob element

OdaDataType type 438OdaScalarDataType type 439

CLOB values 461, 465, 494close method

FileHandler 453Handler 456IConnection 474IResultSet 493IStatement 513StreamHandler 555

CLOSE_FAILURE constant 535closing

connections 100, 474data adapters 34files 34Information Object Query Builder 293input adapters 36output streams 555SAP BW BEx Query Builder 217, 254

SAP R/3 Data Source Builder 268statements 513text files 84

codeSee also Actuate Basicaccessing text files and 5, 83creating locale-specific reports and 429customizing data streams and 34executing stored procedures and 199filtering data and 46, 49implementing custom drivers with 386referencing column names in 105, 141sorting data and 43throwing errors and 543verifying input values with 154

code points 357collections

adding rows to 504, 505getting data source objects for 484getting size 510removing elements in 505testing for elements in 506

colon (:) character 150parameter names and 312query statements and 151, 155SAP Variables and 244

column aliaseschanging 304information objects and 306restrictions for 332SQL queries and 352

column axes 225, 227, 229See also axes; MDX queries

Column command 227Column Editor

accessing 68, 70changing columns with 68changing queries and 140overview 65setting column attributes in 66, 70

column headers 184column headings

data rows and 66result sets and 443SAP BW reports and 225

Column Name property 156column names

Page 593: Accessing Data

I n d e x 571

See also column aliasesassociating with parameters 156changing for query results 139, 172converting to expressions 307creating information objects and 306defaults for 63defining joins with 113entering in SQL statements 154, 156, 352getting 66, 141, 501, 502, 551locating table-specific 172prompting for input and 154, 155referencing in code 105setting fonts for 73, 336truncated 58

"Column not found" message 172Column Property page (Query Editor) 119Column Qualifiers command 107column widths 66, 110ColumnAlias declaration (SQL) 347Columnar layout style 240columnar report layouts 426ColumnAxisInfo type 425columnNoNulls constant 500columnNullable constant 500columnNullableUnknown constant 500columns

See also fields; output columnsadding

to data row components 70to queries 116, 119, 132, 352to reports 65

applying conditions to 123binding to data row variables 36, 195changing data types for 138, 141changing order of 319changing properties for 67, 141creating computed. See computed fieldscreating SAP BW crosstabs and 241, 242defaults for 58deleting from data rows 72deleting from queries 117, 122determining axis type 425displaying data in 110, 117entering formulas in 118, 119, 121filtering on 310, 314, 430freezing 110getting date values for 495

getting decimal precision for 503getting decimal values in 493getting display lengths for 501getting index of 493getting number of 501getting numeric values for 495, 496getting sort key 551getting string values for 497getting time values in 498getting type 502grouping on 122, 318joining information objects and 306joining tables and 112, 114missing in SAP BW result sets 243naming. See column headings; column

namesreferencing 136, 141, 172, 341renaming stored procedures and 182reordering 62, 63, 119resizing 66, 105, 110, 141returning from

queries 105, 133result sets 424, 425, 441, 444SAP data sources 279stored procedures 182, 188, 199text files 81, 83

selecting multiple 116setting dates for 507setting decimal values for 506setting display lengths for 62, 443setting numeric values for 507, 508setting string values for 509setting time values for 509, 510setting unique values for 114setting values at run time 149sorting data in 317, 469, 549sorting on 45, 121, 143, 144summarizing data and 120synchronizing queries and 104testing for null values in 305, 500, 503trimming trailing spaces in 105updating query 171

Columns page (Information Object Query Builder) 303

Columns page (Query Editor) 116, 118, 119, 120, 121

Columns page (SQL editor) 332

Page 594: Accessing Data

572 A c c e s s i n g D a t a

Columns page (Textual Query Editor) 141COM interfaces 220comma (,) character 78, 315Command element 389, 427command line arguments (ODA drivers) 388,

409, 422comma-separated values files. See CSV filescomments 352commit method 474Compare method 45CompareKeys method 46comparison operators 358comparisons 46, 105, 357, 358compiler 309Complex type (SAP Variables) 244component libraries 25Component Object Models. See COM

interfacescomponent palettes. See ToolboxComponent Properties dialog box 9components

See also specific typeaccessing data and 5adding 6, 97developing 30instantiating 33publishing 7referencing 25, 33saving 60subclassing 25

computed columns. See computed fieldscomputed data row variables 39, 65, 66, 67Computed Field command 118computed fields 305, 318

building expressions for 67, 119changing attributes of 65creating 39, 116, 118–119defining for information objects 374deleting 123entering expressions for 305grouping on 318naming 118restrictions for 374setting conditions for 128sorting on 317

computed values. See calculationsconcatenation 346, 363

concatenation operator 363Conceal Value property 327concurrent connections 8CondExpr declaration (SQL) 347Condition command 248conditional expressions 155, 347, 350

See also Boolean valuesconditional sections 7, 60ConditionalPrimary declaration (SQL) 347conditions

See also filter conditionsadding to queries 123–129aggregating data and 123, 127, 128, 129applying at run time 127creating joins and 306defining output columns and 303deleting from queries 126, 127, 128, 129joins and 306placing on row retrieval 123, 126, 127queries and 314removing join 308running stored procedures and 189

Conditions page (Query Editor)defining ad hoc parameters on 154defining conditions on 125, 126deleting conditions from 126, 127

CONFIG constant 525CONFIG level messages 531config method 531CONFIG_LEVEL constant 525ConfigKey property 24Configuration file for connections

parameter 23configuration files

See also configurationsaccessing ODA 392accessing sample 15adding data sources to 396changing 387, 397creating 15, 393, 396defining schemas for 397elements in 16, 19, 23, 24including in designs 17installing 387, 396loading 387, 393overview 12removing from designs 14

Page 595: Accessing Data

I n d e x 573

selecting 13setting connections and 15, 20, 23setting run-time connections and 23specifying data sources in 25specifying paths for 18updating 387

configurationsflat file data sources and 402localized databases and 92ODA data sources and 387, 388, 392, 393ODA drivers and 387, 396, 414ODA log files and 418, 477ODBC data sources and 91, 92predefined data sources and 25, 396SAP data sources and 208, 209, 266SAP GUI clients 208SAP R/3 data streams 266

conjunction 362connection classes 100, 387connection components

See also connectionsadding to configuration files 25adding to designs 7–8, 20, 22, 96changing functionality of 30defined 5instantiating 30omitting 5, 7placing in data streams 6, 30placing in sections 5, 7, 30redefining methods for 30setting fetch size properties for 257

Connection element 19, 414connection factories 476connection information 8, 95, 100connection interface 473Connection slot 5, 8, 26, 96connection strings 91Connection type 405ConnectionProperties type 426connections

See also connection componentsaccessing

custom data sources and 40databases and 7, 95, 96information objects and 289ODA data sources and 387, 388, 473ODBC data sources and 91, 95, 96

SAP BW data and 210, 215, 260SAP data sources and 222, 267, 284text file data sources and 5, 79

changing 24, 389closing 100, 474creating 8–9, 12, 30, 90, 290customizing 30defining multiple 7, 23deploying executable files and 7determining if opened 476displaying 9, 178failing 100generating queries and 106, 133, 167generating reports and 5getting definitions for 429getting instances of 477, 479, 484getting metadata for 475getting number of active 480getting number of statements for 480inheriting 7installing database clients for 95installing ODA drivers and 386, 405, 478opening 30, 476overriding 12overview 7–8precedence for 7, 23properties files and 12selecting 25, 30, 97setting properties for 9, 95, 97, 209, 426sharing 7specifying default 20, 23specifying run-time 23verifying 167

ConnectOptions element (configurations) 23Content frames 183Content slot 183context menus 132ContinueBuilding value 38control strings (units of time) 367control type constants (input) 328, 433, 435control types 328, 329ControlCheckBox value 435ControlList value 433, 435ControlListAllowNew value 433, 435ControlRadioButton value 435controls

See also specific type

Page 596: Accessing Data

574 A c c e s s i n g D a t a

adding to frames 184changing data row types and 66prompting for input and 314, 316, 324,

433, 435setting values for 38

ControlTextBox value 433, 435ControlType element 435conversions 407converting character case 363converting graphical queries to textual 134–

136, 162copying

query statements 131report files 166

copyright information 419CopyrightNotice element 419cost-based optimization (joins) 378–380, 381COUNT function 371, 376counting non-null values 371CPointer data type 199, 200crashes 255Create New Data Source dialog box 93createLogger method 392, 538createStatement method 475creating

aggregate expressions 120, 121aggregate filters 319, 320, 321, 322aggregate rows 120–123application logger 530class variables 262computed data row variables 39computed fields 39, 116, 118–119conditional expressions 128, 129configuration files 15, 393, 396connections 8–9, 30, 90crosstabs 225, 241, 242custom data source builder 387custom data sources 40, 47, 79, 396custom drivers 386, 450data adapters 31, 33, 36data filters 50data rows 36database cursors 195dynamic data filters 314–316executable files 59graphical queries 99, 105input filters 49

input parameters 195, 434joins 112, 113, 306–308, 309list of values 314, 316MDX queries 220, 221, 223, 226multi-table reports 50ODA drivers 386ODBC data sources 91ODS data sources 261Oracle stored functions 189Oracle stored procedures 188, 189output parameters 195, 440parameterized queries 341, 356predefined connections 12predefined data sources 25, 396query data sources 97–99report parameters 148, 153report titles 148SAP login configurations 208, 209, 215sort filters 45, 144SQL queries. See queriesstatement objects 475subqueries 354–355summary data 120, 121textual queries 99, 104, 131–134union filters 53

criteria. See conditionscross tabulation. See crosstabsCrossjoin with Set… command 229cross-products 229–232, 238

See also MDX queriescrosstab headings 225Crosstab layout style 241crosstabs

defining default layout for 426SAP BW data sources and 241, 242

CSV filesaccessing data in 78closing 84customizing data sources for 79defining data row variables for 81displaying data from 83, 85opening 84retrieving data from 83

cubes. See data cubesCurrency data type 196current date and time 368CURRENT_DATE function 368

Page 597: Accessing Data

I n d e x 575

CURRENT_TIMESTAMP function 368CURRENT_USER function 311, 372cursor parameters 190cursor variables

fetching rows from 202output parameters as 199restrictions for 200returning from stored functions 189types described 199

cursorsassociating with class variables 263closing 493creating 195defined 100executing queries and 164moving 499, 505, 506, 516opening 34setting position of 491

custom data drivers 386custom data sources 40, 47, 79

See also ODA data sourcesCustom From Clause command 115Custom FROM Clause dialog box 116customizing

connections 30data drivers 386, 422, 450data filters 34, 36, 49data rows 36, 37data sources 40, 47, 78, 396, 406data streams 7, 33–35default data processing 30ODA data source builder 387queries 115, 164, 300reports 30stored procedures 194–203

Ddata

See also valuesaccessing 4, 5, 30, 34, 90aligning 432changing default processing for 30, 34combining from multiple rows 120customizing drivers for 386, 450defining default alignment for 432displaying 58, 110, 117filtering. See filtering data; filters

formatting. See formats; formattinggrouping 318, 344presorting 43, 44, 144previewing 110, 117, 160, 334removing conditions on 126, 127retrieving from

custom data streams 34databases 90external data sources 35information objects 289, 293multiple data sources 48ODA data sources 389, 390ODBC data sources 90, 148predefined data sources 9SAP BW data sources 210, 217, 223, 255SAP BW InfoProviders 222, 247SAP BW ODS data streams 259–264SAP R/3 data sources 266, 267, 268, 284stored procedures 90, 131, 183, 195, 197text files 78, 83

retrieving with conditions 123, 125, 126, 151

returning specific values for 149, 150selecting 9, 34, 123sorting. See sorting datasummarizing 119, 120–123, 371

data adapter components 6data adapters

accessing multiple 48accessing non-sequential streams and 35changing input records from 34closing 34creating data rows and 36creating input filters for 35, 49instantiating 31, 33, 36opening 34, 36sorting data and 45

Data command 106data components 6

See also components; datadata controls 37, 38

See also controls; datadata cube slices 220data cubes

building queries for 220, 229, 243generating 251removing empty members from 235

Page 598: Accessing Data

576 A c c e s s i n g D a t a

specifying slices for 251–253data dictionary 112, 165, 168data filter classes 35data filter components

adding to data streams 31, 35adding to designs 47, 49as transient objects 31changing methods for 33defined 6

data filtersadding to queries 314aggregating data and 319, 321, 322creating dynamic 314–316defining parameters as 148, 249, 311getting 456placing on information objects 311, 315predefining 311prompting for input and 314, 316removing ad hoc 313removing aggregate 321, 322removing dynamic 313removing static 312setting at run time 148, 247, 248, 344setting control type for 316setting default values for 316setting log handler 458

Data Integration Option 48Data Integration Service Connection

option 289, 290Data Integration Service Data Source

option 289, 291data object executable files 59

See also information objectsData Preview page (Information Object

Query Builder) 302, 334data providers 220

See also SAP BW InfoProvidersdata row components

See also rowsadding to designs 97, 98, 262as transient objects 31customizing 37defined 6displaying 63placing variables in 65

Data Row Editoraccessing 63

changing column properties from 67changing display names and 139displaying data rows with 63removing columns with 72reordering columns from 63selecting columns with 70

Data Row Editor command 63data row objects 36, 195

See also rowsdata row variables

adding to designs 65binding columns to 36, 195changing 65creating computed fields with 39, 65, 116defined 36defining for

custom data sources 34, 41SAP BW ODS data sources 259, 262, 263text file data sources 81

displaying 63, 141getting column names for 501setting column attributes for 66setting data types for 66viewing attributes of 65

data rows. See rowsdata sets

See also result setsadding measures to 226building for

SAP BW data sources 225, 226combining 229defined 220deleting 237including empty members in 233, 236placing cross-products in 229–230removing cross-products and 230, 231removing empty members in 235removing properties for 238specifying slices for 251

data source builder. See ODA data source builder

Data Source command 221data source components

See also data sourcesadding to configuration files 25adding to report sections 100as transient objects 31

Page 599: Accessing Data

I n d e x 577

changing methods for 33defined 6publishing 7subclassing 25

data source names 91, 92, 95, 485data source variables 62data sources

See also data source components; databases; specific type

accessing 40, 54, 386adding to configuration files 396adding to table names 107changing 25combining data from multiple 48, 50, 51committing changes to 474configuring connections for 19, 20, 24connecting to. See connectionscreating custom drivers for 386, 422, 450creating data streams for 7, 31creating query 97–99creating sort filters for 42, 45, 142customizing 40, 47, 78, 396, 406defining information objects as 289, 291defining joins and 306, 309defining stored procedures as 178determining parameter type for 486, 487displaying data rows in 58, 60, 62displaying system 93getting collections of 484getting information about 481getting type 490getting version of 484, 485handling errors for 543installing client software for 8limiting data returned by 46maintaining query information for 160,

163mapping data types to 138predefining 25, 396querying remote 358, 359referencing 167retrieving data from 5, 6, 9, 35, 48retrieving input records from 36returning sort mode for 485selecting 386, 396setting properties for 21, 24sorting data and 41, 42, 43

synchronizing queries and 104, 163, 168, 171

updating 163verifying connections for 167

data stores 259data stream components 6, 98, 387, 388, 422data stream definition files 388data stream definitions 389, 426, 429data stream slots 96data stream types 428data streams

accessingSAP BW data and 214, 221, 255, 256SAP BW ODS data sources and 259SAP R/3 data and 266stored procedures and 177

adding connection components to 6, 30adding multiple data adapters to 33building 31creating custom data sources for 40, 79,

388creating SQL queries and 97customizing 7, 33–35filtering data in 46, 47, 49retrieving data and 5, 34setting properties for 389, 426sorting data in 43

data structures 504Data Toolbox 6Data Type property 305, 327data types

accessing multiple data sources and 51, 54accessing stored functions and 189aggregating data and 119, 121, 225assigning to

data row variables 66ODA data sources 393, 407, 412, 437,

438parameters 149, 152SAP data sources 267, 276, 281stored procedures 187, 195text files 81

casting 341, 356changing column 105, 138, 141changing data row variable 66changing static parameter 153creating MDX queries and 225, 232

Page 600: Accessing Data

578 A c c e s s i n g D a t a

creating SQL queries and 138, 355defining information object parameters

and 323, 327defining SAP BW variables and 244displaying output column 332filtering data and 313getting native data source 141mapping external 393, 406mapping to

native data source types 66Oracle databases 189

maximum precision allowed for 490synchronizing queries and 166

data warehouses 243Database Browser 106, 108, 109database clients 8, 95, 167Database Connection command 25, 95database connection components 5, 7, 8

See also connection componentsDatabase Connection dialog box 25, 26database connection types 95database cursors

associating with class variables 263closing 493creating 195defined 100executing queries and 164moving 499, 505, 506, 516opening 34setting position of 491

Database Login dialog box 9, 133database schemas

accessing data and 90determining if current 169updating 165, 168

database servers. See serversdatabases

See also data sourcesaccessing data in 34, 90, 100, 104accessing with stored procedures 176calling stored procedures in 176, 177, 194choosing 25, 94connecting to 7, 25, 95, 96, 100creating queries for 104, 160, 344displaying stored procedures in 180, 182filtering data from 35, 148installing localized 92

instantiating data row objects for 36joining multiple tables in 113limiting rows returned from 123logging into 96removing obsolete tables in 172restricting data retrieval from 148retrieving data from 90retrieving distinct values from 303running consistency checks for 168selecting tables from 106, 109setting paths for 167sorting data from 42, 142synchronizing stored procedures in 176,

188updating 171verifying connections for 167

DataDirect drivers 94DataFont property 73, 74, 336DataRow components. See data row

componentsDataSource components. See data source

componentsDataSource element 407DataSource type 406DataSources element 414DataSources type 407DataStream components. See data stream

componentsDataStreamDefinition element

DesignSessionRequest type 388, 389, 428DesignSessionResponse type 388, 389,

390, 429DataStreamDefinition type 426DataType declaration (SQL) 347DataType element

InputFieldDefinition type 433InputParameterDefinition type 435

DataTypeMapping element 406, 407, 408, 437DataTypeMappings type 407DataValue variable 37Date data type 196, 507, 518Date element

OdaDataType type 438OdaScalarDataType type 439

date stamps 367, 368, 369, 370DATEADD function 368DATEDIFF function 369

Page 601: Accessing Data

I n d e x 579

DATEPART function 370dates

adding to page footers 73, 336computing values for 39getting 466, 495setting 507, 518

DATESERIAL function 370DB2 databases

See also databasesaccessing stored procedures in 176connecting to 8, 95, 100creating queries for 105retrieving data from 9

debugging ODA drivers 388DECIMAL data type 355, 356Decimal element

OdaDataType type 438OdaScalarDataType type 439

decimal precision 356decimal separator 312, 323decimal values

aggregating data and 371calculating data and 359creating SQL queries and 355, 356getting column-specific 493getting from output parameters 464getting number of digits in 491, 503getting precision of 490, 503setting 506, 518

DECIMAL_LITERAL token (SQL) 346default alignment 432default configurations 13default connections 20, 22, 23default data types 153default page layouts 58default sort order 105Default Value property 327default values

data filters and 316ODA data sources and 433, 435report parameters and 137SAP BW data filters and 247, 248SAP parameters and 278SAP Variables and 243setting import parameter 280SQL parameters and 323, 327

static parameters and 150DefaultValue element

InputFieldDefinition type 433InputParameterDefinition type 435

DefinedIn attribute (configurations) 20DefineProcedureInputParameter method 195DefineProcedureOutputParameter

method 195DELETE statements 164deleting

aggregate filters 321, 322columns 72, 117, 122computed fields 123filter conditions 312, 313, 314joins 112, 115output columns 304parameters 324sort columns 318tables from queries 111

delimited text strings 557, 560, 561dependent joins 309, 342deploying executable files 7DESC keyword (MDX queries) 246Descendants command 227descending sort order 46, 143, 246, 549Describe Query button 332, 333Describe Query icon 133Describe Query operations 133, 140, 152, 156Description attribute (configurations) 20Description element

InputFieldDefinition type 433InputParameterDefinition type 436OutputFieldDefinition type 439ResultColumn type 442

Description property 305, 328design components 30design files. See report object design filesdesign tools 386, 422

See also specific Actuate designer; ODA design tool

DesignerName element 409DesignerName property 406DesignerSpecific element 408DesignerSpecific type 408DesignerSpecificProperties element 405, 406DesignerSpecificProperties type 408

Page 602: Accessing Data

580 A c c e s s i n g D a t a

DesignerSpecificType element 408designing reports 4, 14

See also designsDesignLibrary property 409designs

See also page layoutsaccessing

ODA data sources and 387, 390, 426SAP BW data sources and 208

accessing stored procedures for 177–179, 183

addingconnections to 20, 22, 23SAP BEx queries to 214SAP BW ODS data streams to 259

building computed values for 39building custom data sources and 388creating xviicreating connections in 7–9, 96creating SQL queries and 98defining alternative data types for 407, 413developing 30including configurations in 17installing custom drivers for 386, 393migrating to production environments 24referencing components in 33referencing data sources in 167removing default configurations for 14retrieving data for 9sample configurations for 15saving 40selecting data sources for 25, 83, 386, 396viewing data row variables in 63

DesignSessionRequest element 388, 389DesignSessionRequest type 428DesignSessionResponse element 388, 390DesignSessionResponse type 429design-time interface 390, 409, 414DesignTimeInterface element 388, 414DesignTimeInterface type 409Details page (SAP R/3 Data Source

Builder) 276, 278, 282developing reports 13, 42development environment 30DimensionAttribute element 425DimensionMember element 425dimensions

See also MDX queriescreating SAP BW axes and 225filtering 247, 249selecting 223

directory pathscomponent libraries and 20configuration files 14connection configurations and 18custom drivers and 394data source drivers 168executable files 410file-based data sources 167information objects 314, 352log files 418ODA design tools 409ODA drivers 393, 412

disconnecting from databases 100disjunction 362Disk-based Data Row Sorter setting 45Display Control Type property 328Display Format property 305, 328display formats. See formats; formattingDisplay length field 141Display Length property 305, 328Display Name property 305, 328, 396display names

See also DisplayName elementcolumn headings 66columns 139control types 316data source lists 396, 406ODA connections 405ODA input parameters 433, 436ODA output parameters 439property values 416result set column names 431, 443structure or table parameters 278

DisplayFormat element 442displaying

business objects 268, 269column names 172connection properties 9, 178data 58, 110, 117data row variables 63, 141data rows 58, 59, 60, 62default values 137error messages 300

Page 603: Accessing Data

I n d e x 581

information objects 296, 302MDX queries 253, 254nested sections 60ODBC data sources 92ODBC drivers 93output columns 332owner information 107performance statistics 137query statements 130report parameters 333sample configurations 15SAP BW metadata 223, 224SAP parameters 276, 278SQL statements 129, 161, 301stored functions 189stored procedures 180, 182system data sources 93unformatted data 59

DisplayLength element 443DisplayName element

DataSource type 406InputFieldDefinition type 433InputParameterDefinition type 436ODA connections and 405OutputFieldDefinition type 439PropertyType type 416ResultColumn type 443

DisplayNameColumn element 431DISTINCT keyword 344distinct values 117Distinct values only setting 303division 359, 360Do Not Prompt property 328documents. See reportsDOUBLE data type 355, 356Double data type 196, 507, 508, 519Double element

OdaDataType type 438OdaScalarDataType type 439

double quotation mark (") charactercolumn aliases and 304CSV text files and 78QBE expressions and 315SQL identifiers and 346, 352

double valuescomparing 358entering in SQL queries 355, 359

getting 466, 495setting 507, 508, 519

DOUBLE_LITERAL token (SQL) 346downloading

SAP Java Connector libraries 208SAP patches 208

.dox files. See data object executable filesdriver libraries 410DriverInitEntryPoint element 392, 417DriverLibraries element 417DriverLibraries type 410DriverName element 394, 414drivers

accessing configuration files for 392accessing data with custom 386, 422accessing ODBC data sources and 90accessing sample ODA 386backward compatibility for 415calling statements for 462changing configurations for 387, 397connecting to ODBC data sources and 91,

92, 94creating joins and 113customizing 386, 422, 450customizing properties for 408debugging custom 388defining operating system for 415developing ODA 411displaying installed 93getting metadata for 475getting names of 480getting number of connections for 480getting number of statements for 480getting version 479, 480installing ODA 386, 387, 393, 478loading custom 393naming custom 394, 414running ODA 387running predefined 386setting exceptions for 543setting logging configurations for 418, 477unsupported features and 481unsupported statements and 511

DROP TABLE statements 164drop-down lists 316, 324, 325DSNs (data source names) 91, 92duplicate names 304

Page 604: Accessing Data

582 A c c e s s i n g D a t a

duplicate rows 303dynamic data filters 311, 313, 314–316, 344Dynamic list of values setting 316, 325dynamic sorting 41, 42DynamicCondition element 436DynamicConditionReference type 430DynamicQuery type 430DynamicValueList element 436

Ee.Analysis 305e.Report Designer 386e.Report Designer Professional

conditionalized queries and 123, 125custom drivers and 386data-processing functionality for 30JVM heap size for 255nonstandard installations and 167ODA data sources and 387sample configuration file for 13SAP BW BEx Query Builder and 217SAP R/3 Data Source Builder and 268supported connections for 8supported data sources for 9supported databases for 176synchronization tools in 165text file data sources and 5, 83undefined parameters and 149verifying input and 154

e.reporting servers. See iServer; serverse.Spreadsheet Designer

custom drivers and 386ODA data sources and 387SAP BW BEx Query Builder and 217

e.Spreadsheet reports. See spreadsheet reports

e.Spreadsheet server. See iServerEdit SQL button 332Edit SQL tab 135Editable value 444editors 15

See also specific Actuate editorelements (XML) 404, 422Enable Group By and Having editors

setting 122EnableCBO pragma 378, 379

encapsulated SQL queries 288encoding 447Encyclopedia volumes 292

accessing information objects in 288, 296, 302, 352

updating 296, 302equality comparisons 358equality operator 306, 307equals method 526equi-joins 113equijoins 310error codes 536, 543error constants 535error messages

See also errorsconnecting to data sources and 100creating 543displaying 300logging 533, 534outputting 536

error method 536errors

See also exceptionsfailed connections and 100information object queries and 300log records and 541, 542LoggingErrorHandler and 457, 458, 535MDX queries and 254ODA data sources and 543out-of-memory 254, 255SAP BW data sources and 254, 255, 256SAP data sources and 267, 284SQL queries and 122unsupported methods and 450

escape characters 350, 364ESCAPE keyword 364example ODA driver 386exception class 543exceptions

See also errorsgetting 541initializing 546logging 533, 534, 535outputting 536providing information with 543returning cause of 545throwing 542

Page 605: Accessing Data

I n d e x 583

Executable element 410executable files

building ODA data sources and 388, 409, 414

creating 59deploying 7generating queries and 117setting paths for 410

Execute method 164, 195execute method 513execute privilege 289executeQuery method 514executing queries 164, 514, 520executing reports 387executing stored procedures 195exiting SAP BW BEx Query Builder 217, 254exiting SAP R/3 Data Source Builder 268experts. See wizardsExplicitInnerOuterType declaration

(SQL) 347ExplicitJoinType declaration (SQL) 347exponentiation 361export parameter types 276, 277, 279export parameters (RFMs) 34export parameters (SAP data) 275, 276, 281export tables (SAP data) 276, 282Expression Builder 304expression builder 119, 126Expression property 305ExpressionList declaration (SQL) 347expressions

adding column names to 307adding functions to 295adding parameters to 150, 155aggregating data and 127, 128character limits for 119comparing values in 358creating computed fields and 39, 118, 119,

305creating joins and 306, 310creating queries and 123, 125, 295, 344,

356, 358defining output columns and 304defining SAP BW slices with 251, 252entering invalid 154entering run-time 126, 154

filtering data and 154, 247, 249, 251filtering information objects and 321grouping data and 344leading spaces in 155matching character patterns and 341, 364retrieving data rows and 67summarizing data with 120, 121

extensible markup language. See XMLexternal data sources 35external data types 393external exceptions 543ExternalDesignState element

DesignSessionRequest type 389, 428DesignSessionResponse type 390, 429

ExternalState type 431

Ffacets (defined) 355Factory service

ODA data sources and 391, 392, 393ODA drivers and 387transient objects and 31

false values. See Boolean valuesfetch limit (defined) 264Fetch method

accessing multiple data sources and 49, 52, 55

accessing stored procedures and 195, 202building custom data streams and 34displaying CSV data and 83, 84filtering data rows and 35, 36, 47, 48instantiating data rows and 36

fetch position 35fetch size properties 256, 257, 258fetching data. See Fetch methodFetchLimit property 134, 264field definitions

creating 432, 439listing input parameter 422listing output parameter 423

Field List 183field names. See column names; column

headingsFieldControlType element 433fields

See also columns; computed fields

Page 606: Accessing Data

584 A c c e s s i n g D a t a

changing data row variables and 62changing default values for 39comparing values in 46defining class variables for 81displaying database 110displaying variables for 82limiting number returned 9restricting retrieval of 148retrieving with data row variables 36selecting 19, 70specifying as primary keys 114

Fields command 82, 183Fields dialog box 82file DSNs 91, 92file names 79, 80, 83file numbers 79file paths. See pathsfile-based databases 167FileHandler class 391, 452files

See also specific file typeaccessing ODA data sources and 386backing up 166closing 34configuring environments and. See

configuration filescopying report 166creating configuration 393, 396loading configuration 13saving temporary 388specifying connection properties in 12

Filter class 391filter classes 35filter conditions

See also filtering data; filtersadding to graphical queries 152, 154adding to MDX queries 247adding to textual queries 151, 155aggregating data and 320, 321, 322creating for information objects 311creating for SAP InfoProviders 247creating with Actuate SQL 314defining 311, 313, 314defining ad hoc 154, 155defining static 149, 151, 152deleting 314linking 311

prompting for 247, 248, 250, 344removing from queries 312, 314setting default values for 247, 248

Filter Empty Members setting 233, 236filter expressions 247, 248, 249, 251

See also MDX queriesFilter interface 453Filter property 311filter specification. See filter expressionsFilterClause declaration (SQL) 347FilterEmptyMeasures property 233, 234, 235filtering business objects 270filtering data

databases and 148graphical queries and 152, 154guidelines for 46information objects and 148, 310, 311, 319input sources and 31, 35, 47multiple data sources and 48non-sequential data streams and 34ODA data sources and 430ODBC data sources and 148SAP BW data sources and 236SAP BW InfoProviders and 247–251SQL queries and 105, 135, 148text file data sources and 85textual queries and 151

filtersSee also data filter componentsadding to queries 314aggregating data and 319, 321, 322creating 6, 46, 50, 53creating dynamic 314–316customizing 34, 36, 49defining conditions for. See filter

conditionsdefining parameters as 148, 151, 154, 249,

311getting 456instantiating data rows for 36overview 35placing on information objects 311, 315predefining 311prompting for input and 314, 316removing ad hoc 313removing aggregate 321, 322removing dynamic 313

Page 607: Accessing Data

I n d e x 585

removing static 312reusing 46setting at run time 148, 149, 153, 154, 247,

248, 344setting control type for 316setting default values for 316setting log handler 458sorting data with 42, 45, 142, 144specifying input sources for 47specifying parameters as 155

FILTERS clause 301Filters icon 270Filters page (Data Source Builder) 270Filters page (Information Object Editor) 310,

314Filters page (Information Object Query

Builder) 310, 311, 313, 314Filters page (SAP BW BEx Query

Builder) 248, 249, 251FILTERS statements 340, 344, 347

See also SQL statementsfinalize method 555findColumn method 493finding

business objects 268, 269, 270embedded strings 557stored procedures 182

findInParameter method 515findOutParameter method 463FINE constant 525FINE level messages 531fine method 531FINE_LEVEL constant 525FINER constant 525FINER level messages 531finer method 531FINER_LEVEL constant 525FINEST constant 525FINEST level messages 531finest method 531FINEST_LEVEL constant 525Finish method

creating custom data streams and 34displaying CSV data and 83, 84filtering data and 36generating content with 38

FinishedBuilding value 38fixed point numbers 355flat file data sources 43, 44, 142, 402FlatFileExample directory 386floating point numbers

comparing 358getting 466, 495setting values 507, 508, 519SQL conventions for 355, 359

FLOOR function 360flush method

Handler 456StreamHandler 555

FLUSH_FAILURE constant 535fonts

changing attributes of 73changing default 336changing query output 335–337setting properties for 336

footers 73, 336foreign keys 112

See also joinsformat method

LogFormatter 528SimpleFormatter 548

FORMAT_FAILURE constant 535formats 59, 66, 442FormattedReport value 59formatting

log records 528, 548query output 335–337strings 528, 548table names 112view names 112

formulas 118, 119, 121See also expressions

forward slash (/) character 352frames 184freezing columns and rows 110FROM clause 109, 115, 347

See also SQL statementsFromClause declaration (SQL) 347FromTableName declaration (SQL) 347FromTableReference declaration (SQL) 348FunctionCallOrColumnRef declaration

(SQL) 348

Page 608: Accessing Data

586 A c c e s s i n g D a t a

functionsSee also methodsaggregation and 371current user and 372numeric data types and 360SQL queries and 295, 341stored procedures and 181string data types and 362substrings and 364, 366summary data and 119timestamp values and 367

fundamental data types. See data types

GGeneral command (Options) 13General page (Options) 13generating

error messages 100executable files 59reports 5

GENERIC_FAILURE constant 535getBigDecimal method

ICallStatement 464IResultSet 493

getBinaryStream method 459getBlob method

ICallStatement 464IResultSet 465, 494

getBytes method 459getCause method 545getCharacterStream method 461getColumnCount method 501getColumnDisplayLength method 501getColumnLabel method 501getColumnName method 502getColumnType method 502getColumnTypeName method 502getConnection method

IConnectionFactory 477IConnectionMetaData 479IDataSourceMetaData 483

getDataSourceMajorVersion method 484getDataSourceMinorVersion method 484getDataSourceObjects method 484getDataSourceProductName method 485getDataSourceProductVersion method 485getDate method

ICallStatement 465IResultSet 495

getDelimitedStringCount method 557getDouble method

ICallStatement 466IResultSet 495

getDriverMajorVersion method 479getDriverMinorVersion method 479getDriverName method 480getDriverVersion method 480getErrorCode method 546getFilter method 456getFormatter method 456getHandler method 532getInt method

ICallStatement 467IResultSet 496

getLevel methodHandler 456Logger 532LogRecord 540

getLogger method 539getLoggingErrorHandler method 457getMaxConnections method 480getMaxRows method 515getMaxStatements method 480getMessage method 541getMetaData method

IConnection 475IResultSet 496IStatement 515

getMetaDataOf method 467getMillis method 541getMoreResults method 516getName method

Level 526Logger 532

getNextException method 546getOdaMajorVersion method 481getOdaMinorVersion method 481GetOutputParameter method 195, 200getParameterCount method 489getParameterMetaData method 516getParameterMode method 489getParameterType method

IParameterMetaData 490IStatement 516

Page 609: Accessing Data

I n d e x 587

getParameterTypeName method 490GetPosition method 35getPrecision method

IParameterMetaData 490IResultSetMetaData 503

GetProcedureStatus method 195, 200getResultSet method

ICallStatement 467IStatement 517

getResultSetNames method 468getRow method

ICallStatement 468IResultSet 497

getScale methodIParameterMetaData 491IResultSetMetaData 503

getSortColumn method 551getSortColumns method 551getSortKeyCount method 552getSortMode method

IDataSourceMetaData 485SortSpec 552

getSortOrder method 552getSortSpec method

ICallStatement 469IStatement 517

getSQLState method 546getSQLStateType method 486getString method

ICallStatement 469IResultSet 497

getSubString method 461getThrown method 541getTime method

ICallStatement 470IResultSet 498

getTimestamp methodICallStatement 470IResultSet 498

global parameters 149global reporting solutions. See localesgraphical queries 295, 296

See also Query Editorbuilding information object 296, 300, 318changing result sets for 138changing statements for 115, 162converting to text-based 98, 134–136, 162

creating 99, 105deleting conditions for 127, 129displaying statements for 161filtering data with 105, 154previewing result sets for 136removing columns from 117reordering columns for 119returning computed fields with 118selecting columns for 116selecting tables for 106, 109setting conditions for 123, 126, 129, 152,

154sorting with 143, 145summarizing data with 120, 121synchronizing 163, 165, 166, 169, 171tracking changes to 171updating 165, 171

graphical query data sources 98 See also query data sources

graphical user interfaces. See user interfacesgraphs. See chartsGROUP BY clause 120, 318, 344, 348

See also SQL statementsGroup By page 318, 319Group By page (Information Object Query

Builder) 318, 319Group By page (Query Editor) 120, 121, 122Group By tab 122Group element 436group login configurations (SAP) 210, 215,

261group sections

creating queries for 42, 144displaying unformatted data and 60placing connections in 7sorting data in 43sorting defaults and 41, 142

GroupByClause declaration (SQL) 348grouping column (Query Editor) 120, 121,

122grouping conflicts 120grouping data 318, 344grouping data rows 120grouping information, preserving 59GroupName property 210groups

changing column order for 319

Page 610: Accessing Data

588 A c c e s s i n g D a t a

returning distinct values for 303returning from queries 344viewing available columns for 318

GUIs. See user interfaces

HHandler class 391, 455Has Null property 305hashCode method 526HAVING clause 127, 319, 344, 348

See also SQL statementsHaving page (Information Object

Editor) 320, 321Having page (Information Object Query

Builder) 319, 320, 321, 322Having page (Query Editor)

displaying 128removing conditions from 128, 129setting conditions on 123, 125, 128, 129

HavingClause declaration (SQL) 348Heading element 443Heading property 305, 328heap 255Help Text property 305, 328HelpText element 443hidden parameters 278, 328Hide report parameter setting 278hierarchies (MDX queries) 245, 246hints 372Horizontal Alignment property 305, 328HorizontalAlignment element 443HorizontalAlignment type 432

IIBlob interface 458ICallStatement interface 391, 462IClob interface 460IConnection interface 391, 392, 473IConnectionFactory interface 476IConnectionMetaData interface 391, 478IConnectionMetaData method 450icons 30, 189IDataSourceMetaData interface 392, 481IDataSourceMetaData method 450Identifier element 430IDENTIFIER token (SQL) 346

IdentifierNativeTypeCode element 430identifiers (SQL) 346, 351, 352IDriver interface 450illegal characters 352import parameter types 276, 277, 279import parameters (SAP data) 275, 276, 279,

280IN operator 359Include element (configurations) 17Indexed property 305indexes (SQL queries) 380, 381INFO constant 525INFO level messages 532info method 532INFO_LEVEL constant 525InfoObjects. See information objectsInfoProviders (SAP BW)

accessing 221filtering data from 247–251querying 214, 221, 242, 251retrieving data from 222, 247selecting 222, 223troubleshooting memory problems

with 254–258Information Object Data Source Editor 292Information Object Designer

accessing SAP data sources and 253creating queries and 254, 325, 344multiple data sources and 48

Information Object Editorcreating joins with 306defining output columns and 303filtering data with 310, 314, 320grouping data with 318, 319removing filter conditions with 312, 314,

321Information Object Query Builder 295

accessing 293changing queries with 331creating joins and 306creating joins with 306, 310creating queries with 294, 297, 300, 331defining output columns and 303defining parameters with 323, 329, 330filtering data with 319, 320, 321filtering information objects and 310, 311,

313

Page 611: Accessing Data

I n d e x 589

grouping data with 318, 319opening SQL editor from 331overview 293prompting users and 325removing filters with 312, 313, 321, 322removing output columns and 304removing parameters with 324removing sort columns with 318selecting information objects with 302, 303sorting data with 317synchronizing parameters with 330validating query statements and 315

information objectsaccessing data in 289, 293associating data stores with 259associating with class variables 263building queries for 293, 294, 296, 300, 331,

340connecting to 289, 290defining as data sources 289, 291defining computed fields for 374defining joins for 306–308, 309, 378defining optional tables for 372–377defining output columns for 303–304defining parameters for 322–324defining result set columns for 425deleting joins for 308disabling indexing for 380displaying output for 332, 334displaying parameters for 333displaying queries for 301filtering data for 148, 301, 310, 311, 314–

316, 319grouping data for 318optimizing queries with 372overview 288, 289referencing 264, 352referencing tables or views for 341restricting data returned by 310retrieving data and 48selecting 296, 302setting source parameters for 328–330sorting data for 317, 317–318, 344synchronizing parameters for 330testing 334updating 296, 302updating queries for 301

InformationObject value 59inherited parameters 149inheriting properties 329initCause method 546Inner join setting 308inner joins 113, 114, 308, 343input 316

NCHAR data types and 189prompting for 149, 153

input adapters 36, 49, 52input filter classes 35input filters 35, 47, 48, 49, 54input parameters

See also stored proceduresappending rows to 505checking for 186creating 195, 434defining dynamic queries for 430determining if supported 486entering sample values for 180, 186finding index of 515generating names for 185getting data source type 490getting data type of 490, 516getting number of 489getting numeric precision for 490listing definitions for 423, 432mapping to report parameters 389, 427overview 185prompting for 184returning field definitions for 422running stored procedures and 189setting date values for 518setting decimal values for 518setting default values for 435setting numeric values for 519setting single row for 471setting string values for 521setting time stamps for 522setting time values for 522specifying as type 185specifying single row for 471specifying tables with 472testing for null values in 491

input sourcesSee also data sourcesaccessing data in 34

Page 612: Accessing Data

590 A c c e s s i n g D a t a

accessing multiple 31filtering data in 31, 35, 46, 47opening 34retrieving data from 31, 36sorting data in 49

InputFieldDefinition element 422InputFieldDefinition type 432InputParameterDefinition element 423InputParameterDefinition type 434InputParameters element 389, 427installation

configuration files 387, 396localized databases 92nonstandard locations 167ODA drivers 386, 387, 393–394SAP GUI clients 208SAP Java Connector libraries 208, 209, 266SAP MetaData Interface 266

INTEGER data type 355, 356Integer data type 196, 508, 519Integer element

OdaDataType type 438OdaScalarDataType type 439

INTEGER_LITERAL token (SQL) 346integers

See also numbersarithmetic operations and 359getting 467, 496setting values for 508, 519SQL conventions for 346, 355

Integration servicecalculating data and 359comparing values and 357, 358connecting to 289defining joins and 310running queries and 344

interfacesSee also user interfacescustom drivers and 387, 388, 450ODA drivers and 391, 450ODA Java reference for 451predefined data sources and 386

InterfaceType element 417InterfaceType type 411international reporting solutions. See localesintValue method 527invalid expressions 154

invalid values 137, 154, 499IParameterMetaData interface 392, 487IParameterMetaData method 450IResultSet interface 392, 491IResultSetMetaData interface 392, 500IRowSet interface 392, 504IS NOT NULL operator 362IS NULL operator 362IsDefault attribute (configurations) 20, 22IsDefault property 20isEmpty method 506IsEnabled element 431iServer

See also serversaccessing information objects and 289defining connections for 7installing custom drivers for 393, 396installing ODA drivers for 393

iServer Explorer 297IsHidden element

InputFieldDefinition type 434InputParameterDefinition type 436

isLoggable methodFilter 454Handler 457Logger 532StreamHandler 555

isNullable methodIParameterMetaData 491IResultSetMetaData 503

isOpened method 475IsPassword element 436IsRequired element

InputFieldDefinition type 434InputParameterDefinition type 436

IStatement interface 392, 511Item command 226, 228Items command 227

JJava classes 450Java Connector libraries 209Java interfaces 391, 450Java Metadata Interface (SAP data) 266Java Object Interface 255Java Virtual Machines. See JVMs

Page 613: Accessing Data

I n d e x 591

JavaLogFormatterClass element 418join algorithms 308, 309–310, 342join condition operators 306join control syntax 342join operator icon 114join operators 114Join Properties page (Query Editor) 114join type settings 308JoinCondition declaration (SQL) 348JoinElement declaration (SQL) 348JoinExpression declaration (SQL) 348joins

accessing data and 90adding primary keys for 113creating 112, 113, 306–308, 309defining with queries 342, 378deleting 115disabling automatic generation of 109disabling cost-based optimization for 378,

379, 380emulating 50optimizing 308, 309removing conditions for 308setting conditions for 306specifying cardinality of 310, 377specifying optional tables for 372specifying type 113, 114

Joins page 306, 310Joins page (Information Object Query

Builder) 306, 308JoinSpec declaration (SQL) 348JVM heap size 255JVMMaxHeapSize variable 255JVMs 254, 255, 264

KKeepOdaRequestResponseFiles registry

key 388key figures 223

See also measures; MDX querieskeys. See joins; sort keyskeywords (Actuate SQL) 351

Llabel controls 38LabelFont property 73, 74, 336labels 38, 336

layout styles 239layouts 58, 218, 239, 426

See also designsleading spaces 155Left element 432LEFT function 365LEFT OPTIONAL keywords 376Left outer join setting 308left outer joins 113, 308, 343Legend page (SAP R/3 Data Source

Builder) 269Length declaration (SQL) 348length function 363length method

IBlob 460IClob 461

Level class 392, 524libraries 208

adding to configuration files 17, 18, 386defining connections in 21defining specific operating system 411developing with 30implementing custom drivers in 386, 410installing SAP Java Connector 266loading ODA driver 417publishing to 46referencing components in 25reusing classes in 386running queries from 43, 44setting paths for 20setting paths to ODA design 409

LibrariesForOS element 411, 417LibrariesForOs element 411LibrariesForOsType type 411library files. See report object library filesLibraryName element 412LIKE operator 315, 341, 364line controls 38Lineage element 443linking related tables 112list controls 433, 435ListOfProperties element 409ListOfProperties type 412lists 125, 314, 324, 325literal characters 315, 341, 346, 364literal integers 346, 348, 349literal strings 341, 346

Page 614: Accessing Data

592 A c c e s s i n g D a t a

loadingconfiguration files 13, 387, 393custom data drivers 393ODA driver libraries 417text files 84

local connections 5local parameters 149, 185, 329locales

developing user interfaces for 390, 445installing localized databases for 92specifying 429

locatingbusiness objects 268, 269, 270embedded strings 557stored procedures 182

Location element 412log files

configuring 418, 477creating error handler for 535filtering 453, 456, 458formatting records for 528, 548getting logging level for 541getting messages in 541publishing records to 453, 454, 457running SAP BW BEx queries and 256setting formatter for 458, 556setting logging levels for 541streaming records for 554writing application messages to 530

log handler 455log method 533log records 528, 548LogDirectory element 418LogFilenamePrefix element 418LogFormatter class 392, 528LogFormatter objects 456logger 392, 530Logger class 392, 530Logger objects 537, 538, 540logging constants 524logging error handler 535logging information (ODA

configurations) 392logging into

databases 96SAP BW data sources 208, 209, 215, 222SAP R/3 data sources 209, 222, 268

logging levels 456, 458, 524logging package 417, 418, 477LoggingErrorHandler class 392, 535logical operators 362logical values 362

See also Boolean valueslogin failures 441login information 267LoginFailed element 441LogLevel element 418LogManager class 392, 537LogRecord class 392, 540Long data type 196LOWER function 105, 363lowercase conversions 363LTRIM function 366

Mmandatory variables (SAP BW) 242, 244mapping

ODA data types 393, 406, 407, 412, 437, 438

SAP parameters 279mapping variable types 195maps (information objects) 288, 352matching character patterns 315, 341, 364mathematical operators 359matrix reports. See crosstabsMAX function 371Max memory per query parameter 310maximum values 371MDX (defined) 220MDX page (SAP BW BEx Query Builder) 254MDX queries

accessing additional information for 221adding cross-products to 229–230adding filter conditions to 247adding slices to 251–253changing 236clearing 254comparing measures with 249creating 220, 221, 223, 226, 475defining axes values for 225–228, 239defining data sets for 220, 225, 226defining for InfoProviders 214, 221, 242,

251

Page 615: Accessing Data

I n d e x 593

getting statements for 34including empty members in 233, 236redefining axis position for 232removing axes from 236, 245, 248removing cross-products from 230, 231removing data sets from 237running 251selecting data streams for 216selecting technical names for 224setting variables for 242–244sorting result sets for 245–247specifying run-time values for 243, 247,

248, 250verifying 254viewing metadata for 223, 224viewing statements for 253, 254

MDX terminology 220Measure element 425measures (MDX queries)

comparing 249defining axis values and 225, 226defining slices and 251, 252filtering 247, 248removing empty 235selecting 223

member collections 220members (MDX queries)

adding cross-products and 229defining SAP Variables and 244defining SAP variables and 243defining slices and 251, 252, 253filtering 247, 250including empty 233, 236

Members command 226, 227memory 42, 254, 255, 310Memory Data Sorter filter 42menus 132merge filters 49, 50, 51merge joins 309, 343merging data rows 50, 51message servers 210messages

See also error messagesgetting log 541logging 530, 533, 541outputting 536

MessageServer property 210metadata

creating joins and 112defining for ODA data sources 388getting connections for 484getting result set 467, 497, 515refreshing 224returning from

ODA data sources 475, 478, 481prepared statements 487

returning result set 467, 500viewing SAP BW 223, 224

MetaData Interface (Java SAP) 266metadata interfaces 478, 481, 487, 500methods

See also functionsaccessing data and 35accessing stored procedures with 194, 195creating queries and 43, 44, 105custom data drivers and 450customizing connections and 30customizing data streams and 33filtering data rows and 36ODA Java reference for 451referencing names and 141returning result sets with 199synchronizing queries and 166

Methods page (Properties) 84, 263Microsoft Access databases 167MIN function 371minimum values 371MinRowsForIndexing pragma 381MOD function 360moving

filter specifications 251output columns 304sorting specifications 247

multicolumn page layouts 426Multidimensional Expressions. See MDX

queriesmultiline comments (SQL) 352multiple cursor parameters 190multiple input filters 35, 48, 49, 54multiple input sources 31multiple result sets 190, 199Multiple-Input Filter setting 49

Page 616: Accessing Data

594 A c c e s s i n g D a t a

multiplication 359MultiplicativeExpression declaration

(SQL) 348multi-table queries 112, 113multi-table reports 50Multivalue type (SAP Variables) 244

NName element

DataSource type 406DataStreamDefinition type 427InputFieldDefinition type 434InputParameterDefinition type 436NameValuePair type 437ODA connections and 405OutputFieldDefinition type 439Property type 440PropertyType type 416ResultColumn type 443ResultSetDefinition type 390, 444

Name property 306, 328name qualification options (Database

Browser) 108named parameters (SAP statements) 464, 487NamedParameter declaration (SQL) 348names

See also display namesaccessing data sources and 91adding space separators to 155as SQL identifiers 352changing display 139changing stored procedure 182changing table 171defaults for column and table 63duplicating 304duplicating parameter 149duplicating table 109entering synonyms as 106extracting IDs associated with 197generating input parameter variable 185getting column 501, 502getting data source 485getting driver 480getting Logger 532getting result set 468qualifying 132

restrictions for 66Names options (Database Browser) 108name-value pairs 424, 437, 440NameValuePair element 423NameValuePair type 437naming

ad hoc parameters 155, 156aggregate expressions 121columns. See column namescomputed fields 118custom drivers 394input parameters 185ODA drivers 414ODBC data sources 94output columns 304output parameters 328report parameters 149result sets 390SAP ODS data sources 262static parameters 153table or structure parameters 278tables 109

native data types (Column Editor) 66native data types. See data typesnative database connection types 95native database drivers 94, 97NativeDataType element 413NativeDataTypeCode element 413NativeDataTypeType element 412NativeTypeCode element

OutputFieldDefinition type 439ResultColumn type 443

NativeTypeName elementOutputFieldDefinition type 440ResultColumn type 443

NCHAR data types 189negation 362nested loop joins 310, 342nested sections 60network connections 5NewConnection method 30next method 499NON EMPTY clause 233non file-based databases 167non-formatted data 58non-null values 371non-sequential data access 34

Page 617: Accessing Data

I n d e x 595

non-String type parameters 469non-supported operations 543NOT operator 362NULL keyword 341null test operators 362null values

defining parameters and 323, 341determining if supported 491specifying 305, 500testing for 362, 473, 499, 503

numbersassigning to parameters 323, 330calculating 359comparing 358entering in SQL queries 346, 355filtering 312, 320getting decimal digits for 490, 491, 503getting values of 496returning as doubles 466returning as integers 467setting values for 507, 508, 519specifying default values for 323

numeric data types 356, 358numeric functions 360

OObject Linking and Embedding. See OLEobjects

constructing OdaException 544deleting transient 31finding business 268, 269, 270, 271getting data source 484getting LogFormatter 456

obsolete tables 172ObtainSelectStatement method 161, 163ODA connection class 386, 402ODA data source builder

accessing data sources for 422creating 387defined 388defining session state for 431defining session-specific locales for 445determining previous state 447returning definitions from 429setting response states for 441storing state of 389

XML reference for 422ODA data source classes 387, 391ODA data sources

accessing 386, 387, 388, 422aligning data in 432changing properties for 389closing connections for 474committing changes to 474connecting to 386, 388, 405, 473, 476creating user interface for 387, 511defining input parameters for 434defining metadata for 481defining output parameters for 440defining result sets for 444designing reports for 428, 444determining columns in 424determining parameter type for 486, 487developing 406, 409, 414, 422filtering columns in 430getting collections of 484getting interface version for 481getting names 485getting number of statements for 480getting version of 484, 485installing configuration files for 387listing field definitions for 422, 423listing parameter definitions for 423, 424localizing 445mapping data types for 393, 406, 407, 412,

437, 438retrieving data from 389, 390returning information about 543returning result sets from 486, 487, 516rolling back changes for 476setting field definitions for 432, 439setting properties for 389, 416, 426, 520setting up data streams for 426specifying multiple 406, 414verifying connections for 476

ODA data stream class 386, 402ODA data stream components 388ODA data streams 388, 389ODA data types 393, 406, 407, 412, 437, 438ODA design tool

changing data and 444defining user locale for 445displaying connections and 405, 408

Page 618: Accessing Data

596 A c c e s s i n g D a t a

getting session information for 428, 430retrieving data for 428setting application locale for 429

ODA driver libraries 410ODA drivers

accessing configurations for 392, 393accessing data with 386, 422accessing sample 386adding configuration files for 393backward compatibility for 415building user interface for 388–389, 511calling statements for 462changing configurations for 387, 397configuring 396, 414creating 386, 450customizing properties for 408debugging 388defining connection information for 405,

478defining operating system for 415defining schemas for 397, 404generating reports and 387, 391getting metadata for 475getting names 480getting number of connections for 480getting number of statements for 480getting version 479, 480installing 386, 387, 393–394loading libraries for 417naming 394, 414overview 386retaining temporary files for 388running 387setting exceptions for 481, 511, 543, 544setting logging configurations for 418, 477specifying interface version for 393specifying language for 411

ODA Java reference 449, 451ODA metadata interfaces 478, 481, 487, 500oda package 391ODA run-time interface 417, 450, 481odaconfig.xml 393, 397, 404OdaDataType type 437OdaException class 392, 543OdaException objects 544ODAInterfaceVersion element 415OdaScalarDataType element 404, 413

OdaScalarDataType type 413, 438ODBC administrator utility 91ODBC Data Source Administrator 92ODBC data sources

accessing 91accessing data in 90, 100, 104accessing stored procedures in 176building queries for 104, 160configuring 91, 92connecting to 8, 26, 91, 95, 96, 100creating 91defining run-time parameters for 150displaying 92filtering data in 148limiting rows returned from 123naming 94restricting data retrieval from 148retrieving data from 9, 90selecting 94setting paths for 167specifying parameter type for 185updating schemas for 168verifying connections for 167

ODBC DBMS module 189ODBC drivers 90, 93, 113ODBC Microsoft Access Setup dialog box 93ODS data source components 261ODS data sources 261, 264ODS data streams 259–264ODS objects 259, 262OFF constant 525OFF_LEVEL constant 525Ok element 441OLAP data providers 220OLAP terminology 220OLE DB for OLAP specification 220OnColumnLayout element 426Online Analytical Processing. See OLAPOnRead method 34, 39OnRow method 38open data access data drivers. See ODA data

driversopen data access data sources. See ODA data

sourcesopen database connectivity. See ODBCopen method 476OPEN_FAILURE constant 535

Page 619: Accessing Data

I n d e x 597

OpenConnection method 30OpenCursor method 190OpenDataAccessConfig type 414opening

Column Editor 68, 70, 140connections 30, 476data adapters 34Data Row Editor 63, 139Database Browser 106database cursors 34Expression Builder 119, 126, 304Information Object Query Builder 293input adapters 36input sources 34ODA driver libraries 417Query Editor 106Sample Parameter Values dialog 181SAP BW BEx Query Builder 221, 239SAP R/3 Data Source Builder 268Scratch Pad 60SQL editor 331Stored Procedure Name Editor 182text files 84Textual Query Editor 131XML files 34

operating systems 411, 415Operational Data Store (ODS) 259

See also ODS data sources; ODS objectsoperators

filter conditions 312join conditions 306SAP BW BEx queries 248SQL queries 114, 341

optimizingdata retrieval 19joins 308, 309queries 104, 308, 354, 372–378

OPTIONAL keywordaggregate functions and 376computed fields and 374, 375joins and 372, 373

OR operator 362Oracle databases

See also databasesaccessing stored functions in 190accessing stored procedures in 176, 188–

194, 196, 202

connecting to 8, 95, 100, 167creating queries for 105displaying stored functions in 189displaying stored procedures in 189displaying synonyms for 106installing client software for 95retrieving data from 9returning result sets from 199–203

Oracle DBMS module 189Oracle9i stored procedures 189ORDER BY clause 43, 142, 144, 344, 348

See also SQL statementsOrder By page (Query Editor) 121, 143, 144Order page (SAP BW BEx Query

Builder) 245, 247OrderBy property

queries and 43section components and 43sorting data and 44, 142

OrderByClause declaration (SQL) 348OSType element 412OSType type 415out of memory errors 254, 255outer joins 113, 114, 306, 308, 343outOfMemory errors 255output

changing fonts for 335defining NCHAR data types and 189displaying 334flushing buffered 456, 555

output columnschanging order of 304defining 303–304deleting 304displaying 332naming 304setting display lengths for 305setting properties for 304, 305, 333sorting on 317

output files 455, 536output formats 442output parameters

See also stored proceduresbuilding ODA data sources and 389checking for 186creating 195, 440defining NCHAR data types and 189

Page 620: Accessing Data

598 A c c e s s i n g D a t a

determining if null values in 473determining if supported 487finding 464getting data source type 490getting data type of 490, 516getting date values in 466getting decimal values in 464getting number of 489getting numeric precision for 490getting numeric values in 466, 467getting string values in 469getting structure values for 468getting time values for 470getting time values in 470getting values of 195listing definitions for 423, 424overview 185returning multiple result sets from 199,

200returning specified 464returning structure values for 468returning time stamps for 470setting decimal values for 518setting field definitions for 439specifying as type 185testing for 464testing for null values in 473, 491

output stream error constants 535output streams

closing 555flushing 456, 555setting 556writing log records to 554

OutputFieldDefinition element 423OutputFieldDefinition type 439OutputParameterDefinition element 424OutputParameterDefinition type 440OutputParameters element 389, 427overriding methods 105overriding report connections 12owner information 107Owner pattern match setting 108

Ppage footers 73, 336page headers 73

page layout styles 239page layouts 58, 218, 239, 426

See also designspage numbers 73, 336PageDecorationFont property 73, 74, 336paging 255palettes. See Toolboxparallel sections 7, 60parameter definitions 185parameter information icon (SAP R/3

Builder) 273parameter mode constants 488, 489Parameter Mode property 328parameter passing 342Parameter Properties dialog box 80Parameter Properties page 152, 156ParameterDeclaration declaration (SQL) 348parameterized queries

See also stored procedurescreating 341, 356defining parameters for 244, 322, 323, 341filtering data with 151, 247, 344getting number of parameters in 489joining tables with 343viewing parameters for 137

parameterModeIn constant 488parameterModeInOut constant 488parameterModeOut constant 488parameterModeUnknown constant 488parameterNoNulls constant 488parameterNullable constant 488parameterNullableUnknown constant 488parameters

accessing 392, 450adding to expressions 150, 320adding to queries. See parameterized

queriesassigning data types to 149, 152, 323, 327assigning values to 137, 278, 323, 330, 353binding to SQL statements 164blank values and 137changing business object 275changing data types for 153changing display names for 278changing properties for 152, 154, 156, 329connecting to ODA data sources and 386,

422

Page 621: Accessing Data

I n d e x 599

connecting to XML files and 387creating report 148, 153defining ad hoc. See ad hoc parametersdefining local 329defining NCHAR data types and 189defining source 329defining static. See static parametersdeleting 324displaying 276, 333entering undefined 149, 185filtering data and 148, 150, 311, 312, 315

restrictions for 150hiding 278, 328invalid values and 137mapping 279matching character patterns and 341naming 149, 153, 155, 156, 311, 328prompting for 184, 324, 325, 329prompting for values with 149, 150providing pick lists for 430querying information objects and 322, 323querying SAP BW data sources and 244,

249querying SAP R/3 data sources and 267replacing 557setting default values for 278, 280, 323, 327setting null values for 323setting properties for 327setting run-time 504specifying default values for 150specifying variables as 41, 80stored procedures and 180, 185synchronizing information object 330type casting rules for 342viewing business object 273viewing default values for 137viewing properties for 152, 156

Parameters command 152Parameters page (Information Object Query

Builder) 323, 324, 325, 329, 330Parameters page (SAP R/3 Data Source

Builder) 273Parameters page (SQL editor) 333Parameters page (Stored Procedure Data

Source Builder) 186ParamPlaceholder declaration (SQL) 348passwords

data source server and 8, 95, 100information objects and 292ODBC data sources and 91, 100SAP data sources and 267, 268

patches 208PATH variable 410paths

component libraries and 20configuration files 14connection configurations and 18custom drivers and 394data source drivers 168executable files 410file-based data sources 167information objects 314, 352log files 418ODA design tools 409ODA drivers 393, 412

pattern characters 364pattern-matching operator 341PeopleSoft databases 176

See also databasespercent (%) character 364performance

graphical queries and 104, 109, 162MDX queries and 225published components and 19retrieving data and 9shared connections and 8sorting and 42stored procedures and 176textual queries and 104

performance statistics 137period (.) character 312, 323pick lists 430pipe sign (|) character 315plug-ins 386Position element 443POSITION function 366POWER function 361Pragma declaration (SQL) 348Pragma statement 346pragmas 343, 378precision (database data types) 355precision (numeric values) 356, 490, 503Precision declaration (SQL) 348predefined connections 8, 12, 25

Page 622: Accessing Data

600 A c c e s s i n g D a t a

predefined data drivers 386predefined data sources 25, 386, 396predefined databases 25predefined filters 311Prepare method 100, 199prepare method 517Presorted setting 44, 144, 145presorting data 43, 44, 144Preview Column Data button 117Preview Data command 133, 136Preview Data dialog box 110, 117Preview Query Data dialog box 137Preview Table Data command 110previewing data 110, 117, 160, 334previewing result sets 133, 136previous method 506primary keys 112, 113

See also joinsprimary result sets 282, 427PrimaryExpression declaration (SQL) 348PrimaryResultSet element 389, 427private properties 427PrivateConnectionProperties element

DesignSessionRequest type 389, 428DesignSessionResponse type 390, 429

PrivateProperties element 389, 427privileges 289procedures 189

See also methodsProductName element 419programming environment 30Progress databases 8, 9

See also databasesProgress page (Information Object Query

Builder) 302Prompt editor 314, 316, 324, 325Prompt editor button 325prompting for input 149, 150, 316prompting for parameters 184, 324, 325, 329prompting for query expressions 153prompting for user input 149prompting for user-specified values 150properties

See also Properties pagead hoc parameters 154, 156custom data source builder and 387custom drivers and 386, 422

data row columns 67, 141data source server connections 9database connections 95, 97fonts 73, 335information object parameters 324, 327information objects 73inheriting 329MDX queries 228name-value pairs for 424, 440native data sources 422ODA data sources 389, 416, 426, 520ODA data streams 426ODA statement objects 520ODBC connections 9output columns 304, 305, 333prompt parameters 324, 325run-time parameters 149SAP BW connection components 257SAP BW data streams 256, 258SAP BW login configurations 211, 215, 261SAP data sets 238SAP login configurations 208, 210SAP Variables 244setting data source 21, 24static parameters 152stored procedures 178table 112textual queries and 134

Properties command 97Properties element

Connection type 405DataSource type 406

Properties pageaccessing 60changing font settings on 73, 336creating custom data sources and 40database connections and 26defining input filters from 51setting database connections and 97setting information object properties 292setting SAP BW fetch size properties

on 257, 258setting sorting options from 44, 45

Properties type 415Property attribute (configurations) 20Property element 412, 416, 424property lists 408, 412

Page 623: Accessing Data

I n d e x 601

property sheets. See Properties pageProperty type 440PropertyType type 416ProviderError element 441public instance variables 51, 54public properties 427PublicConnectionProperties element

DesignSessionRequest type 388, 390, 428DesignSessionResponse type 388, 390, 430

PublicProperties element 389, 427publish method

FileHandler 453Handler 457StreamHandler 556

QQBE expressions 123, 125, 315

entering at run time 153QBE syntax 125queries

See also graphical queries; parameterized queries; textual queries

adding comments to 352building expressions for 295building for

custom data sources 41databases 176information objects 293, 294, 296, 300,

331, 340ODA data sources 387, 389, 390remote data sources 358, 359SAP BW data sources. See MDX queriesSAP R/3 data sources 36

changing result sets for 138–141comparing strings and 357converting 134–136, 162converting case and 363creating 99, 104, 105, 131, 340, 475customizing 115, 164, 300defining conditions with 247, 311, 314defining data streams for 426developing user interface for 396disabling cost-based optimization for 378,

379, 380displaying performance statistics for 137entering statements for. See SQL

statements

executing 164filtering data with 135, 151, 154, 155, 301,

311, 314, 319, 344formatting output for 335–337getting state 486grouping data with 318, 344installing custom drivers and 386, 387instantiating data rows for 36issuing to OLAP data providers 220joining tables for 112, 113joining tables with 342, 378limitations for 340, 344, 354maintaining data source information

for 160, 163merging data with 50naming parameters for 153, 155not returning values 323optimizing 104, 308, 354, 372–378overview 104prerequisites for 98presorting data for 43, 144previewing result sets for 136–138, 160prompting for user input and 149, 150,

153, 324replacing automatically generated 115restricting data retrieval for 123, 127, 148retrieving data with 90, 98, 131returning aggregate rows with 127returning computed fields with 39, 118,

119returning distinct values and 303returning duplicate rows and 303returning multiple results sets 177returning summary data with 120–123running 164, 514, 520saving 331sorting data with 41, 42, 121, 142–145, 317,

344synchronizing 104, 163, 173tracking changes to 171unassigned parameters and 323updating 168, 171, 301validating 315verifying connections for 167

query builder 293Query by Example. See QBE expressions;

QBE syntax

Page 624: Accessing Data

602 A c c e s s i n g D a t a

query data source components 97, 98query data sources

accessing databases and 100accessing ODBC data sources and 100adding 97–99creating for textual queries 131retrieving multiple tables and 50

query data streams 97, 214, 221Query Editor

See also graphical queries; queriesadding tables to 109changing column order with 119changing data types with 119changing join operator for 114changing SQL statements with 115changing table properties with 111creating aggregate rows with 120creating computed fields with 118, 119creating joins with 113creating queries with 36defining ad hoc parameters with 154defining user-specified conditions

with 150deleting joins from 115determining synchronization status 169displaying data sources and owner

information for 107displaying query statements 130, 161freezing columns and rows in 110opening 106overview 104, 106refreshing data dictionary for 168removing columns with 117, 122removing conditions with 126, 127, 128,

129removing tables from 111resizing columns for 110selecting columns with 116setting conditions with 126, 128, 129setting Database Browser options for 108sorting with 143summarizing data with 121verifying connection properties 167

query extensions 341query operators. See operatorsQueryParameterDeclaration declaration

(SQL) 348

QueryText element 431question mark (?) character 155quotation mark characters. See double

quotation mark character; single quotation mark character

RR/3 Basis software 266radio buttons 435random data access 34range of values 125range test operator 358read privilege 289read-only queries 43, 44ReadOnly value 444reconfiguring ODA drivers 387, 397RecordDefinition element

InputParameterDefinition type 436OutputParameterDefinition type 440

recordsSee also rowscopying values from 36creating joins for 113determining logging status for 457filtering 46formatting log file 528, 548getting formatter for 456getting logging level for 456grouping 122matching from multiple tables 112outputting to specific destination 455publishing to log files 453, 454, 457retrieving 34, 100setting formatter for 458sorting 42, 121

reducing JVM heap size 255REFCUR3.GETMGRDATA function 190, 191Reference names field 141references

aliases and 344column names and 105, 141component libraries and 25database views and 341information objects and 264, 352pattern-matching and 341report components and 33

Page 625: Accessing Data

I n d e x 603

SQL queries and 141, 167, 341SQL query conversions and 136table names and 111, 341

Refresh Data Dictionary setting 168Refresh Metadata icon 224refreshing configuration files 13refreshing data dictionaries 168refreshing SAP BW InfoProvider

metadata 224regions. See framesregistry keys 255relational databases. See databasesrelational expressions 125RelationalOperator declaration (SQL) 348relative paths 18, 314, 352remainders 360remote data sources 358, 359remote function-enabled modules 266

See also RFM data sourcesRemove Axis command 236Remove crossjoin command 231Remove properties command 238Remove Properties dialog box 239Remove Set command 237removing. See deletingrenaming

SAP parameters 278stored procedures 182tables 110, 171

report components. See componentsreport design components 30report designs

accessingODA data sources and 387, 390, 426SAP BW data sources and 208

accessing stored procedures for 177–179, 183

addingconnections to 20, 22, 23SAP BEx queries to 214SAP BW ODS data streams to 259

building computed values for 39creating xviicreating connections in 7–9, 96creating SQL queries and 98defining alternative data types for 407, 413developing 30

including configurations in 17installing custom drivers for 386, 393migrating to production environments 24referencing components in 33referencing data sources in 167removing default configurations for 14retrieving data for 9sample configurations for 15saving 40selecting data sources for 25, 83, 386, 396viewing data row variables in 63

Report Encyclopedia. See Encyclopedia volumes

report executables. See report object executable files

report files 59, 166, 386, 409See also specific type

report object design fileschanging fonts for 73, 335copying 166displaying data row variables in 63displaying data rows in 59, 60, 63generating executable files from 59updating query information in 165

report object executable files 7, 117See also executable files

report object library files 20, 165, 166, 386See also libraries

report parameters 427See also parameters

report sectionsadding to designs 60defining multiple data sources for 48displaying data rows in 58, 60placing connections in 5, 7, 30presorting data for 44retrieving data for 6, 7, 33sorting data in 41, 42, 43, 105viewing nested 60

report servers. See iServer; serversReport Structure window 33Report Viewer 60Report Wizard 239

See also Create New Report dialogreportError method 457reports

accessing ODA data sources for 386, 387

Page 626: Accessing Data

604 A c c e s s i n g D a t a

adding titles to 148changing default data access for 30changing fonts for 73creating for

custom data sources 42data from multiple sources 48information objects 289ODA data sources and 428, 444SAP BW data sources 214, 219, 239, 259stored procedure data sources 177, 183,

194text file data sources 78, 83

customizing 30designing. See designing reports; designsgenerating 5installing custom drivers for 387, 391laying out 58overview 4presorting data for 44running 387selecting data for 9, 34, 123

ReportType property 59, 60, 63request and response streams 422, 428, 429request-and-response formats 388, 393, 422Requester dialog box 85, 149, 154Requester page (Information Console) 125required connections 5required data streams 177required parameters 137Required property 328reserved words (Actuate SQL) 351resizing columns 66, 105, 110, 141resources 14response states (ODA) 441ResponseState element 390, 430ResponseState type 441Result Columns page 181, 183result set interface 491result sets

accessing 450changing 138–141changing column order in 304closing cursors in 493defining columns for 133, 424, 441, 444defining metadata for 500defining multidimensional attributes

for 425

defining output columns for 303–304determining column axis type in 425duplicating dimensions and 225excluding SAP BW data for 244, 247, 251filtering data for 311getting column names for 551getting columns in 493, 501, 502getting current 517getting metadata for 467, 497, 515getting names of 468getting number of rows returnable 515getting sort order for 469getting specified 468joining tables and 112, 342mapping data types to 138, 141missing columns in 243moving cursors in 491, 499, 516naming 390previewing 133, 136removing empty members for 235removing output columns from 304renaming stored procedures and 182returning distinct values for 303returning from

information objects 342ODA data sources 388, 389, 390, 392ODS data sources 264Oracle data sources 188, 190SAP BW data sources 224, 225, 226, 244,

251SAP R/3 data sources 276, 282stored functions 189stored procedures 181, 186, 195

returning multiple 190, 199–203, 486, 487, 516

running queries for 100, 427, 514, 520setting new rows for 471, 472setting number of rows returned 499, 520sorting data in 473, 549sorting for

SAP BW data sources 245–247sorting from Textual Query Editor 144specifying as primary 282, 427specifying new rows for 471specifying tables for 472summarizing data from 120testing for null values in 499

Page 627: Accessing Data

I n d e x 605

validating queries for 163, 167viewing default parameters for 137viewing duplicate columns in 182

ResultColumn element 424ResultColumn type 441ResultSetColumns element 390, 444ResultSetDefinition element 388, 390ResultSetDefinition type 444return values 189, 197Rewind method 35RFM data sources

See also SAP R/3 data sourceschanging parameters for 275connecting to 284controlling execution of 284customizing data streams for 34displaying information about 272, 273locating 268, 269, 270rolling back changes to 284selecting 268

RFM error codes 267, 284RFM export parameters 34Right element 432RIGHT function 365RIGHT OPTIONAL keywords 375right outer joins 113.rod files. See report object design files.rol files. See report object library filesrollback method 476RollbackOnFinish property 284rolling back transactions 284, 476ROUND function 361rounding 361Router property 208, 210router strings (SAP) 208row axes 225, 227, 229

See also axes; MDX queriesRow command 227row numbers 51, 54row sets 504rows

See also data row components; data row objects

adding columns to 70adding to joins 307appending to collections 504, 505binding columns to 105

building aggregate 120–123changing fonts for 73creating 36defining custom data streams for 34displaying 58, 59, 60, 62excluding duplicate 117, 303fetching with cursor variables 202filtering 35, 46, 311getting number returned 515getting position of 35, 497getting structures for 468grouping 120merging 50, 51moving cursors for 491, 499, 505, 506overview 36previewing 110, 136processing sequentially 53, 54removing columns from 72removing conditions on 126, 127retrieving with conditions 123, 125, 126returning from

custom data sources 41data adapters 49multiple data sources 48, 50, 51SAP BW ODS data streams 259, 262,

264stored procedures 195text file data sources 81

selecting data for 70, 123setting formats for 66setting number returned 499, 520setting return values for 37, 38sorting 41, 44, 45, 143specifying for input parameters 471specifying threshold values for 381, 382storing computed values in 39

.rox files. See report object executable filesRTRIM function 366running queries 164, 514, 520running reports 387running stored procedures 195run-time connections 23Runtime element (configurations) 24run-time filters

adding to queries 344constructing expressions for 154defining parameters for 148, 153

Page 628: Accessing Data

606 A c c e s s i n g D a t a

setting default values for 247, 248run-time interface (ODA) 417, 450, 481run-time parameters 504run-time queries 126, 149, 153, 311, 341run-time values 149, 325RunTimeInterface type 417

Ssample configuration file 13, 15sample databases 92sample ODA driver 386sample ODBC data sources 91Sample Parameter Values command 180, 181Sample Parameter Values dialog box 181,

187, 188sample values 180, 186sample_configuration_file.xml 15SAP BW BEx queries. See SAP BW BEx Query

BuilderSAP BW BEx Query Builder

See also MDX queriesbuilding data sets for 224building queries with 214, 220, 221, 223,

253clearing queries from 254closing 217, 254defining axes values in 226defining cross-products in 229defining slices with 251defining variables with 243deleting axes with 236deleting data sets for 237deleting properties with 238displaying MDX queries in 254displaying technical names in 224filtering data with 248, 249, 251filtering empty members with 236limiting data returned 220, 247, 251moving axes in 232opening 221, 239removing cross-products with 230, 231retrieving data with 217, 220, 223setting sort order from 245, 247solving memory problems for 256updating metadata for 224viewing metadata and 223

SAP BW BEx Query Cubes 34See also data cubes

SAP BW BEx Query data streams 214SAP BW data sources

accessing 210accessing data in 214building crosstabs for 225, 241, 242building queries for 36building reports for 214, 219, 225, 239, 259changing data layouts for 232changing designs for 219choosing layouts for 218, 239clearing queries for 254connecting to 8, 210, 215, 222, 257, 260customizing data streams for 34filtering data in 236, 247–251limiting data returned from 220, 243logging in to 208, 209, 215, 222retrieving data from 9, 210, 217, 223, 255selecting InfoProvider for 222, 223selecting queries for 224setting up environments for 208sorting result sets for 245–247troubleshooting memory problems

with 254–258verifying queries for 254

SAP BW data streams 255, 256, 258SAP BW InfoProviders

accessing 221filtering data from 247–251querying 214, 221, 242, 251retrieving data from 222, 247selecting 222, 223troubleshooting memory problems

with 254–258SAP BW login configurations 208, 209, 215,

261SAP BW ODS data sources 261, 264SAP BW ODS data streams 254, 259–264SAP BW ODS objects 259, 262SAP BW ODS option 261SAP BW run-time log files 256SAP connection components 210, 256, 257,

260SAP Connection option 260SAP documentation 214, 223SAP GUI clients 208

Page 629: Accessing Data

I n d e x 607

SAP InfoProviders. See SAP BW InfoProviders

SAP Java Connector libraries 208, 209, 266SAP Java Development Tools 209SAP Logon dialog box 210, 216, 221SAP MetaData Interface 266SAP parameters 278, 279, 280, 281SAP patches 208SAP R/3 Data Source Builder

accessing 268closing 268creating queries with 276default parameter mappings for 279displaying business object information

with 272, 273hiding parameters from 278locating business objects with 268, 269,

270, 271renaming parameters with 278returning result sets from 282running RFM data sources from 284viewing parameters from 276

SAP R/3 data sourcesbuilding queries for 36changing parameters for 275, 279, 281connecting to 8, 267customizing data streams for 34displaying information about business

objects in 272displaying parameters for 273, 274, 276,

278filtering business objects for 270finding business objects for 268, 269, 270installing libraries for 209installing metadata interface for 266logging in to 209, 222, 268retrieving data from 9, 266, 267, 268, 284setting up environments for 266specifying primary result set for 282

SAP R/3 data streams 266SAP R/3 login configurations 209SAP R/3 Login dialog box 268SAP router strings 208SAP Service Marketplace 208SAP Variables 242–244SAP Variables page (SAP BW BEx Query

Builder) 243

SAPmdi.jar 266SAPQueryCubeSource data streams 221saving

components 60queries 331report designs 40temporary files 388

scalar data types 404, 413, 438scalar parameters

ODA data sources and 430, 464SAP data sources and 276, 464

scalar subqueries 342scalar values 342, 356, 359ScalarDataType declaration (SQL) 349Scale declaration (SQL) 349schemas

accessing data and 90configuring ODA custom drivers and 397,

402creating ODA data sources and 422determining if current 169updating 165, 168

Scratch Pad 60search expressions 182search function 366Search page (SAP R/3 Data Source

Builder) 271search paths 18searching for

business objects 268, 269, 270embedded strings 557stored procedures 182

section components 6sections

See also specific typeadding to designs 60defining multiple data sources for 48displaying data rows in 58, 60placing connections in 5, 7, 30presorting data for 44retrieving data for 6, 7, 33sorting data in 41, 42, 43, 105viewing nested 60

SeekBy method 35SeekTo method 35SeekToEnd method 35select all operator 133

Page 630: Accessing Data

608 A c c e s s i n g D a t a

Select Component dialog box 8, 96Select Database dialog box 94Select join type settings 308select painter. See Query EditorSELECT statements

See also SQL statementsautomatically generating 104, 130building manually 104, 131creating 131creating joins with 343database cursors and 100Describe Query operations and 133, 140filtering data with 340, 344grouping data with 344naming parameters for 153, 155nesting 127obtaining 161, 163OrderBy property and 44ordering data with 344parameter names in 155type casting rules for 341

Selection command 250selection formulas. See parametersSelectItem declaration (SQL) 349SelectList declaration (SQL) 349SelectNameValueList element 436SelectStatement declaration (SQL) 349SelectValueList element

InputFieldDefinition type 434InputParameterDefinition type 436PropertyType type 416

SelectWithoutFrom declaration (SQL) 349SelectWithoutOrder declaration (SQL) 349semicolon (;) character 244separators (numbers) 312, 323sequential sections 7, 60serial values 370server login configurations 208, 210server names 8servers

See also iServerconnecting to 8, 9, 95, 97logging in to SAP data sources and 208,

210running textual queries and 133

session state 431, 447SessionEditMode element 429

SessionEditMode type 444SessionLocale element 390, 429SessionLocale type 445setBigDecimal method

IRowSet 506IStatement 518

SetClause declaration (SQL) 349setDate method

IRowSet 507IStatement 518

setDouble methodIRowSet 507IStatement 518

setFilter method 458setFormatter method

Handler 458StreamHandler 556

setHandler method 533setInt method

IRowSet 508IStatement 519

SetJavaThreadContextClassLoader element 411

setLevel methodHandler 458Logger 533LogRecord 541

setLogConfiguration method 392, 477setLoggingErrorHandler method 458setMaxRows method

IResultSet 499IStatement 520

setMessage method 541setMillis method 542setNewRow method 471setNewRowSet method 472setNextException method 547setOutputStream method 556setProperty method 520setPropertyInfo method 520sets (MDX queries) 220

See also data sets; result setssetSortSpec method

ICallStatement 472IStatement 521

setString methodIRowSet 508

Page 631: Accessing Data

I n d e x 609

IStatement 521setThrown method 542setTime method

IRowSet 509IStatement 522

setTimestamp methodIRowSet 510IStatement 522

settings. See propertiesSetupDataRow method 36SetValue method 37, 38SEVERE constant 525SEVERE level messages 533severe method 533SEVERE_LEVEL constant 525sharing connections 7ShortDescription element 389, 428Show system objects setting 108SignedLiteral declaration (SQL) 349SimpleCondition declaration (SQL) 350SimpleFormatter class 392, 548Single data type 196SINGLE EXEC keywords 354Single Input Filter setting 47single input filters 35single quotation mark (’) character

parameters and 323queries and 346

Single type (SAP Variables) 244single value expressions 126size method 510Size property 328slice (defined) 220Slices page (SAP BW BEx Query Builder) 251slices, specifying 251–253sort columns 318sort criteria 42, 142, 550sort filter utility 144sort filters

adding for custom data sources 42creating 45, 144restrictions for 35, 142

sort keysadding 550associating with group sections 42, 43,

142, 144associating with statements 549

caution for 43, 144counting 552defined 41getting column names for 551

sort mode constants 482sort modes 485, 549, 550, 552sort options 144sort order

changing programmatically 46defining for custom data sources 42, 44determining default 105getting 469, 552setting 246, 549specifying with queries 41, 143

sort order constants 549, 552Sort page (Information Object Query

Builder) 317sort specifications (ODA) 469, 473, 517, 521

See also SortSpec classsortAsc constant 549, 552sortDesc constant 549, 552sorting criteria 42, 43sorting data

custom data sources and 35, 41, 42databases and 142defaults for 41, 43, 144from report designs 45guidelines for 41in result sets 469, 549information objects and 317non-sequential data streams and 34ODA result sets and 469, 473, 549overview 41SAP BW data sources and 245–247with OrderBy property 44, 142with queries 121, 142–145

sorting information, preserving 59Sorting page 43sorting precedence 42, 142Sorting property 42, 44, 145sortModeColumnOrder constant 482, 485,

550, 552sortModeNone constant 482, 485, 550, 552sortModeSingleColumn constant 482, 485,

550, 552sortModeSingleOrder constant 482, 485, 550,

552

Page 632: Accessing Data

610 A c c e s s i n g D a t a

SortSpec class 392, 549source code

See also Actuate Basicaccessing text files and 5, 83creating locale-specific reports and 429customizing data streams and 34executing stored procedures and 199filtering data and 46, 49implementing custom drivers with 386referencing column names in 105, 141sorting data and 43throwing errors and 543verifying input values with 154

Source parameter field 329, 330source parameters 328–330space characters. See white space charactersspecial characters

See also specific charactercolumn aliases and 304filter conditions and 314query statements and 315, 322

specialized reporting 148Specify Parameter Values dialog box 137spreadsheet files 34spreadsheet reports

accessing SAP data sources and 266creating queries for 311

spreadsheet server. See iServerSQL compiler 309SQL conventions (Actuate) 345SQL data sources. See query data sourcesSQL data types 355, 356

listed 355SQL databases

See also databasesconnecting to 8retrieving data from 9, 34, 36

SQL editoraccessing information objects and 295, 331creating queries and 332

SQL editor icon 331SQL expressions 125, 126, 129, 295, 356SQL functions

aggregating data and 371current user and 372numeric data types and 360string data types and 362

substrings and 364, 366timestamp values and 367

SQL identifiers 352SQL keywords 351SQL operators 341, 358

See also operatorsSQL page (Query Editor) 130, 161SQL parameters 322–324SQL Preview page 301SQL Preview page (Information Object Query

Builder) 332, 340SQL statements

See also queriesadding column names to 352adding conditions to 151, 154, 155adding filters to 311, 319, 344adding functions to 119, 121, 341adding parameters to 323, 341, 356adding sort keys to 144applying conditions with 123, 125, 126,

127, 129binding parameters to 164building automatically 104, 106building manually 104building text-based. See textual queriescopying 131creating 340, 475deleting filter conditions in 314displaying 129, 130, 161, 301entering at run time 126, 149, 153, 341overriding 162, 163referencing aliases and 344referencing columns in 173referencing information objects in 352referencing parameters in 341referencing tables or views in 111, 341removing column references in 173removing columns from 117, 122removing conditions from 127, 129removing tables from 111reordering columns in 119select all operator in 133selecting columns for 116, 119, 120, 352selecting predefined data sources for 386selecting tables for 106, 109, 112, 341, 372updating 163, 164, 165, 173

SQL text editor. See SQL editor

Page 633: Accessing Data

I n d e x 611

SQL-92 keywords 351, 352SQLSTATE value 486, 543, 546sqlStateSQL99 constant 482sqlStateXOpen constant 482square brackets ([ ]) characters

MDX queries and 253SAP Variables and 244

Start methodbuilding custom data streams and 34creating input adapters and 52creating input adapters with 55displaying CSV data and 83, 84filtering data and 36generating content with 38instantiating connections and 30

StartNextSet method 195state 431, 447StateInfo element 432StateInfo type 447StateInfoBlob element 447StateInfoString element 447statement interface 511statements

accessing 392, 450associating sort keys with 549calling 462closing 513creating 475defined 511determining parameter type for 464, 487determining supported parameters

for 486, 487executing 514, 520getting current result set 517getting metadata for 515getting number of active 480getting number of rows returned 515getting parameters for 489, 516getting result sets for 468getting sort specifications 517preparing 517returning number of parameters in 489returning result sets from 486setting number of rows returned 520setting properties for 520specifying sort specification 521

static data filters

creating 311, 320, 322deleting 312, 321

static parametersadding to queries 116, 126, 151, 152changing data types for 153filtering data with 311prompting for input and 149, 150restrictions for 189, 311setting properties for 152viewing properties for 152

Static Parameters page (Textual Query Editor) 152, 153

static variables 80stored function icon 189stored functions 188, 189, 190, 199Stored Procedure Browser 180, 182, 189Stored Procedure command 182stored procedure controls 183Stored Procedure Data Source Builder

accessing Sample Parameter Values dialog from 181

adding weak cursor type definitions with 188

checking for required parameters with 186designating parameter type with 185opening 180returning multiple result sets and 190selecting stored procedures for 181, 182specifying parameter type in 185

stored procedure data sources 177, 179See also stored procedures

Stored Procedure Name Editor 182Stored Procedure Name Editor

command 182Stored Procedure page (Options) 182stored procedures

See also input parameters; output parameters

accessing definitions for 199accessing multiple result sets for 199–203calling statements for 462checking for parameters in 186creating cursors for 195creating custom data streams for 34, 194customizing 194–203designing for 177–179displaying 180, 182

Page 634: Accessing Data

612 A c c e s s i n g D a t a

entering parameters for 184, 185entering sample values for 180, 186executing on Oracle databases 188, 196,

199executing programmatically 195extracting IDs from 197extracting return values from 197filtering data with 46overview 176placing data in reports from 183–184renaming 182retrieving data with 90, 131, 183returning results sets for 177, 181returning status values with 195searching for 182selecting 179, 180, 182setting sort order for 43, 44specifying parameter type for 185synchronizing 176, 188verifying contents 188

StoredProcedureSource data stream 177, 178StreamedResultSetBufferSize element 417StreamHandler class 392, 554streaming log records 554String data type 196, 509, 521string data types 355String element

ArrayOfString type 405, 425OdaDataType type 438OdaScalarDataType type 439

string functions 362, 364, 366string operators 362string parameters 356string substitution 557, 560, 561strings

assigning to parameters 323, 330, 521casting rules for 357comparing 105, 357, 358concatenating 346, 363converting case 363creating list of values and 314entering in filter conditions 312, 320entering in SQL statements 355expressions and 119, 121formatting 528, 548getting column values as 497getting delimited 557

getting length of 363getting output parameter 469getting version numbers as 480locating embedded 557matching characters in 315, 341, 364parsing 364returning sort specification as 553returning substrings in 366setting maximum length for 355setting values for 323, 509trimming white space in 366

StringSubstitutionUtil class 392, 557structure definition icon (SAP R/3

Builder) 274Structure Definition page (SAP R/3 Data

Source Builder) 274Structure element 438structure parameters

ODA data sources and 464, 468SAP data sources and 276, 278

structures 504subclassing components 25subqueries

creating 341, 354–355grouping data and 344matching character patterns and 341optimizing 354returning scalar values 342

SubQuery declaration (SQL) 350substituteByIndex method 560substituteByName method 561SUBSTRING function 365substrings 364, 366, 461subtraction 359subtraction operator 359SUM function 371, 376summarizing data 119, 120–123summary data 120, 121, 371supportsInParameters method 486supportsMultipleOpenResults method 486supportsMultipleResultSets method 486supportsNamedParameters method 487supportsNamedResultSets method 487supportsOutParameters method 487synchronization tools 165Synchronize button 305Synchronize icon 330

Page 635: Accessing Data

I n d e x 613

Synchronize Query button 169Synchronize Query command 174Synchronize Query with Schema dialog

box 169, 170, 171Synchronize Stored Procedure command 188synchronizing

queries 104, 163, 173source parameters 330stored procedures 176, 188

synonyms 106, 109syntax (SQL) 345, 346system DSNs 91, 92system failures 255system information 372system numbers (SAP) 209system tables 106SystemID property 210SystemNumber property 209, 210

Ttab characters 351table aliases 332table definition icon (SAP R/3 Builder) 274Table Definition page (SAP R/3 Data Source

Builder) 274Table element 438"Table invalid or not found" message 171table names

changing 111entering aliases for 109entering in SQL statements 352formatting 112including data source information in 107qualifying 132returning truncated 58

Table or view pattern match setting 108table parameters (SAP data) 276, 278Table Property page (Query Editor) 112, 167,

171TableParameter declaration (SQL) 350TableParameters declaration (SQL) 350tables

See also databasesadding to queries 109, 112, 341building at run time 472, 504changing properties for 112checking database connections for 167

choosing columns in 116, 132creating joins for 50, 112, 113, 342input parameters and 472linking related 112matching records in multiple 112naming 109referencing 111, 341referencing columns in 136, 141removing from queries 111removing joins from 112, 115renaming 110, 171retrieving data for 34selecting 106specifying as optional 372–377specifying as primary result set 276, 282specifying fields in 19synchronizing queries and 104updating 171viewing columns in 110viewing data in 110, 117, 160

Tables and Views options (Database Browser) 108

Tabular layout style 241technical names (MDX queries) 223, 224, 254Temp directory 389TEMP environment variable 389temporary files 388temporary objects 31testing

for invalid values 499for null values 362, 473, 499, 503for range of values 358for set of values 359information objects 334

text 346, 364text boxes 433, 435text editors 15text file data sources. See text filestext files

accessing data in 78closing 84connecting to 5, 79customizing data sources for 79customizing data streams for 34defining data row variables for 81designing for 83displaying data from 85

Page 636: Accessing Data

614 A c c e s s i n g D a t a

opening 84retrieving data from 78, 83specifying connection properties in 12

Text Format property 306text formats 443text strings. See stringsTextFormat element 443textual queries

adding parameters to 152–153, 155, 156applying conditions with 151, 155building expressions for 295building for information objects 331case-insensitivity in 105changing 132, 134changing result sets for 138, 140changing statements for 162clearing 133converting graphical queries to 98, 134–

136, 162creating 99, 104, 131–134displaying output columns for 332displaying parameters for 333displaying statements for 161filtering data with 105, 135, 155overriding statements for 162previewing 133, 136, 160qualifying table names for 132saving 331selecting columns for 132setting properties for 134sorting data with 144, 145synchronizing 163, 164tracking changes to 171trimming trailing spaces for 105undoing changes to 133updating 164

textual query data sources 98, 131 See also query data sources

Textual Query Editoraccessing 131changing properties with 134defining ad hoc parameters with 156defining static parameters with 152, 153displaying context menu for 132displaying SQL statements 161entering SQL statements with 36, 132erasing statements in 133

overview 104restrictions for 141sorting with 144updating information for 133

textual query editor 295third-party databases 185thousands separator 312, 323threshold values (SQL indexes) 381, 382time

See also time stampsgetting 470, 498, 541setting 509, 522, 542

Time data type 509, 522Time element

OdaDataType type 438OdaScalarDataType type 439

time stampsassigning to parameters 330comparing 358filtering 312, 320getting 470, 498setting 510, 522specifying default 323SQL conventions for 346, 355, 356

TIMESTAMP data type 355Timestamp data type 356, 510, 522Timestamp element

OdaDataType type 438OdaScalarDataType type 439

timestamp functions 367TIMESTAMP_STRING token (SQL) 346TitleFont property 73, 74, 336titles 73, 336

adding to reports 148Toggle Unique Names icon 224tokens (SQL grammar) 346Toolbox 6, 98toString method 553totals 184, 371TraceLogging element 417TraceLogging type 418trailing spaces 105transactions

committing 474rolling back 284, 476

transient files. See temporary filestransient objects 31

Page 637: Accessing Data

I n d e x 615

TRIM function 105, 366true values. See Boolean valuestruncated characters 66truncated columns 110, 138truncated table and column names 58truncation 356tuples (defined) 220Type attribute (configurations) 19, 24type casting 341, 356type declarations 347, 349Type element 389, 428Type of Join settings 114types. See data types

UUnaryExpression declaration (SQL) 350UnaryLogicalExpression declaration

(SQL) 350unassigned parameters 323undefined parameters 149, 185underscore (_) character 364unformatted data 58, 59Unicode strings 346, 355union filters 49, 53, 54UNION statement 340, 349unique values 114units of time 367unknown data types 305UNKNOWN keyword 185unknown parameters 185unnamed delimited strings 557, 560, 561unnamed parameters 341UnsignedLiteral declaration (SQL) 350UnsupportedOperationException

constant 450UnsupportedOperationException objects 544UPDATE statements 164updating

configurations 387data dictionaries 168data sources 163database schemas 165, 168queries 168, 171, 301SAP BW InfoProvider metadata 224SQL statements 163, 164, 165, 173stored procedures 188

UPPER function 105, 363uppercase to lowercase conversions 363URLs

information objects and 292SAP documentation 214, 223SAP Java Connector libraries 208SAP patches 208specifying search paths with 18

user DSNs 91user interfaces 387, 388user names

accessing databases and 95, 100accessing information objects and 292accessing ODBC data sources and 91connecting to SAP data sources and 267,

268creating connections and 8filtering on 311returning 372

UserCancelled element 441users

defining filters and 247, 248entering filters at run time 148, 154prompting for input 153prompting for input from 149prompting for specific values 149, 150, 154

VV_CURRENCY type code 196V_DATE type code 196V_DOUBLE type code 196V_INTEGER type code 196V_LONG type code 196V_SINGLE type code 196V_STRING type code 196Value element

NameValuePair type 437Property type 440PropertyType type 416

value expressions 126ValueColumn element 431ValueExp property 37

See also value expressionsValueExpression declaration (SQL) 350values

See also data

Page 638: Accessing Data

616 A c c e s s i n g D a t a

aggregating. See aggregationassigning to parameters 137, 150, 278, 323,

330, 353assigning to variables 243, 244choosing from lists 324, 325comparing 46, 105, 357, 358computing 39, 118counting non-null 371displaying default 137entering default 323, 327entering invalid 137entering null 500getting decimal precision for 490, 503hiding 327hiding parameters and 278inputting sample 180, 186prompting for 149, 150, 154QBE conventions for 125returning largest 360returning smallest 360returning unique 114rounding 361SAP parameters and 280selecting at run time 149, 153, 311, 325selecting data and 123setting date 507, 518setting decimal 506, 518setting for controls 38setting numeric 507, 508, 519setting string 509, 521setting time 509, 522setting time stamp 510testing for invalid 499testing for null 362, 473, 499, 503testing range of 358testing sets of 359verifying user-specified 154

ValueSelectItem declaration (SQL) 350ValueSelectList declaration (SQL) 350VARCHAR data type 355variable names 66variable type mappings 195variables

See also data row variablesaccessing multiple data sources and 54adding to SAP BEx queries 242–244assigning to ODS objects 262

assigning values to 243, 244associating with data rows 36, 65binding to columns 195changing 62, 65connecting to text files and 79creating computed fields and 39, 116, 118defining data sources and 40defining static 80displaying 63, 82, 141merging data rows and 51naming parameters and 185redefining attributes of 65specifying parameters as 80, 185, 322

Variables page (Properties) 79, 262Variant data types 119, 196variant strings 356Vendor element 419VendorInfo type 419VendorPhone element 419VendorURL element 419Verify MDX button 254verifying stored procedure content 188Version element 419, 432version numbers

getting custom driver 479, 480getting data source 484, 485getting ODA interface 481

Viewer 60viewing

business objects 268, 269column names 172connection properties 9, 178data 58, 110, 117data row variables 63, 141data rows 58, 59, 60, 62default values 137error messages 300information objects 296, 302MDX queries 253, 254nested sections 60ODBC data sources 92ODBC drivers 93output columns 332owner information 107performance statistics 137query statements 130report parameters 333

Page 639: Accessing Data

I n d e x 617

sample configurations 15SAP BW metadata 223, 224SAP parameters 276, 278SQL statements 129, 161, 301stored functions 189stored procedures 180, 182system data sources 93unformatted data 59

viewsdisplaying 106formatting names 112referencing 341selecting 106, 109updating 171

Visual Basic type codes 196volumes. See Encyclopedia volumes

Wwarehouses 243WARNING constant 525WARNING level messages 534warning method 534WARNING_LEVEL constant 525WarnValueFormatAdjustment element 410wasNull method

ICallStatement 473IResultSet 499

weak cursors (defined) 188web sites

accessing SAP documentation and 214, 223

downloading SAP patches from 208WHEN clause 350WhenClause declaration (SQL) 350WHERE clause 112, 123, 125, 344, 350

See also SQL statementssetting at run time 154

WhereClause declaration (SQL) 350white space characters

in columns 105in queries 155, 346, 351, 352in strings 366

wildcard characters 270Windows registry keys 255WITH clause 315, 341

See also SQL statements

wizardsSee also specific report wizardaccessing information objects with 289creating queries and 98defining default connections for 20retrieving data with 9selecting SAP BW data layouts and 239specifying data sources for 25specifying sort order with 43

Word Wrap property 306word wrapping 444Work Offline on SAP Logon setting 284Wrap element 444WRITE_FAILURE constant 535

XXML data sources 8, 9, 34, 36XML documents 12, 15XML elements 404, 422XML files

ODA data source builder and 387, 388, 422opening 34

XML request and response streams 422, 428, 429

XML schemas 422

Page 640: Accessing Data

618 A c c e s s i n g D a t a