没有合适的资源?快使用搜索试试~ 我知道了~
Oracle Call Interface Programmer's Guide, 10g Release 2 (10.2).p...
需积分: 0 11 下载量 63 浏览量
2009-04-08
10:33:34
上传
评论
收藏 18.58MB PDF 举报
温馨提示
试读
1258页
Oracle Call Interface Programmer's Guide, 10g Release 2 (10.2)
资源详情
资源评论
资源推荐
Oracle® Call Interface
Programmer's Guide,
10g Release 2 (10.2)
B14250-02
November 2005
Oracle Call Interface Programmer's Guide, 10g Release 2 (10.2)
B14250-02
Copyright © 1996, 2005, Oracle. All rights reserved.
Primary Author: Jack Melnick
Contributors: A. Ahluwalia, G. Arora, A. Beguelin, A. Bande, D. Banerjee, S. Banerjee, M. Bastawala, E.
Belden, N. Bhatt, James Feng Cao, Yujie Cao, S. Chandrasekar, Thomas H. Chang, D. Chatterjee, D. Chiba, L.
Chidambaran, Chi Ching Chui, D. Frumkin, S. Gollapudi, Wenyun. He, Min-Hank Ho, N. Ikeda, Toliver Jue,
R. Kasamsetty, S. Kotsovolos, S. Krishnaswamy, S. Lari, Geoff Lee, N. Lewis, Chao Liang, E. Miner, S.
Mishra,, K. Mohan, Valarie Moore, J. Narasinghanallur, E. Paapanen, R. Phillips, R. Pingte, T. Pulkita, V.
Raja, D. Saha, S. Seshadri, B. Sinha, H. Slattery, Steven Sun, K. Surlaker, B. Thome, P. Tyagi, S. S. Vemuri, R.
Vissapragada, Wei Wang, Daniel M. Wong, Mingkang Xu, Jianping Yang, Michael Yau
The Programs (which include both the software and documentation) contain proprietary information; 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, except to the extent required to obtain interoperability with other
independently created software or as specified by law, 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. This document is not warranted to be 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.
If the Programs are delivered to the United States Government or anyone licensing or using the Programs on
behalf of the United States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data
delivered to U.S. Government customers are "commercial computer software" or "commercial technical data"
pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As
such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation
and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license
agreement, and, to the extent applicable, the additional rights set forth 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 we disclaim liability for any damages caused by such use of the Programs.
Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
The Programs may provide links to Web sites and access to content, products, and services from third
parties. Oracle is not responsible for the availability of, or any content provided on, third-party Web sites.
You bear all risks associated with the use of such content. If you choose to purchase any products or services
from a third party, the relationship is directly between you and the third party. Oracle is not responsible for:
(a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the
third party, including delivery of products or services and warranty obligations related to purchased
products or services. Oracle is not responsible for any loss or damage of any sort that you may incur from
dealing with any third party.
iii
Contents
Preface ........................................................................................................................................................... xxxv
Audience................................................................................................................................................. xxxv
Documentation Accessibility............................................................................................................... xxxv
Related Documents ............................................................................................................................... xxxvi
Conventions .......................................................................................................................................... xxxvii
What's New in Oracle Call Interface? ......................................................................................... xxxix
New Features in Oracle Call Interface Release 10.2 ......................................................................... xxxix
New Features in Oracle Call Interface Release 10.1 .............................................................................. xli
1 Introduction and Upgrading
Overview of OCI ...................................................................................................................................... 1-1
Advantages of OCI............................................................................................................................. 1-2
Building an OCI Application............................................................................................................ 1-2
Parts of OCI......................................................................................................................................... 1-2
Procedural and Non-Procedural Elements .................................................................................... 1-3
Object Support.................................................................................................................................... 1-3
SQL Statements................................................................................................................................... 1-4
Data Definition Language.......................................................................................................... 1-5
Control Statements ..................................................................................................................... 1-5
Data Manipulation Language ................................................................................................... 1-5
Queries.......................................................................................................................................... 1-6
PL/SQL ........................................................................................................................................ 1-6
Embedded SQL ........................................................................................................................... 1-7
Special OCI/SQL Terms ............................................................................................................ 1-7
Encapsulated Interfaces..................................................................................................................... 1-8
Simplified User Authentication and Password Management..................................................... 1-8
Extensions to Improve Application Performance and Scalability .............................................. 1-8
OCI Object Support ........................................................................................................................... 1-9
Client-Side Object Cache................................................................................................................... 1-9
Associative and Navigational Interfaces ..................................................................................... 1-10
OCI Runtime Environment for Objects........................................................................................ 1-10
Type Management, Mapping and Manipulation Functions..................................................... 1-10
Object Type Translator................................................................................................................... 1-11
OCI Support for Oracle Streams Advanced Queuing ............................................................... 1-11
iv
XA Library Support ........................................................................................................................ 1-11
Compatibility and Upgrading ............................................................................................................ 1-12
Simplified Upgrading of Existing OCI Release 7 Applications................................................ 1-12
Statically-Linked and Dynamically-Linked Applications......................................................... 1-12
Obsolete OCI Routines................................................................................................................... 1-13
OCI Routines Not Supported........................................................................................................ 1-14
Compatibility Between Different Releases of OCI and Servers ............................................... 1-15
Upgrading OCI................................................................................................................................ 1-15
Adding Post-release 7.x OCI Calls to 7.x Applications ...................................................... 1-15
OCI Instant Client................................................................................................................................. 1-16
Benefits of Instant Client................................................................................................................ 1-16
OCI Instant Client Installation Process........................................................................................ 1-17
When to Use Instant Client............................................................................................................ 1-18
Patching Instant Client Shared Libraries on Linux or UNIX.................................................... 1-18
Regeneration of Data Shared Library and Zip Files .................................................................. 1-19
Database Connection Strings for OCI Instant Client ................................................................. 1-19
Examples of Instant Client Connect Identifiers................................................................... 1-20
Environment Variables for OCI Instant Client ........................................................................... 1-21
Instant Client Light (English) ........................................................................................................ 1-22
Globalization Settings.............................................................................................................. 1-22
Operation of Instant Client Light .......................................................................................... 1-23
Installation of Instant Client Light ........................................................................................ 1-23
SDK for Instant Client .................................................................................................................... 1-24
2 OCI Programming Basics
Overview of OCI Programming ............................................................................................................ 2-1
Header Files............................................................................................................................................... 2-2
OCI Program Structure............................................................................................................................ 2-2
OCI Data Structures................................................................................................................................. 2-3
Handles....................................................................................................................................................... 2-4
Allocating and Freeing Handles ...................................................................................................... 2-5
Environment Handle......................................................................................................................... 2-5
Error Handle....................................................................................................................................... 2-6
Service Context and Associated Handles....................................................................................... 2-6
Statement, Bind, and Define Handles ............................................................................................. 2-7
Describe Handle................................................................................................................................. 2-7
Complex Object Retrieval Handle................................................................................................... 2-8
Thread Handle.................................................................................................................................... 2-8
Subscription Handle .......................................................................................................................... 2-8
Direct Path Handles........................................................................................................................... 2-8
Connection Pool Handle ................................................................................................................... 2-8
Handle Attributes .............................................................................................................................. 2-8
OCI Descriptors........................................................................................................................................ 2-9
Snapshot Descriptor........................................................................................................................ 2-10
LOB and BFILE Locators................................................................................................................ 2-11
Parameter Descriptor...................................................................................................................... 2-12
ROWID Descriptor.......................................................................................................................... 2-12
v
Date, Datetime, and Interval Descriptors.................................................................................... 2-12
Complex Object Descriptor............................................................................................................ 2-12
Advanced Queuing Descriptors ................................................................................................... 2-12
User Memory Allocation................................................................................................................ 2-13
OCI Programming Steps ...................................................................................................................... 2-13
OCI Environment Initialization ......................................................................................................... 2-14
Creating the OCI Environment..................................................................................................... 2-14
Allocating Handles and Descriptors ............................................................................................ 2-14
Application Initialization, Connection, and Session Creation.................................................. 2-15
Single User, Single Connection.............................................................................................. 2-15
Client Access Through a Proxy.............................................................................................. 2-15
Non-Proxy Multiple Sessions or Connections..................................................................... 2-17
Example of Creating and Initializing an OCI Environment.............................................. 2-18
Processing SQL Statements in OCI............................................................................................... 2-19
Commit or Rollback.............................................................................................................................. 2-19
Terminating the Application............................................................................................................... 2-19
Error Handling in OCI ......................................................................................................................... 2-20
Return and Error Codes for Data.................................................................................................. 2-21
Functions Returning Other Values............................................................................................... 2-22
Additional Coding Guidelines........................................................................................................... 2-22
Parameter Types.............................................................................................................................. 2-22
Address Parameters................................................................................................................. 2-22
Integer Parameters................................................................................................................... 2-22
Character String Parameters................................................................................................... 2-22
Inserting Nulls into a Column....................................................................................................... 2-22
Indicator Variables.......................................................................................................................... 2-23
Input........................................................................................................................................... 2-23
Output ....................................................................................................................................... 2-23
Indicator Variables for Named Data Types and REFs........................................................ 2-24
Canceling Calls................................................................................................................................ 2-24
Positioned Updates and Deletes ................................................................................................... 2-25
Reserved Words .............................................................................................................................. 2-25
Oracle Reserved Namespaces ................................................................................................ 2-26
Nonblocking Mode in OCI ............................................................................................................ 2-26
Setting Blocking Modes.................................................................................................................. 2-27
Cancelling a Nonblocking Call ..................................................................................................... 2-27
Using PL/SQL in an OCI Program ..................................................................................................... 2-27
OCI Globalization Support................................................................................................................. 2-28
Client Character Set Control from OCI........................................................................................ 2-28
Code Example for Character Set Control in OCI........................................................................ 2-29
Character Control and OCI Interfaces ......................................................................................... 2-29
Character Length Semantics in OCI............................................................................................. 2-30
Character Set Support in OCI........................................................................................................ 2-30
Other OCI Globalization Support Functions .............................................................................. 2-30
Getting Locale Information in OCI............................................................................................... 2-30
Example of Getting Locale Information in OCI.......................................................................... 2-31
Manipulating Strings in OCI ......................................................................................................... 2-31
剩余1257页未读,继续阅读
LemIST
- 粉丝: 37
- 资源: 42
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0