Pro*C/C++ Programmer’s Guide Pro C C+ Programmer 10g Release 2
User Manual: Pdf
Open the PDF directly: View PDF
Page Count: 746 [warning: Documents this large are best viewed by clicking the View PDF Link!]
- Contents
- List of Figures
- List of Tables
- Preface
- What's New in Pro*C/C++?
- Part I Introduction and Concepts
- 1 Introduction
- What is an Oracle Precompiler?
- Why Use the Oracle Pro*C/C++ Precompiler
- Why Use SQL
- Why Use PL/SQL
- Pro*C/C++ Precompiler Benefits
- Frequently Asked Questions
- What is a VARCHAR?
- Does Pro*C/C++ Generate Calls to the Oracle Call Interface?
- Why Not Code Using SQLLIB Calls and Not Use Pro*C/C++?
- Can I Call A PL/SQL Stored Procedure From a Pro*C/C++ Program?
- Can I Write C++ Code, and Precompile It Using Pro*C/C++?
- Can I Use Bind Variables Anywhere in a SQL Statement?
- I Am Confused By Character Handling in Pro*C/C++.
- Is There Anything Special About Character Pointers?
- Why Does SPOOL Not Work in Pro*C/C++?
- Where Can I Find The On-line Versions of the Example Programs?
- How Can I Compile and Link My Application?
- Does Pro*C/C++ Now Support Using Structures As Host Variables?
- Is It Possible to Have Recursive Functions In Pro*C/C++ If I Use Embedded SQL In the Function?
- Can I Use Any Release of Pro*C/C++ with Any Version of the Oracle Server?
- When My Application Runs Under Oracle9i, I Keep Getting an Ora-1405 Error (Fetched Column Value Is NULL).
- Are All SQLLIB Functions Private?
- How Does Oracle9i Support The New Object Types?
- Compatibility, Upgrading and Migration
- 2 Precompiler Concepts
- 3 Database Concepts
- Connect to the Database
- Advanced Connection Options
- Definitions of Transactions Terms
- How Transactions Guard Your Database
- How to Begin and End Transactions
- Using the COMMIT Statement
- Using the SAVEPOINT Statement
- The ROLLBACK Statement
- The RELEASE Option
- The SET TRANSACTION Statement
- Override Default Locking
- Fetch Across COMMITs
- Distributed Transactions Handling
- Guidelines
- 4 Datatypes and Host Variables
- 5 Advanced Topics
- Character Data
- Datatype Conversion
- Datatype Equivalencing
- The C Preprocessor
- Precompiled Header Files
- The Oracle Preprocessor
- Evaluation of Numeric Constants
- SQLLIB Extensions for OCI Release 8 Interoperability
- Interface to OCI Release 8
- Embedded OCI Release 7 Calls
- New Names for SQLLIB Public Functions
- X/Open Application Development
- 6 Embedded SQL
- 7 Embedded PL/SQL
- 8 Host Arrays
- Why Use Arrays?
- Declaring Host Arrays
- Using Arrays in SQL Statements
- Selecting into Arrays
- Inserting with Arrays
- Updating with Arrays
- Deleting with Arrays
- Using the FOR Clause
- Using the WHERE Clause
- Arrays of Structs
- Arrays of Structs Usage
- Restrictions on Arrays of Structs
- Declaring an Array of Structs
- Variables Guidelines
- Declaring a Pointer to an Array of Structs
- Examples
- Example 1: A Simple Array of Structs of Scalars
- Example 2: Using Mixed Scalar Arrays with An Array of Structs
- Example 3: Using Multiple Arrays of Structs with a Cursor
- Example 4: Individual Array and Struct Member Referencing
- Example 5: Using Indicator Variables, a Special Case
- Example 6: Using a Pointer to an Array of Structs
- Mimicking CURRENT OF
- 9 Handling Runtime Errors
- The Need for Error Handling
- Error Handling Alternatives
- The SQLSTATE Status Variable
- Declaring SQLCODE
- Key Components of Error Reporting Using the SQLCA
- Using the SQL Communications Area (SQLCA)
- Getting the Full Text of Error Messages
- Using the WHENEVER Directive
- Obtaining the Text of SQL Statements
- Using the Oracle Communications Area (ORACA)
- 10 Precompiler Options
- The Precompiler Command
- Precompiler Options
- Quick Reference
- Entering Options
- Using the Precompiler Options
- AUTO_CONNECT
- CHAR_MAP
- CINCR
- CLOSE_ON_COMMIT
- CMAX
- CMIN
- CNOWAIT
- CODE
- COMP_CHARSET
- CONFIG
- CPOOL
- CPP_SUFFIX
- CTIMEOUT
- DBMS
- DEF_SQLCODE
- DEFINE
- DURATION
- DYNAMIC
- ERRORS
- ERRTYPE
- EVENTS
- FIPS
- HEADER
- HOLD_CURSOR
- INAME
- INCLUDE
- INTYPE
- LINES
- LNAME
- LTYPE
- MAXLITERAL
- MAXOPENCURSORS
- MODE
- NATIVE_TYPES
- NLS_CHAR
- NLS_LOCAL
- OBJECTS
- ONAME
- ORACA
- PAGELEN
- PARSE
- PREFETCH
- RELEASE_CURSOR
- SELECT_ERROR
- SQLCHECK
- SYS_INCLUDE
- THREADS
- TYPE_CODE
- UNSAFE_NULL
- USERID
- UTF16_CHARSET
- VARCHAR
- VERSION
- 11 Multithreaded Applications
- 1 Introduction
- Part II Applications
- 12 C++ Applications
- 13 Oracle Dynamic SQL
- 14 ANSI Dynamic SQL
- 15 Oracle Dynamic SQL: Method 4
- Meeting the Special Requirements of Method 4
- Understanding the SQLDA
- Using the SQLDA Variables
- Some Preliminaries
- The Basic Steps
- A Closer Look at Each Step
- Declare a Host String
- Declare the SQLDAs
- Allocate Storage Space for the Descriptors
- Set the Maximum Number to DESCRIBE
- Put the Query Text in the Host String
- PREPARE the Query from the Host String
- DECLARE a Cursor
- DESCRIBE the Bind Variables
- Reset Number of Placeholders
- Get Values and Allocate Storage for Bind Variables
- OPEN the Cursor
- DESCRIBE the Select List
- Reset Number of Select-List Items
- Reset Length/Datatype of Each Select-list Item
- FETCH Rows from the Active Set
- Get and Process Select-List Values
- Deallocate Storage
- CLOSE the Cursor
- Using Host Arrays
- sample12.pc
- Example Program: Dynamic SQL Method 4
- Sample Program : Dynamic SQL Method 4 using Scrollable Cursors
- 16 LOBs
- 17 Objects
- Introduction to Objects
- Using Object Types in Pro*C/C++
- The Object Cache
- Associative Interface
- Navigational Interface
- Converting Object Attributes and C Types
- Object Options Set/Get
- New Precompiler Options for Objects
- An Object Example in Pro*C/C++
- Example Code for Type Inheritance
- Example Code for Navigational Access
- Using C Structures
- Using REFs
- Using OCIDate, OCIString, OCINumber, and OCIRaw
- Summarizing the New Database Types in Pro*C/C++
- Restrictions on Using Oracle Datatypes in Dynamic SQL
- 18 Collections
- 19 The Object Type Translator
- OTT Overview
- What is the Object Type Translator
- Using OTT with OCI Applications
- Using OTT with Pro*C/C++ Applications
- OTT Reference
- 20 User Exits
- What Is a User Exit?
- Why Write a User Exit?
- Developing a User Exit
- Writing a User Exit
- EXEC TOOLS Statements
- Calling a User Exit
- Passing Parameters to a User Exit
- Returning Values to a Form
- An Example
- Precompiling and Compiling a User Exit
- Example Program: A User Exit
- Using the GENXTB Utility
- Linking a User Exit into SQL*Forms
- Guidelines
- Part III Appendixes
- A New Features
- B Reserved Words, Keywords, and Namespaces
- C Performance Tuning
- D Syntactic and Semantic Checking
- E System-Specific References
- System-Specific Information
- Location of Standard Header Files
- Specifying Location of Included Files for the C Compiler
- ANSI C Support
- Struct Component Alignment
- Size of an Integer and ROWID
- Byte Ordering
- Connecting to the Oracle Server
- Linking in an XA Library
- Location of the Pro*C/C++ Executable
- System Configuration File
- INCLUDE Option Syntax
- Compiling and Linking
- User Exits
- System-Specific Information
- F Embedded SQL Statements and Directives
- Summary of Precompiler Directives and Embedded SQL Statements
- About The Statement Descriptions
- How to Read Syntax Diagrams
- ALLOCATE (Executable Embedded SQL Extension)
- ALLOCATE DESCRIPTOR (Executable Embedded SQL)
- CACHE FREE ALL (Executable Embedded SQL Extension)
- CALL (Executable Embedded SQL)
- CLOSE (Executable Embedded SQL)
- COLLECTION APPEND (Executable Embedded SQL Extension)
- COLLECTION DESCRIBE (Executable Embedded SQL Extension)
- COLLECTION GET (Executable Embedded SQL Extension)
- COLLECTION RESET (Executable Embedded SQL Extension)
- COLLECTION SET (Executable Embedded SQL Extension)
- COLLECTION TRIM (Executable Embedded SQL Extension)
- COMMIT (Executable Embedded SQL)
- CONNECT (Executable Embedded SQL Extension)
- CONTEXT ALLOCATE (Executable Embedded SQL Extension)
- CONTEXT FREE (Executable Embedded SQL Extension)
- CONTEXT OBJECT OPTION GET (Executable Embedded SQL Extension)
- CONTEXT OBJECT OPTION SET (Executable Embedded SQL Ext)
- CONTEXT USE (Oracle Embedded SQL Directive)
- DEALLOCATE DESCRIPTOR (Embedded SQL Statement)
- DECLARE CURSOR (Embedded SQL Directive)
- DECLARE DATABASE (Oracle Embedded SQL Directive)
- DECLARE STATEMENT (Embedded SQL Directive)
- DECLARE TABLE (Oracle Embedded SQL Directive)
- DECLARE TYPE (Oracle Embedded SQL Directive)
- DELETE (Executable Embedded SQL)
- DESCRIBE (Executable Embedded SQL Extension)
- DESCRIBE DESCRIPTOR (Executable Embedded SQL)
- ENABLE THREADS (Executable Embedded SQL Extension)
- EXECUTE ... END-EXEC (Executable Embedded SQL Extension)
- EXECUTE (Executable Embedded SQL)
- EXECUTE DESCRIPTOR (Executable Embedded SQL)
- EXECUTE IMMEDIATE (Executable Embedded SQL)
- FETCH (Executable Embedded SQL)
- FETCH DESCRIPTOR (Executable Embedded SQL)
- FREE (Executable Embedded SQL Extension)
- GET DESCRIPTOR (Executable Embedded SQL)
- INSERT (Executable Embedded SQL)
- LOB APPEND (Executable Embedded SQL Extension)
- LOB ASSIGN (Executable Embedded SQL Extension)
- LOB CLOSE (Executable Embedded SQL Extension)
- LOB COPY (Executable Embedded SQL Extension)
- LOB CREATE TEMPORARY (Executable Embedded SQL Extension)
- LOB DESCRIBE (Executable Embedded SQL Extension)
- LOB DISABLE BUFFERING (Executable Embedded SQL Extension)
- LOB ENABLE BUFFERING (Executable Embedded SQL Extension)
- LOB ERASE (Executable Embedded SQL Extension)
- LOB FILE CLOSE ALL (Executable Embedded SQL Extension)
- LOB FILE SET (Executable Embedded SQL Extension)
- LOB FLUSH BUFFER (Executable Embedded SQL Extension)
- LOB FREE TEMPORARY (Executable Embedded SQL Extension)
- LOB LOAD (Executable Embedded SQL Extension)
- LOB OPEN (Executable Embedded SQL Extension)
- LOB READ (Executable Embedded SQL Extension)
- LOB TRIM (Executable Embedded SQL Extension)
- LOB WRITE (Executable Embedded SQL Extension)
- OBJECT CREATE (Executable Embedded SQL Extension)
- OBJECT DELETE (Executable Embedded SQL Extension)
- OBJECT DEREF (Executable Embedded SQL Extension)
- OBJECT FLUSH (Executable Embedded SQL Extension)
- OBJECT GET (Executable Embedded SQL Extension)
- OBJECT RELEASE (Executable Embedded SQL Extension)
- OBJECT SET (Executable Embedded SQL Extension)
- OBJECT UPDATE (Executable Embedded SQL Extension)
- OPEN (Executable Embedded SQL)
- OPEN DESCRIPTOR (Executable Embedded SQL)
- PREPARE (Executable Embedded SQL)
- REGISTER CONNECT (Executable Embedded SQL Extension)
- ROLLBACK (Executable Embedded SQL)
- SAVEPOINT (Executable Embedded SQL)
- SELECT (Executable Embedded SQL)
- SET DESCRIPTOR (Executable Embedded SQL)
- TYPE (Oracle Embedded SQL Directive)
- UPDATE (Executable Embedded SQL)
- VAR (Oracle Embedded SQL Directive)
- WHENEVER (Embedded SQL Directive)
- Index