
Query System Features October 2006 How-to Guide SAP NetWeaver ‘04 How To… Use Query Functions with the Distributed Query Engine (DQE) Version 3.00 – April 2006 Applicable Releases: SAP NetWeaver ’04 © Copyright 2006 SAP AG. All rights reserved. contained in this document serves informational purposes only. National product specifications may vary. No part of this publication may be reproduced or transmitted in any form or for any purpose These materials are subject to change without notice. These without the express permission of SAP AG. The materials are provided by SAP AG and its affiliated companies information contained herein may be changed ("SAP Group") for informational purposes without prior notice. only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to Some software products marketed by SAP AG and the materials. The only warranties for SAP Group products its distributors contain proprietary software and services are those that are set forth in the express warranty components of other software vendors. statements accompanying such products and services, if any. Microsoft, Windows, Outlook, and PowerPoint are Nothing herein should be construed as constituting an registered trademarks of Microsoft Corporation. additional warranty. IBM, DB2, DB2 Universal Database, OS/2, Parallel These materials are provided “as is” without a warranty of any Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, kind, either express or implied, including but not limited to, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, the implied warranties of merchantability, fitness for a Intelligent Miner, WebSphere, Netfinity, Tivoli, and particular purpose, or non-infringement. Informix are trademarks or registered trademarks SAP shall not be liable for damages of any kind including of IBM Corporation in the United States and/or without limitation direct, special, indirect, or consequential other countries. damages that may result from the use of these materials. Oracle is a registered trademark of Oracle SAP does not warrant the accuracy or completeness of the Corporation. information, text, graphics, links or other items contained UNIX, X/Open, OSF/1, and Motif are registered within these materials. SAP has no control over the trademarks of the Open Group. information that you may access through the use of hot links contained in these materials and does not endorse your use of Citrix, ICA, Program Neighborhood, MetaFrame, third party web pages nor provide any warranty whatsoever WinFrame, VideoFrame, and MultiWin are relating to third party web pages. trademarks or registered trademarks of Citrix Systems, Inc. SAP NetWeaver “How-to” Guides are intended to simplify the product implementation. While specific product features and HTML, XML, XHTML and W3C are trademarks or procedures typically are explained in a practical business registered trademarks of W3C®, World Wide Web context, it is not implied that those features and procedures Consortium, Massachusetts Institute of are the only approach in solving a specific business problem Technology. using SAP NetWeaver. Should you wish to receive additional Java is a registered trademark of Sun Microsystems, information, clarification or support, please refer to SAP Inc. Consulting. JavaScript is a registered trademark of Sun Any software coding and/or code lines / strings (“Code”) Microsystems, Inc., used under license for included in this documentation are only examples and are not technology invented and implemented by intended to be used in a productive system environment. The Netscape. Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the MaxDB is a trademark of MySQL AB, Sweden. correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP intentionally or grossly negligent. NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data 2 Contents Query System Features................................................................................................................... 4 Query Constructs.................................................................................................................. 4 Supported SQL Constructs ............................................................................................ 4 UNSUPPORTED SQL CONSTRUCTS................................................................................ 6 METADATA IDENTIFIERS................................................................................................... 6 Prohibited Characters in Identifiers ................................................................................ 8 JOINS ................................................................................................................................... 8 Explicit Joins................................................................................................................... 8 Join Processing .............................................................................................................. 8 Dependent Join .............................................................................................................. 8 Implicit Type Conversions During Join........................................................................... 9 EXPRESSIONS .................................................................................................................... 9 DATATYPES ........................................................................................................................ 9 DATATYPE CONVERSIONS ............................................................................................. 11 FUNCTIONS.......................................................................................................................14 Numeric ........................................................................................................................ 14 String 16 Type 19 Miscellaneous............................................................................................................... 19 Query Grammar............................................................................................................................. 21 Notation............................................................................................................................... 21 Special Terminals ...............................................................................................................21 Non-Terminals .................................................................................................................... 22 3 Query System Features This booklet is designed to serve as a reference for developers of SAP NetWeaver ’04 portal content. It is meant to supply the technical information necessary for content that retrieves data from back-end applications using the Distributed Query Engine (DQE). Query Constructs Supported SQL Constructs SQL queries start with the SELECT keyword and are often referred to as “SELECT statements” as well. The SAP Distributed Query Engine (DQE) supports most but not all of the standard SQL query constructs. Many of these features can be combined to execute complex queries against the DQE service. The following list of features gives an overview of the kinds of queries that can be executed using the Distributed Query Engine. Nearly all of these features follow standard SQL syntax and functionality. Please refer to your preferred standard SQL reference for detailed information on how to use these features. The ordering of the clauses in a query are as follows: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, and OPTION. All of these clauses are optional except SELECT and FROM, which are required. SELECT Clause Features • SELECT * • SELECT table.* • SELECT expression, … • SELECT expression AS name • SELECT DISTINCT expression • SELECT COUNT(*) • SELECT COUNT(expression), COUNT(DISTINCT expression) • SELECT SUM(expression), SUM (DISTINCT expression) • SELECT AVG(expression), AVG (DISTINCT expression) • SELECT MIN(expression), MIN (DISTINCT expression) • SELECT MAX(expression), MAX (DISTINCT expression) FROM Clause Features • FROM table • FROM table AS name • FROM table AS name1, table AS name2 • FROM table1 JOIN table2 ON join-criteria • FROM table1 CROSS JOIN table2 • FROM table1 RIGHT OUTER JOIN table2 ON join-criteria • FROM table1 LEFT OUTER JOIN table2 ON join-criteria • FROM table1 FULL OUTER JOIN table2 ON join-criteria 4 • FROM (table1 JOIN table2 ON join-criteria) JOIN table3 ON join-criteria • FROM (SELECT …) AS name WHERE Clause Features • WHERE expression1 = expression2 • WHERE expression1 <> expression2 • WHERE expression1 < expression2 • WHERE expression1 <= expression2 • WHERE expression1 > expression2 • WHERE expression1 >= expression2 • WHERE expression1 LIKE expression2 • WHERE expression1 LIKE expression2 ESCAPE character • WHERE expression1 IN (expression2, …) • WHERE expression1 IN (SELECT expression2…) • WHERE expression1 IS NULL • WHERE NOT criteria • WHERE criteria1 AND criteria2 AND … • WHERE criteria1
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages24 Page
-
File Size-