Oracle Pro-C is designed for developers looking to enhance their skills in Oracle's PL/SQL programming language. Gain practical experience with advanced coding techniques and best practices.
Oracle Pro-C Training Syllabus
Curriculum Designed by Experts
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
Precompiler Concepts
Key Concepts of Embedded SQL Programming
Embedded SQL Statements
Embedded SQL Syntax
Static Versus Dynamic SQL Statements
Embedded PL/SQL Blocks
Host and Indicator Variables
Oracle Datatypes
Arrays
Datatype Equivalencing
Private SQL Areas, Cursors, and Active Sets
Transactions
Errors and Warnings
Steps in Developing an Embedded SQL Application
Guidelines for Programming
Comments
Constants
Declare Section
Delimiters
File Length
Function Prototyping
Host Variable Names
Line Continuation
Line Length
MAXLITERAL Default Value
Operators
Statement Terminator
Conditional Precompilation
Symbol Definition
Example SELECT Statement
Precompile Separately
Guidelines
Compile and Link
Example Tables
Example Data
Example Program: A Simple Query
Database Concepts
Connect to the Database
Using the ALTER AUTHORIZATION Clause to Change Passwords
Connecting Using Oracle Net
Automatic Connects
Advanced Connection Options
Some Preliminaries
Concurrent Logons
Default Databases and Connections
Explicit Connections
Implicit Connections
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
Statement-Level Rollbacks
The RELEASE Option
The SET TRANSACTION Statement
Override Default Locking
Using FOR UPDATE OF
Using LOCK TABLE
Fetch Across COMMITs
Distributed Transactions Handling
Guidelines
Designing Applications
Obtaining Locks
Using PL/SQL
Datatypes and Host Variables
Oracle Datatypes
Internal Datatypes
External Datatypes
Additional External Datatypes
Host Variables
Host Variable Declaration
Host Variable Referencing
Indicator Variables
The INDICATOR Keyword
Example of INDICATOR Variable Usage
INDICATOR Variable Guidelines
Oracle Restrictions
VARCHAR Variables
VARCHAR Variable Declaration
VARCHAR Variable Referencing
Return NULLs to a VARCHAR Variable
Insert NULLs Using VARCHAR Variables
Pass VARCHAR Variables to a Function
Find the Length of the VARCHAR Array Component
Example Program: Using sqlvcp()
Lab
Cursor Variables
Declare a Cursor Variable
Allocate a Cursor Variable
Open a Cursor Variable
Closing and Freeing a Cursor Variable
Cursor Variables with the OCI (Release 7 Only)
Restrictions
Example: cv_demo.sql and sample11.pc
CONTEXT Variables
Universal ROWIDs
SQLRowidGet()
Host Structures
Host Structures and Arrays
PL/SQL Records
Nested Structures and Unions
Host Indicator Structures
Example Program: Cursor and a Host Structure
Pointer Variables
Pointer Variable Declaration
Pointer Variable Referencing
Structure Pointers
Advanced topics
Character Data
Precompiler Option CHAR_MAP
Inline Usage of the CHAR_MAP Option
Effect of the DBMS and CHAR_MAP Options
VARCHAR Variables and Pointers
Unicode Variables
Datatype Conversion
Datatype Equivalencing
Host Variable Equivalencing
User-Defined Type Equivalencing
CHARF External Datatype
The EXEC SQL VAR and TYPE Directives
Example: Datatype Equivalencing (sample4.pc):
The C Preprocessor
How the Pro*C/C++ Preprocessor Works
Preprocessor Directives
ORA_PROC Macro
Location of Header File Specification
Some Preprocessor Examples
SQL Statements Not Allowed in #include
Include the SQLCA, ORACA, and SQLDA
EXEC SQL INCLUDE and #include Summary
Defined Macros
Include Files
Precompiled Header Files
Precompiled Header File Creation
Use of the Precompiled Header Files
Examples
Effects of Options
Usage Notes
The Oracle Preprocessor
Symbol Definition
An Oracle Preprocessor Example
Evaluation of Numeric Constants
Numeric Constants in Pro*C/C++
Numeric Constant Rules and Examples
SQLLIB Extensions for OCI Release 8 Interoperability
Runtime Context in the OCI Release 8 Environment
Parameters in the OCI Release 8 Environment Handle
Interface to OCI Release 8
SQLEnvGet()
SQLSvcCtxGet()
Embedded OCI Release 8 Calls
Embedded OCI Release 7 Calls
Set Up the LDA
Remote and Multiple Connections
New Names for SQLLIB Public Functions
X/Open Application Development
Oracle-Specific Issues
Embedded SQL
Host Variables
Output versus Input Host Variables
Indicator Variables
Insert NULLs
Returned NULLs
Fetch NULLs
Test for NULLs
Truncated Values
The Basic SQL Statements
The SELECT Statement
The INSERT Statement
The UPDATE Statement
The DELETE Statement
The WHERE Clause
The DML Returning Clause
Cursors
The DECLARE CURSOR Statement
The OPEN Statement
The FETCH Statement
The CLOSE Statement
Scrollable Cursors
Using Scrollable Cursors
The CLOSE_ON_COMMIT Precompiler Option
The PREFETCH Precompiler Option
Optimizer Hints
Issuing Hints
The CURRENT OF Clause
Restrictions
The Cursor Statements
A Complete Example Using Non-Scrollable Cursor
A Complete Example Using Scrollable Cursor
Positioned Update
Embedded PL/SQL
Advantages of PL/SQL
Better Performance
Integration with Oracle
Cursor FOR Loops
Procedures and Functions
Packages
PL/SQL Tables
User-Defined Records
Embedded PL/SQL Blocks
Host Variables
Example: Using Host Variables with PL/SQL
Complex Example
VARCHAR Pseudotype
Restriction
Indicator Variables
NULLs Handling
Truncated Values
Host Arrays
ARRAYLEN Statement
Optional Keyword EXECUTE
Cursor Usage in Embedded PL/SQL
Stored PL/SQL and Java Subprograms
Creating Stored Subprograms
Calling a Stored PL/SQL or Java Subprogram
Getting Information about Stored Subprograms
External Procedures
Restrictions on External Procedures
Creating the External Procedure
SQLExtProcError()
Using Dynamic SQL
Host Arrays
Why Use Arrays?
Declaring Host Arrays
Restrictions
Maximum Size of Arrays
Using Arrays in SQL Statements
Referencing Host Arrays
Using Indicator Arrays
Oracle Restrictions
ANSI Restriction and Requirements
Selecting into Arrays
Cursor Fetches
Using sqlca.sqlerrd[2]
Number of Rows Fetched
Scrollable Cursor Fetches
Sample Program 3: Host Arrays
Sample Program: Host Arrays Using Scrollable Cursor