Skip Headers
Pro*PL/1® Supplement to the Oracle Precompilers Guide
Release 1.8
Part Number B14353-01
Home
Book List
Index
Master Index
Feedback
Next
View PDF
Contents
List of Figures
List of Tables
Title and Copyright Information
Preface
Intended Audience
Documentation Accessibility
Structure
Related Documents
Conventions
ANSI Compliance
1
Writing a Pro*PL/1 Program
Programming Guidelines
Comments
Continuation Lines
Embedded SQL Syntax
Host Variable Names
MAXLITERAL Default Value
Nulls
Operators, Logical
Operators, Relational
PL/1 Versions
Preprocessor
Quotation Marks and Apostrophes
Scope of Variables
SQL Statement Terminator
Statement Labels
Required Declarations and SQL Statements
The Declare Section
Using the INCLUDE Statement
Event and Error Handling
Host Variables
Declaring Host Variables
Structures
An Example
Special Requirements
Referencing Host Variables
Restrictions
Indicator Variables
Declaring Indicator Variables
Referencing Indicator Variables
Host Arrays
Declaring Host Arrays
Referencing Host Arrays
Pointers as Host Variables
CHARACTER VARYING
VARYINGReturning Nulls to a CHARACTER (N)
Handling Character Data
Effects of the MODE Option
The Oracle Datatypes
Internal Datatypes
SQL Pseudocolumns and Functions
External Datatypes
Datatype Conversion
Datatype Equivalencing
Host Variable Equivalencing
Embedding PL/SQL
Using Host Variables with PL/SQL
Using Indicator Variables with PL/SQL
Handling Nulls
Handling Truncated Values
SQLCHECK
Connecting to Oracle
Automatic Logins
Concurrent Logins
2
Error Handling and Diagnostics
SQLSTATE, the SQLCA, and SQLCODE
Declaring SQLSTATE
SQLSTATE Values
Using SQLSTATE
Declaring SQLCODE
Using the SQLCA
Declaring the SQLCA
What's in the SQLCA?
Key Components of Error Reporting
Status Codes
Warning Flags
Rows-processed Count
Parse Error Offset
Error Message Text
Getting the Full Text of Error Messages
Using the WHENEVER Statement
Scope of WHENEVER
Helpful Hint
Caution
Using the ORACA
Declaring the ORACA
Enabling the ORACA
What's in the ORACA?
3
Running the Pro*PL/1 Precompiler
Precompiler Command
Precompiler Options
Default Values
Determining Current Values
Case Sensitivity
Configuration Files
Scope of Options
DBMS
MODE
Entering Options
Special PL/1 Options
Doing Conditional Precompilations
Doing Separate Precompilations
Restrictions
Compiling and Linking
4
Sample Programs
Sample Programs
Sample Program 1: Login and Query
Sample Program 2: Using a Cursor
Sample Program 3: Fetching in Batches
Sample Program 4: Datatype Equivalencing
Sample Program 5: A SQL*Forms User Exit
Sample Program 6: Dynamic SQL Method 1
Sample Program 7: Dynamic SQL Method 2
Sample Program 8: Dynamic SQL Method 3
Sample Program 9: Calling a Stored procedure
5
Implementing Dynamic SQL Method 4
Meeting the Special Requirements of Method 4
What Makes Method 4 Special?
What Information Does Oracle Need?
Where Is the Information Stored?
How is the Information Obtained?
The SQLDA
Introducing the PL/1 SQLDA
Declaring a SQLDA
Multiple SQLDAs
The SQLDA Variables
{SELDSC | BNDDSC}
SQLDNUM
SQLDFND
SQLDSC(N)
SQLDV
SQLDFMT
SQLDVLN
SQLDVTYP
SQLDI
SQLDH_VNAME
SQLDH_MAX_VNAMEL
SQLDH_CUR_VNAMEL
SQLDI_VNAME
SQLDI_MAX_VNAMEL
SQLDI_CUR_VNAMEL
SQLDFCLP
SQLDFCRCP
Datatypes in the SQLDA
Internal and External Datatypes
Coercing Datatypes After DESCRIBE
Extracting Precision and Scale
Datatype Codes
Handling NULL/NOT NULL Datatypes
The Basic Steps
A Closer Look at Each Step
Declare a Host String
Set the Size of the Descriptors
Declare the SQLDAs
Declare the Data Buffers
Initialize the Descriptors
Get the Query Text into the Host String
PREPARE the Query from the Host String
DECLARE a Cursor
DESCRIBE the Bind Variables
VariablesReset Maximum Number of Bind
Get Values for Bind Variables
OPEN the Cursor
DESCRIBE the SelectList
Adjust the Select Descriptor Values
FETCH A Row from the Active Set
Process the Select-List Items
CLOSE the Cursor
Using Host Arrays
Sample 10: Dynamic SQL Method 4 Program
A
Differences from Previous Release
Topics
B
Operating System Dependencies
Topics
Index