HP Nonstop ODBC Server Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
HP NonStop ODBC Server Reference Manual Abstract This manual describes the HP NonStop™ ODBC Server, a product that allows applications written for the Microsoft ODBC interface, Microsoft SQL Server interface, and Sybase SQL Server interface to access an HP NonStop SQL/MP database. This manual describes the NonStop ODBC Server hardware and software requirements, architecture, the CORE SQL language, the Transact-SQL language, stored procedures, pass-through mode, customized NonStop SQL/MP catalogs, and mapping tables. Product Version NonStop ODBC Server 2.0 Supported Release Version Updates (RVUs) This manual supports D32.00 and all subsequent D-series RVUs, and G01.00 and all subsequent G-series RVUs, until otherwise indicated in a new edition. Part Number Published 429151-002 September 2003 Document History Part Number Product Version Published 138789 NonStop ODBC Server 2.0 April 1998 424092-001 NonStop ODBC Server 2.0 September 1999 426087-001 NonStop ODBC Server 2.0 May 2000 429151-001 NonStop ODBC Server 2.0 January 2001 429151-002 NonStop ODBC Server 2.0 September 2003 HP NonStop ODBC Server Reference Manual Glossary Index Examples Figures Tables What’s New in This Manual xix Manual Information xix New and Changed Information xix About This Manual xxi Audience xxi Organization of This Manual xxi Related Manuals xxiii Notation Conventions xxv 1. Introduction Purpose of the NonStop ODBC Server 1-1 Application Interface 1-2 ODBC Interface 1-2 DB-LIBRARY Interface 1-3 How the NonStop ODBC Server Works 1-4 Users of the NonStop ODBC Server 1-5 Hardware and Software Requirements 1-5 NonStop Server Requirements 1-5 DOS/Windows Workstation Requirements 1-6 UNIX Workstation Requirements 1-7 SQL Language Support 1-7 Supported and Unsupported ODBC Features 1-7 Supported and Unsupported SQL Server Features 1-9 2. Architecture Overview Background 2-3 Client/Server Applications 2-3 SQL Gateways 2-4 Client-Side View 2-5 Types of Clients 2-6 Databases and Datasources 2-7 Connections 2-11 Hewlett-Packard Company—429151-002 i Contents 2. Architecture Overview (continued) 2. Architecture Overview (continued) Server-Side View 2-13 Major Components 2-13 Message Flows 2-16 NonStop ODBC Server Objects and Relationships 2-19 Name Mapping 2-22 NonStop ODBC Server Catalogs 2-22 NonStop ODBC Server 2-27 SQL Communication Subsystem 2-30 NOSUTIL 2-37 NonStop SQL/MP Execution 2-40 Stored Procedure Execution 2-42 3. CORE SQL Language NonStop ODBC Server Translation 3-1 Unsupported ODBC Features 3-2 Language Elements 3-2 Names 3-3 Data Types 3-8 Escape Clauses 3-11 Functions 3-14 String Functions 3-21 Search Conditions 3-24 Expressions and Operators 3-25 Aggregates 3-27 Wild-Card Characters 3-28 CASE Expression 3-29 CORE SQL Statements 3-31 ALTER TABLE 3-33 Example 3-34 Adding Multiple Columns 3-34 CORE SQL Compared With NonStop SQL/MP 3-34 CALL 3-35 Example 3-36 CORE SQL Compared With NonStop SQL/MP 3-36 CREATE INDEX 3-37 Examples 3-37 CORE SQL Compared With NonStop SQL/MP 3-38 CREATE TABLE 3-39 HP NonStop ODBC Server Reference Manual—429151-002 ii Contents 3. CORE SQL Language (continued) 3. CORE SQL Language (continued) Examples 3-41 File Attributes and Security Considerations 3-41 Creation of Partitioned Tables 3-42 CORE SQL Compared With NonStop SQL/MP 3-42 CREATE VIEW 3-43 Examples 3-44 Shorthand Views and Protection Views 3-44 CORE SQL Compared With NonStop SQL/MP 3-45 DELETE 3-45 Positioned DELETE 3-45 Searched DELETE 3-46 Examples 3-47 CORE SQL Compared With NonStop SQL/MP 3-47 DROP INDEX 3-47 Example 3-47 CORE SQL Compared With NonStop SQL/MP 3-47 DROP TABLE 3-48 Example 3-48 Dropping Dependent Views and Indexes 3-48 Dropping Partitioned Tables 3-49 CORE SQL Compared With NonStop SQL/MP 3-49 DROP VIEW 3-49 Example 3-49 Dropping Dependent Views and Indexes 3-50 CORE SQL Compared With NonStop SQL/MP 3-50 GRANT 3-50 INSERT 3-51 Example 3-52 CORE SQL Compared With NonStop SQL/MP 3-52 POWER 3-53 Example 3-53 REVOKE 3-53 SELECT 3-54 Standard SELECT 3-54 Examples 3-55 SELECT for Update 3-59 CORE SQL Compared With NonStop SQL/MP 3-59 UPDATE 3-61 HP NonStop ODBC Server Reference Manual—429151-002 iii Contents 3. CORE SQL Language (continued) 3. CORE SQL Language (continued) Positioned UPDATE 3-61 Searched UPDATE 3-62 Example 3-63 CORE SQL Compared With NonStop SQL/MP 3-63 4. Transact-SQL Language NonStop ODBC Server Translation 4-1 Using Transact-SQL Through the NonStop ODBC Server 4-2 Unsupported Features 4-3 Mapping of Table, View, and Index Names 4-3 DDL Statements Allowed in User-Defined Transactions 4-3 Specifying the Database Location 4-4 Batch Queries 4-4 Language Elements 4-5 Names 4-5 Data Types 4-12 Functions 4-17 Variables 4-26 Search Conditions 4-28 Expressions and Operators 4-29 Aggregates 4-31 Wild-Card Characters 4-33 NULL Values 4-34 Comments 4-35 Summary of Statements 4-35 Defaults, Rules, and Triggers 4-39 Miscellaneous Transact-SQL Statements 4-40 ALTER TABLE 4-42 Examples 4-42 Adding Multiple Columns 4-43 NonStop ODBC Server Compared With SQL Server 4-43 NonStop ODBC Server Compared With NonStop SQL/MP 4-44 BEGIN...END 4-44 Examples 4-44 NonStop ODBC Server Compared With SQL Server 4-45 NonStop ODBC Server Compared With NonStop SQL/MP 4-45 BEGIN TRANSACTION 4-45 Examples 4-45 HP NonStop ODBC Server Reference Manual—429151-002 iv Contents 4. Transact-SQL Language (continued) 4. Transact-SQL Language (continued) NonStop ODBC Server Compared With SQL Server 4-46 NonStop ODBC Server Compared With NonStop SQL/MP 4-46 COMMIT TRANSACTION 4-46 Examples 4-47 NonStop ODBC Server Compared With SQL Server 4-47 NonStop ODBC Server Compared With NonStop SQL/MP 4-48 CREATE DATABASE 4-48 Examples 4-49 NonStop ODBC Server Compared With SQL Server 4-49 NonStop ODBC Server Compared With NonStop SQL/MP 4-50 CREATE INDEX 4-51 Examples 4-52 NonStop ODBC Server Compared With SQL Server 4-52 NonStop ODBC Server Compared With NonStop SQL/MP 4-53 CREATE TABLE 4-54 Examples 4-55 NonStop ODBC Server Compared With SQL Server 4-56 NonStop ODBC Server Compared With NonStop SQL/MP 4-57 CREATE VIEW 4-58 Examples 4-59 NonStop ODBC Server Compared With SQL Server 4-59 NonStop ODBC Server Compared With NonStop SQL/MP 4-61 DECLARE 4-61 Examples 4-62 NonStop ODBC Server Compared With SQL Server 4-62 NonStop ODBC Server Compared With NonStop SQL/MP 4-62 DELETE 4-63 Examples 4-63 NonStop ODBC Server Compared With SQL Server 4-64 NonStop ODBC Server Compared With NonStop SQL/MP 4-64 DROP DATABASE 4-65 Examples 4-65 How the NonStop ODBC Server Drops Database Objects 4-65 NonStop ODBC Server Compared With SQL Server 4-66 NonStop ODBC Server Compared With NonStop SQL/MP 4-66 DROP INDEX 4-67 Examples 4-67 Dropping Multiple Indexes 4-67 HP NonStop ODBC Server Reference Manual—429151-002 v Contents 4. Transact-SQL Language (continued) 4. Transact-SQL Language (continued) NonStop ODBC Server Compared With SQL Server 4-68 NonStop ODBC Server Compared With NonStop SQL/MP 4-68 DROP TABLE 4-69 Examples 4-69 Dropping Multiple Tables 4-69 Dropping Dependent Views and Indexes 4-69 Dropping Partitioned Tables 4-70 NonStop ODBC Server Compared With SQL Server 4-70 NonStop ODBC Server Compared With NonStop SQL/MP 4-71 DROP VIEW 4-71 Examples 4-72 Dropping Dependent Views and Indexes 4-72 NonStop ODBC Server Compared With SQL Server 4-72 NonStop ODBC Server Compared With NonStop SQL/MP 4-73 EXECUTE 4-74 Example 4-76 NonStop ODBC Server Compared With SQL Server 4-76 NonStop ODBC Server Compared With NonStop SQL/MP 4-76 INSERT 4-76 Examples 4-77 NonStop ODBC Server Compared With SQL Server 4-78 NonStop ODBC Server Compared With NonStop SQL/MP 4-78 PRINT 4-79 Examples 4-79 NonStop ODBC Server Compared With SQL Server 4-79 NonStop ODBC Server Compared With NonStop SQL/MP 4-79 ROLLBACK TRANSACTION 4-79 Example 4-80 NonStop ODBC Server Compared With SQL Server 4-81 NonStop ODBC Server Compared With NonStop SQL/MP 4-81 SAVE TRANSACTION 4-81 Examples 4-81 SELECT 4-82 Examples 4-84 ALL/DISTINCT Clause 4-85 INTO Clause 4-86 FROM Clause 4-86 WHERE Clause 4-87 HP NonStop ODBC Server Reference Manual—429151-002 vi Contents 4. Transact-SQL Language (continued) 4. Transact-SQL Language (continued) GROUP BY Clause 4-87 HAVING Clause 4-88 ORDER BY Clause 4-88 COMPUTE BY Clause 4-89 FOR BROWSE Clause 4-89 NonStop ODBC Server Compared With SQL Server 4-89 NonStop ODBC Server Compared With NonStop SQL/MP 4-90 SET 4-92 Examples 4-94 NonStop ODBC Server Compared With SQL Server 4-94 NonStop ODBC Server Compared With NonStop SQL/MP 4-94 TRUNCATE TABLE 4-95 Examples 4-95 NonStop ODBC Server Compared With SQL Server 4-95 NonStop ODBC Server Compared With NonStop SQL/MP 4-95 UPDATE 4-96 Examples 4-97 NonStop ODBC Server Compared With SQL Server 4-97 NonStop ODBC Server Compared With NonStop SQL/MP 4-98 UPDATE STATISTICS 4-98 Examples 4-98 NonStop ODBC Server Compared With SQL Server 4-99 NonStop ODBC Server Compared With NonStop SQL/MP 4-99 USE 4-99 Examples 4-99 NonStop ODBC Server Compared With SQL Server 4-100 NonStop ODBC Server Compared With NonStop SQL/MP 4-100 5.