Oracle Call Interface Programmer’S Guide, Volumes 1 and 2, Release 8.1.5 Part No
Total Page:16
File Type:pdf, Size:1020Kb
Oracle Call Interface Programmer’s Guide, Volumes 1 and 2 Release 8.1.5 February 1999 Part No. A67846-01 Oracle Call Interface Programmer’s Guide, Volumes 1 and 2, Release 8.1.5 Part No. A67846-01 Release 8.1.5 Copyright © 1999, Oracle Corporation. All rights reserved. Primary Author: Phil Locke Contributing Author: Eric Belden Contributors: Ruth Baylis, Allen Brumm, Sashi Chandrasekaran, Debashish Chatterjee, Ernest Chen, Luxi Chidambaran, Sreenivas Gollapudi, 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, Valarie Moore, Tin Nguyen, Denise Oertel, Rosanne Park, Jacqui Pons, Den Raphaely, Anindo Roy, Tim Smith, Ekrem Soylemez, Ashwini Surpur, Alan Thiessen, Peter Vasterd, Joyo Wijaya, Sathyam Yanamandram, Allen Zhao The programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be licensee's responsibility to take all appropriate fail-safe, back up, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle disclaims liability for any damages caused by such use of the Programs. This Program contains proprietary information of Oracle Corporation; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright, patent and other intellectual property law. Reverse engineering of the software 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. No part of this document 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 this Program is delivered to a U.S. Government Agency of the Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable: Restricted Rights Legend Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication and disclosure of the Programs 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-14, Rights in Data -- General, including Alternate III (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. 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. Contents Send Us Your Comments .............................................................................................................. xxvii Preface........................................................................................................................................................ xxix 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 iii OCI Support for Oracle Advanced Queueing ........................................................................ 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-25 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-11 Subscription Handle................................................................................................................... 2-11 Direct Path Handles.................................................................................................................... 2-12 Process Handle............................................................................................................................ 2-12 Handle Attributes ....................................................................................................................... 2-12 User Memory Allocation ........................................................................................................... 2-13 Descriptors and Locators ................................................................................................................