没有合适的资源?快使用搜索试试~ 我知道了~
OCI8.1用户手册
5星 · 超过95%的资源 需积分: 10 17 下载量 111 浏览量
2012-07-14
13:21:00
上传
评论
收藏 5.64MB PDF 举报
温馨提示
试读
1054页
oci8.1用户手册 编写oci程序参考,英文的,很容易看懂。
资源详情
资源评论
资源推荐
Oracle Call Interface
Programmer’s Guide
Release 8.1.6
December 1999
Part No. A76975-01
Oracle Call Interface Programmer’s Guide, Release 8.1.6
Part No. A76975-01
Release 8.1.6
Copyright © 1999, Oracle Corporation. All rights reserved.
Primary Author: Phil Locke
Contributing Authors: Eric Belden, Jack Melnick
Contributors: Mehul Bastawala, Ruth Baylis, Allen Brumm, Sashi Chandrasekaran, Debashish
Chatterjee, Ernest Chen, Luxi Chidambaran, Sreenivas Gollapudi, R. Govindarajan, Brajesh Goyal,
Radhakrishna Hari, Josef Hasenberger, Don Herkimer, Chin-Heng Hong, Nancy Ikeda, Amit Jasuja,
Sanjay Kaluskar, Ravi Kasamsetty, Susan Kotsovolos, Vishu Krishnamurthy, Srinath Krishnaswamy,
Ramkumar Krishnan, Sanjeev Kumar, Thomas Kurian, Paul Lane, Shoaib Lari, Chon Lei, Cindy Lim,
Nancy Liu, Diana Lorentz, Shailendra Mishra, Prasenjit Mitra, Vidya Nagaraj, Tin Nguyen, Denise
Oertel, Rosanne Park, Jacqui Pons, Den Raphaely, Anindo Roy, Ali Shehade, Tim Smith, Ekrem
Soylemez, Gael Stevens, Ashwini Surpur, Ashok Swaminathan, Alan Thiessen, Peter Vasterd, Rick
Wessman, Joyo Wijaya, Sathyam Yanamandram, Allen Zhao
Graphic Designer: Valarie Moore
The Programs (which include both the software and documentation) contain proprietary information of
Oracle Corporation; they are provided under a license agreement containing restrictions on use and
disclosure and are also protected by copyright, patent, and other intellectual and industrial property
laws. Reverse engineering, disassembly, or decompilation of the Programs is prohibited.
The information contained in this document is subject to change without notice. If you find any problems
in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this
document is error free. Except as may be expressly permitted in your license agreement for these
Programs, no part of these Programs may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on
behalf of the U.S. Government, the following notice is applicable:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial
computer software" and use, duplication, and disclosure of the Programs, including documentation,
shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement.
Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer
software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR
52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500
Oracle Parkway, Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy, and other measures to ensure the safe use of such applications if the Programs are used for
such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the
Programs.
Oracle, SQL*Forms, SQL*Net, and SQL*Plus are registered trademarks of Oracle Corporation, Redwood
Shores, California. Oracle Call Interface, Oracle7, Oracle7 Server, Oracle8, Oracle Forms, PL/SQL, Pro*C,
Pro*C/C++, Pro*COBOL, Net8, and Trusted Oracle are trademarks of Oracle Corporation. All other
products or company names are used for identification purposes only, and may be trademarks of their
respective owners.
iii
Contents
Send Us Your Comments............................................................................................................... xxix
Preface........................................................................................................................................................ xxxi
Part I Basic OCI Concepts
1 Introduction, New Features, and Upgrading
Overview of OCI................................................................................................................................. 1-2
Advantages of OCI....................................................................................................................... 1-3
Building an OCI Application...................................................................................................... 1-4
Parts of the OCI............................................................................................................................. 1-5
Procedural and Non-Procedural Elements............................................................................... 1-5
Object Support .............................................................................................................................. 1-6
SQL Statements............................................................................................................................. 1-7
New Features ..................................................................................................................................... 1-12
Encapsulated Interfaces............................................................................................................. 1-13
Simplified User Authentication and Password Management ............................................. 1-13
Extensions to Improve Application Performance and Scalability....................................... 1-14
Oracle OCI Object Support........................................................................................................ 1-15
Client-side Object Cache............................................................................................................ 1-15
Associative and Navigational Interfaces................................................................................. 1-15
Runtime Environment for Objects ........................................................................................... 1-16
Type Management, Mapping and Manipulation Functions................................................ 1-17
Object Type Translator............................................................................................................... 1-17
iv
OCI Support for Oracle Advanced Queueing........................................................................ 1-18
XA Library Support.................................................................................................................... 1-18
Simplified Migration of Existing Applications....................................................................... 1-18
Compatibility, Upgrading, and Migration................................................................................... 1-19
Obsolescent OCI Routines......................................................................................................... 1-19
OCI Routines Not Supported.................................................................................................... 1-21
Compatibility............................................................................................................................... 1-22
Upgrading.................................................................................................................................... 1-23
Application Linking Issues............................................................................................................. 1-24
2 OCI Programming Basics
Overview............................................................................................................................................... 2-2
OCI Program Structure ...................................................................................................................... 2-3
OCI Data Structures ........................................................................................................................... 2-5
Handles................................................................................................................................................. 2-6
Allocating and Freeing Handles................................................................................................. 2-7
Environment Handle.................................................................................................................... 2-8
Error Handle.................................................................................................................................. 2-9
Service Context and Associated Handles.................................................................................. 2-9
Statement Handle, Bind Handle, and Define Handle........................................................... 2-10
Describe Handle.......................................................................................................................... 2-11
Complex Object Retrieval Handle............................................................................................ 2-11
Thread Handle ............................................................................................................................ 2-12
Subscription Handle................................................................................................................... 2-12
Direct Path Handles.................................................................................................................... 2-12
Process Handle............................................................................................................................ 2-13
Handle Attributes....................................................................................................................... 2-13
User Memory Allocation ........................................................................................................... 2-13
Descriptors ......................................................................................................................................... 2-14
Snapshot Descriptor ................................................................................................................... 2-15
LOB/FILE Datatype Locator..................................................................................................... 2-15
Parameter Descriptor ................................................................................................................. 2-16
ROWID Descriptor ..................................................................................................................... 2-16
Complex Object Descriptor....................................................................................................... 2-17
Advanced Queueing Descriptors............................................................................................. 2-17
v
User Memory Allocation........................................................................................................... 2-17
OCI Programming Steps ................................................................................................................. 2-18
Initialization, Connection, and Session Creation....................................................................... 2-18
Initializing an OCI Environment.............................................................................................. 2-19
Shared Data Mode...................................................................................................................... 2-20
Allocate Handles and Descriptors ........................................................................................... 2-22
Application Initialization, Connection, and Session Creation............................................. 2-23
Processing SQL Statements....................................................................................................... 2-26
Commit or Rollback......................................................................................................................... 2-26
Terminating the Application.......................................................................................................... 2-27
Error Handling .................................................................................................................................. 2-27
Return and Error Codes for Truncation and Null Data........................................................ 2-29
Functions Returning Other Values .......................................................................................... 2-30
Additional Coding Guidelines ...................................................................................................... 2-31
Parameter Types......................................................................................................................... 2-31
Nulls ............................................................................................................................................. 2-32
Indicator Variables ..................................................................................................................... 2-32
Cancelling Calls .......................................................................................................................... 2-34
Positioned Updates and Deletes............................................................................................... 2-34
Reserved Words.......................................................................................................................... 2-35
Application Linking................................................................................................................... 2-37
Non-Blocking Mode......................................................................................................................... 2-37
Setting Blocking Modes ............................................................................................................. 2-38
Cancelling a Non-blocking Call................................................................................................ 2-38
Non-blocking Example.............................................................................................................. 2-38
Using PL/SQL in an OCI Program................................................................................................. 2-39
3 Datatypes
Oracle Datatypes................................................................................................................................. 3-2
Internal Datatype Codes.............................................................................................................. 3-3
External Datatype Codes............................................................................................................. 3-4
Internal Datatypes.............................................................................................................................. 3-5
LONG, RAW, LONG RAW, VARCHAR2................................................................................ 3-5
Character Strings and Byte Arrays............................................................................................. 3-6
Universal ROWID......................................................................................................................... 3-6
剩余1053页未读,继续阅读
zgcheng
- 粉丝: 3
- 资源: 47
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论4