http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14407/toc.htm
Pro*C/C++ Programmer's Guide 10g Release 2 (10.2) Part Number B14407-01 |
Contents
Title and Copyright Information
Preface
What's New in Pro*C/C++?
- Oracle10g Release 2 (10.2) New Features in Pro*C/C++
- Oracle9i Release 2 (9.2) New Features in Pro*C/C++
- Oracle9i Release 1 (9.0.1) New Features in Pro*C/C++
- Oracle8i Release 8.1.5 New Features in Pro*C/C++
- Oracle8i Release 8.1.4 New Features in Pro*C/C++
- Oracle8i Release 8.1.3 New Features 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
- Key Concepts of Embedded SQL Programming
- Steps in Developing an Embedded SQL Application
- Guidelines for Programming
- Conditional Precompilation
- Precompile Separately
- Compile and Link
- Example Tables
- Example Program: A Simple Query
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
- Oracle Datatypes
- Host Variables
- Indicator Variables
- VARCHAR Variables
- Cursor Variables
- CONTEXT Variables
- Universal ROWIDs
- Host Structures
- Pointer Variables
- Globalization Support
- NCHAR 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
- Host Variables
- Indicator Variables
- The Basic SQL Statements
- The DML Returning Clause
- Cursors
- Scrollable Cursors
- Optimizer Hints
- The CURRENT OF Clause
- The Cursor Statements
- A Complete Example Using Non-Scrollable Cursor
- A Complete Example Using Scrollable Cursor
- Positioned Update
7 Embedded PL/SQL
- Advantages of PL/SQL
- Embedded PL/SQL Blocks
- Host Variables
- Indicator Variables
- Host Arrays
- Cursor Usage in Embedded PL/SQL
- Stored PL/SQL and Java Subprograms
- External Procedures
- Using Dynamic 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
- What are Threads?
- Runtime Contexts in Pro*C/C++
- Runtime Context Usage Models
- User Interface Features for Multithreaded Applications
- Multithreaded Example
- Connection Pooling
Part II Applications
12 C++ Applications
13 Oracle Dynamic SQL
- What is Dynamic SQL?
- Advantages and Disadvantages of Dynamic SQL
- When to Use Dynamic SQL
- Requirements for Dynamic SQL Statements
- How Dynamic SQL Statements are Processed
- Methods for Using Dynamic SQL
- Using Method 1
- Using Method 2
- Using Method 3
- Using Method 4
- Using the DECLARE STATEMENT Statement
- Using PL/SQL
14 ANSI Dynamic SQL
- Basics of ANSI Dynamic SQL
- Overview of ANSI SQL Statements
- Oracle Extensions
- ANSI Dynamic SQL Precompiler Options
- Full Syntax of the Dynamic SQL Statements
- Example Programs
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
- What are LOBs?
- How to Use LOBs in Your Program
- Rules for LOB Statements
- LOB Statements
- LOBs and the Navigational Interface
- LOB Program Examples
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
- Collections
- Descriptors for Collections
- OBJECT GET and SET
- Collection Statements
- Collection Example Code
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
- What Causes Poor Performance?
- How Can Performance Be Improved?
- Using Host Arrays
- Using Embedded PL/SQL
- Optimizing SQL Statements
- Using Indexes
- Taking Advantage of Row-Level Locking
- Eliminating Unnecessary Parsing
- Avoiding Unnecessary Reparsing
- Using Connection Pooling
D Syntactic and Semantic Checking
- What Is Syntactic and Semantic Checking?
- Controlling the Type and Extent of Checking
- Specifying SQLCHECK=SEMANTICS
- Specifying SQLCHECK=SYNTAX
- Entering the SQLCHECK Option
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
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
'Oracle' 카테고리의 다른 글
dba view study 1 (0) | 2011.07.16 |
---|---|
원본 10046 트레이스 파일에 담긴 정보의 요약 (0) | 2011.07.15 |
Performing a Complete Database Restore (Full Recovery Model) (0) | 2011.06.13 |
오라클 테이블 및 칼럼 내역 보기 (0) | 2011.06.13 |
PQ 수 확인 (0) | 2011.06.06 |