DataDirect
®
Reference
Connect ODBC
™
December 2000
© 2000 MERANT. All rights reserved. Printed in the U.S.A.
DataDirect, INTERSOLV, MicroFocus, Middleware, Net Express, PVCS,
SequeLink, and TechGnosis are registered trademarks, and Client/Server
MiddleWare, DataDirect Connect ADO, DataDirect Connect Integrator,
DataDirect Connect JDBC, DataDirect Connect ODBC, DataDirect Connect
OLE DB, DataDirect Connect Premium, DataDirect Reflector, DataDirect
SequeLink Integrator, MERANT, PVCS Dimensions, MERANT, PVCS Metrics,
PVCS Replicator, PVCS TeamLink, PVCS Tracker, PVCS TrackerLink, PVCS
Version Manager, PVCS VM Server, and WebDBLink are trademarks of
MERANT. All other trademarks are the property of their respective owners.
ACKNOWLEDGEMENT. PVCS
®
Dimensions
™
is implemented using the
ORACLE
®
Relational database management system. ORACLE is a registered
trademark of Oracle Corporation, Redwood City, California.
No part of this publication, with the exception of the software product user
documentation contained on a CD-ROM, may be copied, photocopied,
reproduced, transmitted, transcribed, or reduced to any electronic medium
or machine-readable form without prior written consent of MERANT.
Licensees may duplicate the software product user documentation
contained on a CD-ROM, but only to the extent necessary to support the
users authorized access to the software under the license agreement. Any
reproduction of the documentation, regardless of whether the
documentation is reproduced in whole or in part, must be accompanied by
this copyright statement in its entirety, without modification.
U.S. GOVERNMENT RESTRICTED RIGHTS. It is acknowledged that the
Software and the Documentation were developed at private expense, that
no part is in the public domain, and that the Software and Documentation
are Commercial Computer Software provided with RESTRICTED RIGHTS
under Federal Acquisition Regulations and agency supplements to them.
Use, duplication or disclosure by the U.S. Government is subject to
restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical
Data and Computer Software clause at DFAR 252.227-7013 et. seq. or
subparagraphs (c)(1) and (2) of the Commercial Computer Software
Restricted Rights at FAR 52.227-19, as applicable. Contractor is MERANT,
9420 Key West Avenue, Rockville, Maryland 20850. Rights are reserved under
copyright laws of the United States with respect to unpublished portions of
the Software.
MERANT
9420 Key West Avenue
Rockville, Maryland 20850
Connect ODBC Reference
3
Table of Contents
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
What Is DataDirect Connect ODBC? . . . . . . . . . . . . . . . . . . . . . 21
Using this Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Conventions Used in This Book. . . . . . . . . . . . . . . . . . . . . . . . . 24
Typographical Conventions. . . . . . . . . . . . . . . . . . . . . . . . . 24
Environment-Specific Information . . . . . . . . . . . . . . . . . . . 25
Other Connect ODBC Documentation . . . . . . . . . . . . . . . . . . . 26
Ordering Printed Books. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Contacting Technical Support. . . . . . . . . . . . . . . . . . . . . . . . . . 29
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
About DataDirect Connect ODBC Drivers . . . . . . . . . . . . . . . . 31
Support for Multiple Environments . . . . . . . . . . . . . . . . . . 32
Installing the ODBC Drivers. . . . . . . . . . . . . . . . . . . . . . . . . 32
Environment-Specific Information . . . . . . . . . . . . . . . . . . . . . . 33
For Windows Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
For UNIX Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Error Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
UNIX Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2 Connect ODBC for Btrieve (Pervasive.SQL) . . . . . . . 43
Driver Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Managing Databases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Connect ODBC Reference
4 Table of Contents
Configuring Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Defining Table Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Connecting to a Data Source Using a Connection String . . . 54
Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Column Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Select Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Rowid Pseudo-Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Alter Table Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Create and Drop Index Statements . . . . . . . . . . . . . . . . . . . . . 62
Create Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Drop Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Isolation and Lock Levels Supported. . . . . . . . . . . . . . . . . . . . 63
ODBC Conformance Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Number of Connections and Statements Supported . . . . . . . 64
3 Connect ODBC for DB2 . . . . . . . . . . . . . . . . . . . . . . . 65
Driver Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Configuring Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Connecting to a Data Source Using a Logon Dialog Box. . . . 77
Connecting to a Data Source Using a Connection String . . . 79
Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Unicode Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Default Unicode Mapping . . . . . . . . . . . . . . . . . . . . . . . . . 87
Connection Attributes for Unicode. . . . . . . . . . . . . . . . . . 88
Persisting a Result Set as an XML Data File . . . . . . . . . . . . . . 89
Stored Procedure Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Isolation and Lock Levels Supported. . . . . . . . . . . . . . . . . . . . 91
Connect ODBC Reference
Table of Contents 5
ODBC Conformance Level. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Number of Connections and Statements Supported. . . . . . . . 92
4 Connect ODBC for dBASE . . . . . . . . . . . . . . . . . . . . . 93
Driver Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Configuring Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
dBASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
FoxPro 3.0 DBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Defining Index Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Defining Index Attributes on UNIX . . . . . . . . . . . . . . . . . . . . . 108
Connecting to a Data Source Using a Connection String . . . . 109
Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Column Names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Select Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Rowid Pseudo-Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Alter Table Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Create and Drop Index Statements . . . . . . . . . . . . . . . . . . . . . 119
Create Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Drop Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Pack Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
SQL Statements for FoxPro 3.0 Database Containers . . . . . . . 123
Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Levels of Database Locking. . . . . . . . . . . . . . . . . . . . . . . . . 124
Using Locks on Local Files . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Limit on Number of Locks . . . . . . . . . . . . . . . . . . . . . . . . . . 125
How Transactions Affect Record Locks. . . . . . . . . . . . . . . . 125
Isolation and Lock Levels Supported . . . . . . . . . . . . . . . . . . . . 126
ODBC Conformance Level. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Number of Connections and Statements Supported. . . . . . . . 126
- 1
- 2
- 3
前往页