Programmer's Guide to the Oracle Pro*COBOL Precompiler
Release 8.0
A54659-01
Library
Product
Contents
Index
A
abbreviations, 3-2
abnormal termination
automatic rollback, F-12
active set, 5-11
changing, 5-13-
5-14
definition, 2-7
when empty, 5-14
ALLOCATE command, F-8
ALLOCATE statement, 6-26
allocating
cursors, F-8
allocating cursor variables, 6-26
ANSI/ISO SQL
compliance, viii
extensions, 7-20
application development process, 2-9
array, 2-7,
10-2
elements, 10-2
operations, 2-7
array fetch, 10-4
ARRAYLEN statement, 6-14
ASACC, 7-12
ASACC option, 7-12
ASSUME_SQLCODE option, 7-12
AT clause
CONNECT statement, 3-45
DECLARE CURSOR statement, 3-46
DECLARE STATEMENT statement, 3-48
EXECUTE IMMEDIATE statement, 3-47
of COMMIT command, F-12
of CONNECT command, F-14
of DECLARE CURSOR command, F-16
of DECLARE STATEMENT command, F-19
of EXECUTE command, F-29
of EXECUTE IMMEDIATE command, F-32
of INSERT command, F-37
of SAVEPOINT command, F-47
of SELECT command, F-50
of UPDATE command, F-52
restrictions, 3-47
AUTO_CONNECT option, 7-13
instead of CONNECT statement, 3-42
automatic logon, 3-41,
3-44
B
batch fetch, 10-4
example, 10-4
number of rows returned, 10-5
bind descriptor, 12-4
information in, 11-26
bind SQLDA, 12-3
bind variable, 11-25
binding, 11-5
BNDDFCLP variable (SQLDA), 12-14
BNDDFCRCP variable (SQLDA), 12-14
BNDDFMT variable (SQLDA), 12-10
BNDDH-CUR-VNAMEL variable (SQLDA), 12-13
BNDDH-MAX-VNAMEL variable (SQLDA), 12-13
BNDDH-VNAME variable (SQLDA), 12-13
BNDDI variable (SQLDA), 12-12
BNDDI-CUR-VNAMEL variable (SQLDA), 12-14
BNDDI-MAX-VNAMEL variable (SQLDA), 12-14
BNDDI-VNAME variable (SQLDA), 12-14
BNDDV variable (SQLDA), 12-9
BNDDVLN variable (SQLDA), 12-10
BNDDVTYP variable (SQLDA), 12-11
C
callback, user exit, 13-15
CHAR column
maximum width, 4-2
CHAR datatype
external, 4-10
internal, 4-2
character host variables
as output variables, 3-38
handling, 3-36
server handling, 3-38
types, 3-36
character sets
multi-byte, 4-33
character strings
multibyte, 4-33
CHARF datatype
external, 4-10
CHARF datatype specifier, 4-27
using in TYPE statement, 4-27
using in VAR statement, 4-27
child cursor, 6-16
CLOSE command, F-10
examples, F-10
CLOSE statement, 5-14,
6-29
example, 5-14
in dynamic SQL Method 4, 12-39
CLOSE_ON_COMMIT precompiler option, 7-13
closing
cursors, F-10
COBOL datatypes, 3-13
COBOL-74 restrictions, 3-8
code page, 4-33
coding area
for paragraph names, 3-7
coding conventions, 3-2
column list, 5-9
column, ROWLABEL, 4-8
Comment, 11-31
COMMENT clause
of COMMIT command, F-12
Comments
ANSI SQL-style, 3-3
C-style, 3-3
embedded SQL statements, 3-3
commit, 8-3
automatic, 8-4
explicit versus implicit, 8-4
COMMIT command, F-11
ending a transaction, F-44
examples, F-13
COMMIT statement, 8-4
effects, 8-4
example, 8-4
RELEASE option, 8-5
using in a PL/SQL block, 8-15
where to place, 8-4
committing
transactions, F-11
communicating over a network, 3-43
compilation, 7-38
compliance, ANSI/ISO, viii
composite type, 12-19
concurrency, 8-2
concurrent logon, 3-43
conditional precompilation, 7-35
defining symbols, 7-36
example, 7-36
CONFIG option, 7-14-
7-15,
7-18,
7-30
configuration file
system versus user, 7-14
CONNECT command, F-13
examples, F-15
CONNECT statement
ALTER AUTHORIZATION clause, 3-52
AT clause, 3-45
enabling a semantic check, E-4
logging on to Oracle, 3-39
placement, 3-40
requirements, 3-40
USING clause, 3-45
when not required, 3-42
connecting to Oracle, 3-39
automatically, 3-41
concurrently, 3-43
example of, 3-40
via SQL*Net, 3-43
connection
concurrent, 3-48
default versus non-default, 3-44
implicit, 3-50
naming, 3-45
continuation lines
syntax, 3-4
CONTINUE action, 9-28
CONTINUE option
of WHENEVER command, F-57
CONVBUFSZ clause in VAR statement, 4-24
CREATE PROCEDURE statement, 6-17
creating
savepoints, F-46
CURRENT OF clause, 5-15
example, 5-15
mimicking with ROWID, 8-13,
10-14
of embedded SQL DELETE command, F-25
of embedded SQL UPDATE command, F-53
restrictions, 5-15
current row, 2-7
CURRVAL pseudocolumn, 4-7
cursor, 5-11
analogy, 2-8
association with query, 5-11
child, 6-16
declaring, 5-11
effects on performance, D-8
explicit versus implicit, 2-7
naming, 5-12
parent, 6-16
reopening, 5-13-
5-14
restricted scope of, 7-38
restrictions, 5-12
scope, 5-12
using for multirow queries, 5-11
using more than one, 5-12
when closed automatically, 5-14
cursor cache, 6-15,
9-35
gathering statistics about, 9-38
purpose, 9-34,
D-10
cursor variable, 6-25,
F-8
closing, 6-29
fetching from, 6-28
cursor variables
advantages, 6-25
allocating, 6-26
declaring, 6-26
error conditions, 6-30
heap memory usage, 6-27
opening
anonymous block, 6-28
stored procedure, 6-27
restrictions, 6-30
scope, 6-26
cursors
allocating, F-8
closing, F-10
fetching rows from, F-33
opening, F-39
D
data definition danguage (DDL)
creating CHAR objects with DBMS=V6, 7-17
description, 5-2
data description language (DDL)
embedded, 3-6
data integrity, 8-2
data lock, 8-2
Data Manipulation Language (DML), 5-7
database link
creating a synonym, 3-51
defining, 3-50
database links
using in DELETE command, F-24
using in INSERT command, F-37
using in UPDATE command, F-53
datatype
internal versus external, 2-7
datatype conversion
between internal and external types, 4-18
datatype equivalencing, 2-7
advantages, 4-21
example, 4-24
guidelines, 4-27
datatypes
COBOL, 3-13
coercing NUMBER to VARCHAR2, 12-20
conversions, 4-17
dealing with Oracle internal, 12-20
descriptor codes, 12-20
equivalencing
description, 4-21
example, 4-24
internal, 12-16
need to coerce, 12-20
PL/SQL equivalents, 12-19
when to reset, 12-20
DATE datatype
converting, 4-20
default format, 4-20
default value, 4-3
external, 4-11
internal, 4-3
internal format, 4-11
DATE String Format, explicit control over, 4-20
DATE_FORMAT precompiler option, 7-15
DBMS option, 7-15
DDL, 3-6
DDL (data definition language), 5-2
deadlock, 8-2
effect on transactions, 8-7
how broken, 8-7
DECIMAL datatype, 4-11
declaration
cursor, 5-11
host array, 10-2
host variable, 2-13
indicator variable, 2-14
declarative SQL statement, 2-3
using in transactions, 8-3
DECLARE CURSOR command, F-15
examples, F-17
DECLARE CURSOR statement
AT clause, 3-46
in dynamic SQL Method 4, 12-30
DECLARE DATABASE directive, F-17
Declare Section
example, 3-10
using more than one, 3-10
declare section
allowable statements, 3-9
COBOL datatypes supported, 3-13
defining usernames and passwords, 3-40
purpose, 3-9
requirements, 3-9
rules for defining, 3-9
DECLARE statement, 5-11
example, 5-11
using in dynamic SQL Method 3, 11-20
where to place, 5-12
DECLARE STATEMENT command, F-19
examples, F-20
scope of, F-20
DECLARE STATEMENT statement
AT clause, 3-48
example, 11-28
using in dynamic SQL, 11-28
when required, 11-28
DECLARE TABLE command, F-20
examples, F-21
DECLARE TABLE statement
need for with AT clause, 3-46
using with the SQLCHECK option, E-4
DECLARE_SECTION, 7-18
DECLARE_SECTION precompiler option, 7-18
declaring
cursor variables, 6-26
host tables, 3-30
host variables, 3-13
indicator variables, 3-27
ORACA, 9-34
SQLCA, 9-20
SQLDA, 12-7
VARCHAR variables, 3-33
default
error handling, 9-27
setting of FORMAT option, 3-2
setting of LITDELIM option, 3-4,
7-24
setting of ORACA option, 9-35
default connection, 3-44
default database, 3-44
DEFINE option, 7-19
DELETE command, F-22
embedded SQL examples, F-26
DELETE statement, 5-10
example, 5-10
using host arrays, 10-9
WHERE clause, 5-10
DEPENDING ON clause, 3-30
DEPT table, 2-15
DESCRIBE BIND VARIABLES statement
in dynamic SQL Method 4, 12-30
DESCRIBE command, F-26
example, F-27
use with PREPARE command, F-26
DESCRIBE SELECT LIST statement
in dynamic SQL Method 4, 12-35
DESCRIBE statement
using in dynamic SQL Method 4, 11-25
descriptor, 11-25
naming, F-27
descriptors
bind descriptor, 12-4
purpose, 12-4
select descriptor, 12-4
SQLADR subroutine, 12-3
dimension of host tables, 3-30
directory, 2-11
current, 2-11
path for INCLUDE files, 2-11
directory path
INCLUDE files, 3-11
DISPLAY datatype, 4-11
distributed processing, 3-43
distributed transactions, F-45
DML (Data Manipulation Language), 5-7
DNSTIAR error codes, 9-26
DO action, 9-28
DO option
of WHENEVER command, F-57
DSNTIAR routine, 9-26
DTP model, 4-37
dummy host variable, 11-4
dynamic PL/SQL, 11-29
dynamic SQL
advantages and disadvantages, 11-3
choosing the right method, 11-7
guidelines, 11-7
overview, 2-5,
11-3
restrictions, 3-6
using PL/SQL, 6-25
using the AT clause, 3-47
when useful, 11-4
dynamic SQL Method 1
commands, 11-6
description, 11-10
example, 11-11
requirements, 11-6
using EXECUTE IMMEDIATE, 11-10
using PL/SQL, 11-30
dynamic SQL Method 2
commands, 11-6
description, 11-14
requirements, 11-6
using PL/SQL, 11-30
using the DECLARE STATEMENT statement, 11-28
using the EXECUTE statement, 11-14
using the PREPARE statement, 11-14
dynamic SQL Method 3
commands, 11-6
compared to Method 2, 11-19
requirements, 11-6
using PL/SQL, 11-30
using the DECLARE statement, 11-20
using the DECLARE STATEMENT statement, 11-28
using the FETCH statement, 11-21
using the OPEN statement, 11-20
using the PREPARE statement, 11-20
dynamic SQL Method 4
CLOSE statement, 12-39
DECLARE CURSOR statement, 12-30
DESCRIBE statement, 12-30,
12-35
external datatypes, 12-16
FETCH statement, 12-39
internal datatypes, 12-16
OPEN statement, 12-35
PREPARE statement, 12-30
prerequisites, 12-15
purpose of descriptors, 12-4
requirements, 11-7,
12-2
sequence of statements used, 12-24
SQLDA, 12-4
steps for, 12-23
using descriptors, 11-25
using PL/SQL, 11-30
using the DECLARE STATEMENT statement, 11-28
using the DESCRIBE statement, 11-25
using the FOR clause, 11-29
using the SQLDA, 11-25
when needed, 11-25
dynamic SQL statement, 11-3
binding of host variables, 11-5
how processed, 11-5
requirements, 11-4
using host arrays, 11-29
using placeholders, 11-4
versus static SQL statement, 11-3
E
embedded DDL, 3-6
embedded PL/SQL
advantages, 6-2
cursor FOR loop, 6-3
example, 6-7-
6-8
host variables, 4-30
indicator variables, 4-30
multi-byte NLS features, 4-30
need for SQLCHECK option, 6-7
need for USERID option, 6-7
overview, 2-6
package, 6-4
PL/SQL table, 6-5
requirements, 4-30
subprogram, 6-3
support for SQL, 2-6
user-defined record, 6-5
using %TYPE, 6-2
using the VARCHAR pseudotype, 6-10
using to improve performance, D-4
VARCHAR variables, 4-30
where allowed, 4-30,
6-6
embedded SQL
ALLOCATE command, F-8
CLOSE command, F-10
COMMIT command, F-11
CONNECT command, F-13
DECLARE CURSOR command, F-15
DECLARE STATEMENT command, F-19
DECLARE TABLE command, F-20
DELETE command, F-22
DESCRIBE command, F-26
EXECUTE command, F-28,
F-30
EXECUTE IMMEDIATE command, F-32
FETCH command, F-33
INSERT command, F-36
key concepts, 2-2
OPEN command, F-39
PREPARE command, F-41
SAVEPOINT command, F-46
SELECT command, F-47
UPDATE command, F-51
VAR command, F-55
versus interactive SQL, 2-5
when to use, 1-4
WHENEVER command, F-56
embedded SQL statement
mixing with host-language statements, 2-5
syntax, 2-5
embedded SQL statements
associating paragraph names with, 3-6
Comments, 3-3
continuing from one line to the next, 3-3
figurative constants, 3-4
referencing host tables, 3-31
referencing host variables, 3-17
referencing indicator variables, 3-27
requirements, 3-4
syntax, 3-4
terminator, 3-8
embedding
PL/SQL blocks in Oracle7 precompiler programs, F-28
EMP table, 2-15
encoding scheme, 4-33
END, 7-19
END_OF_FETCH, 7-19
END_OF_FETCH precompiler option, 7-19
Entry SQL, ix
equivalencing
host variable equivalencing, F-55
equivalencing datatypes, 4-21
error conditions
cursor variable, 6-30
error detection
error reporting, F-57
error handling
alternatives, 9-2
benefits, 9-2
default, 9-27
overview, 2-8
using status variables
SQLCA, 9-3,
9-19
SQLCODE, 9-3,
9-6
SQLSTATE, 9-3
using the ROLLBACK statement, 8-6
using the SQLGLS function, 9-31
error message text
SQLGLM subroutine, 9-25
error messages
maximum length, 9-25
error reporting
error message text, 9-21
key components of, 9-21
parse error offset, 9-21
rows-processed count, 9-21
status codes, 9-21
warning flags, 9-21
WHENEVER command, F-57
ERRORS option, 7-20
exception, PL/SQL, 6-12
EXEC ORACLE DEFINE statement, 7-35
EXEC ORACLE ELSE statement, 7-35
EXEC ORACLE ENDIF statement, 7-35
EXEC ORACLE IFDEF statement, 7-35
EXEC ORACLE IFNDEF statement, 7-35
EXEC ORACLE statement
scope of, 7-8
syntax for, 7-7
uses for, 7-8
using to enter options inline, 7-7
EXEC SQL clause, 2-5,
3-4
EXEC TOOLS statement, 13-15
GET, 13-17
MESSAGE, 13-17
SET, 13-16
EXECUTE command, F-28,
F-30
examples, F-29,
F-31
EXECUTE IMMEDIATE command, F-32
examples, F-33
EXECUTE IMMEDIATE statement
AT clause, 3-47
using in dynamic SQL Method 1, 11-10
EXECUTE statement
using in dynamic SQL Method 2, 11-14
execution plan, D-6
EXPLAIN PLAN statement
using to improve performance, D-7
explicit logon, 3-44
multiple, 3-48
single, 3-45
external datatype
CHAR, 4-10
CHARF, 4-10
DATE, 4-11
DECIMAL, 4-11
definition, 2-7
DISPLAY, 4-11
FLOAT, 4-12
INTEGER, 4-12
LONG, 4-12
LONG RAW, 4-12
LONG VARCHAR, 4-12
LONG VARRAW, 4-12
MLSLABEL, 4-13
NUMBER, 4-13
parameters, 4-23
RAW, 4-14
ROWID, 4-14
STRING, 4-15
UNSIGNED, 4-15
VARCHAR, 4-15
VARCHAR2, 4-16
VARNUM, 4-16
VARRAW, 4-17
external datatypes
dynamic SQL Method 4, 12-16
general, 4-8
F
FETCH command, F-33
examples, F-35
used after OPEN command, F-40
FETCH statement, 5-13-
5-14,
6-28
cursor variable, 6-29
example, 5-13
in dynamic SQL Method 4, 12-39
INTO clause, 5-13
using in dynamic SQL Method 3, 11-21
fetch, batch, 10-4
fetching
rows from cursors, F-33
figurative constants
embedded SQL statements, 3-4
file extension
for INCLUDE files, 3-11
FILLER allowed, 3-9
FIPS option, 7-20
flags, 9-21
FLOAT datatype, 4-12
FOR clause, 10-11
example, 10-11
of embedded SQL EXECUTE command, F-31
of embedded SQL INSERT command, F-37
restrictions, 10-12
using with host arrays, 10-11
FOR UPDATE OF clause, 8-11
FORCE clause
of COMMIT command, F-12
of ROLLBACK command, F-44
format mask, 4-20
FORMAT option, 7-21
purpose, 3-2
forward reference, 5-12
full scan, D-7
G
GENXTB form
running, 13-13
GOTO action, 9-28
GOTO option
of WHENEVER command, F-57
group items
allowed as host variables, 3-18
implicit VARCHAR, 3-34
guidelines
datatype equivalencing, 4-27
dynamic SQL, 11-7
host variable, 2-14
separate precompilation, 7-37
transaction, 8-14
user exit, 13-14
H
heap, 9-35
heap memory
allocating cursor variables, 6-27
hint, optimizer, D-6
hints
in DELETE statements, F-26
in SELECT statements, F-50
in UPDATE statements, F-54
HOLD_CURSOR option, 7-21
of ORACLE Precompilers, F-10
using to improve performance, D-13
what it affects, D-8
host array, 10-2
advantages, 10-2
declaring, 10-2
dimensioning, 10-2
maximum size, 10-3
referencing, 10-3
restrictions, 10-6,
10-8-
10-10
using in dynamic SQL statements, 11-29
using in the DELETE statement, 10-9
using in the INSERT statement, 10-7
using in the SELECT statement, 10-4
using in the UPDATE statement, 10-8
using in the WHERE clause, 10-13
using the FOR clause, 10-11
using to improve performance, D-3
host language, 2-2
HOST option, 7-22
host program, 2-2
host tables
declaring, 3-30
dimensioning, 3-30
multi-dimensional, 3-30
referencing, 3-31
restrictions, 3-30
support for, 3-16
variable-length, 3-30
host variable, 5-2
assigning a value, 2-6
declaring, 2-13
dummy, 11-4
guidelines, 2-14
input versus output, 5-2
naming, 2-13
overview, 2-6
referencing, 2-13
requirements, 2-6
using in EXEC TOOLS statements, 13-16
using in PL/SQL, 6-7
using in user exit, 13-6
where allowed, 2-6
host variables
declaring, 3-2,
3-9,
3-13
definition, 3-5
host variable equivalencing, F-55
in EXECUTE command, F-31
in OPEN command, F-40
initializing, 3-16
naming, 3-17,
3-19
referencing, 3-17
restrictions, 3-5,
3-19
with PL/SQL, 4-30
hyphenation
of host variable names, 3-5
I
IAF GET statement
example, 13-7
specifying block and field names, 13-7
using in user exit, 13-6
IAF PUT statement
example, 13-8
specifying block and field names, 13-8
using in user exit, 13-7
IAP, 13-14
identifiers, ORACLE
how to form, F-8
implicit logon, 3-50
multiple, 3-51
single, 3-50
IN OUT parameter mode, 6-4
IN parameter mode, 6-4
INAME option, 7-22
when a file extension is required, 7-2
INCLUDE file, 2-11
INCLUDE option, 7-23
INCLUDE statement, 2-11
case-sensitive operating systems, 3-12
declaring the ORACA, 9-34
declaring the SQLCA, 9-20
declaring the SQLDA, 12-7
effect of, 3-11
index
using to improve performance, D-7
indicator array, 10-2
indicator tables
example, 3-32
purpose, 3-32
indicator variable, 5-3
association with host variable, 5-3
declaring, 2-14
interpreting value, 5-3
referencing, 2-14
using in PL/SQL, 6-11
using to detect truncated values, 5-4
using to handle nulls, 5-4-
5-5
using to test for nulls, 5-6
indicator variables
association with host variables, 3-27
declaring, 3-2,
3-27
function, 3-27
nulls, 4-31
referencing, 3-27
required size, 3-27
truncated values, 4-31
used with multi-byte character strings, 4-35
with PL/SQL, 4-30
in-doubt transaction, 8-14
input host variable
restrictions, 5-2
where allowed, 5-2
INSERT command, F-36
embedded SQL examples, F-38
insert of no rows
cause of, 9-10
INSERT statement, 5-9
column list, 5-9
example, 5-9
INTO clause, 5-9
using host arrays, 10-7
VALUES clause, 5-9
inserting
rows into tables and views, F-36
INTEGER datatype, 4-12
interface
native, 4-37
XA, 4-37
internal datatype
CHAR, 4-2
DATE, 4-3
definition, 2-7
LONG, 4-3
LONG RAW, 4-4
MLSLABEL, 4-4
NUMBER, 4-4
RAW, 4-5
ROWID, 4-5
VARCHAR2, 4-5
internal datatypes
dynamic SQL Method 4, 12-16
general, 4-2
INTO clause, 5-2,
6-29
FETCH statement, 5-13
INSERT statement, 5-9
of FETCH command, F-34
of SELECT command, F-50
SELECT statement, 5-8
IRECLEN option, 7-24
IS NULL operator
for testing null values, 3-6
J
Julian date, 4-3
L
language support, 1-3
LDA, 4-35
LEVEL pseudocolumn, 4-7
link, database, 3-50
linking, 7-38
LITDELIM option, 3-4,
7-24
purpose, 7-24
LNAME option, 7-25
location transparency, 3-51
lock
released by ROLLBACK statement, F-45
LOCK TABLE statement, 8-12
example, 8-12
using the NOWAIT parameter, 8-12
locking, 8-2,
8-11
explicit versus implicit, 8-11
modes, 8-2
overriding default, 8-11
privileges needed, 8-15
using the FOR UPDATE OF clause, 8-11
using the LOCK TABLE statement, 8-12
logging on
requirements, 3-39
logon
automatic, 3-41
concurrent, 3-43
explicit, 3-44
Logon Data Area (LDA), 4-35
LONG column
maximum width, 4-3
LONG datatype
compared with CHAR, 4-3
external, 4-12
internal, 4-3
restrictions, 4-3
where allowed, 4-3
LONG RAW column
maximum width, 4-4
LONG RAW datatype
compared with LONG, 4-4
converting, 4-28
external, 4-12
internal, 4-4
restrictions, 4-4
LONG VARCHAR datatype, 4-12
LONG VARRAW datatype, 4-12
LRECLEN option, 7-25
LTYPE option, 7-25
M
MAXLITERAL option, 7-26
MAXOPENCURSORS option, 7-26
using for separate precompilation, 7-37
what it affects, D-8
message text, 9-21
MLSLABEL datatype
external, 4-13
internal, 4-4
MODE option, 7-27
effects of, 3-36
status variables, 9-2
mode, parameter, 6-4
monitor, transaction processing, 4-36
multi-byte character sets, 4-33
multi-byte NLS features
datatypes, 3-6
with PL/SQL, 4-30
N
namespaces
reserved by Oracle, C-7
naming
host variables, 3-5
of database objects, F-8
select-list items, 12-4
naming conventions
cursor, 5-12
default database, 3-44
host variable, 2-13
SQL*Forms user exit, 13-14
national language support (NLS), 4-31
native interface, 4-37
nested programs
sample, 3-22
support for, 3-20
Net8
connecting using, 3-41
function of, 3-43
network
communicating over, 3-43
protocols, 3-44
reducing traffic, D-5
NEXTVAL pseudocolumn, 4-7
nibble, 4-28
NIST
compliance, viii
NLS (national language support), 4-31
multi-byte character strings, 4-33
NLS parameter
NLS_CURRENCY, 4-32
NLS_DATE_FORMAT, 4-32
NLS_DATE_LANGUAGE, 4-32
NLS_ISO_CURRENCY, 4-32
NLS_LANG, 4-32
NLS_LANGUAGE, 4-32
NLS_NUMERIC_CHARACTERS, 4-32
NLS_SORT, 4-32
NLS_TERRITORY, 4-32
NLS_LOCAL
precompiler option, 7-28
node
definition of, 3-43
NOT FOUND condition, 9-27
of WHENEVER command, F-57
NOWAIT parameter, 8-12
using in LOCK TABLE statement, 8-12
null
definition, 2-6
detecting, 5-4
hardcoding, 5-4
inserting, 5-4
restrictions, 5-6
retrieving, 5-5
testing for, 5-6
nulls
handling
in dynamic SQL Method 4, 12-22
indicator variables, 4-31
meaning in SQL (NVL function), 3-6
SQLNUL subroutine, 12-22
null-terminated string, 4-15
NUMBER datatype
external, 4-13
internal, 4-4
using the SQLPRC subroutine with, 12-21
NVL function
for retrieving null values, 3-6
O
OCI
declaring LDA, 4-35
embedding calls, 4-35
ONAME option, 7-28
OPEN command, F-39
examples, F-41
OPEN statement, 5-13
example, 5-13
in dynamic SQL Method 4, 12-35
using in dynamic SQL Method 3, 11-20
OPEN_CURSORS parameter, 6-16
opening
cursors, F-39
opening a cursor variable, 6-27
operators
relational, 3-8
optimizer hint, D-6
options
precompiler, 7-3
ORACA, 9-4
declaring, 9-34
enabling, 9-35
example, 9-39
fields, 9-35
gathering cursor cache statistics, 9-38
ORACABC field, 9-36
ORACAID field, 9-35
ORACCHF flag, 9-36
ORACOC field, 9-38
ORADBGF flag, 9-36
ORAHCHF flag, 9-36
ORAHOC field, 9-38
ORAMOC field, 9-38
ORANEX field, 9-38
ORANOR field, 9-38
ORANPR field, 9-38
ORASFNMC field, 9-37
ORASFNML field, 9-37
ORASLNR field, 9-38
ORASTXTC field, 9-37
ORASTXTF flag, 9-37
ORASTXTL field, 9-37
precompiler option, 9-35
purpose, 9-4,
9-34
structure of, 9-35
ORACA option, 7-29
ORACABC field, 9-36
ORACAID field, 9-35
ORACCHF flag, 9-36
Oracle Call Interface, 4-35
Oracle Communications Area
ORACA, 9-34
Oracle datatypes, 2-6
Oracle Forms
using EXEC TOOLS statements, 13-15
ORACLE identifiers
how to form, F-8
Oracle namespaces, C-7
Oracle Open Gateway
using ROWID datatype, 4-15
Oracle Precompilers
advantages, 1-4
function, 1-2
language support, 1-3
NLS support, 4-33
running, 7-1
using PL/SQL, 6-6
using with OCI, 4-35
Oracle Toolset, 13-15
ORACOC
in ORACA, 9-38
ORACOC field, 9-38
ORADBGF flag, 9-36
ORAHCHF flag, 9-36
ORAHOC field, 9-38
ORAMOC field, 9-38
ORANEX
in ORACA, 9-38
ORANEX field, 9-38
ORANOR field, 9-38
ORANPR field, 9-38
ORASFNM, in ORACA, 9-37
ORASFNMC field, 9-37
ORASFNML field, 9-37
ORASLNR
in ORACA, 9-38
ORASLNR field, 9-38
ORASTXTC field, 9-37
ORASTXTF flag, 9-37
ORASTXTL field, 9-37
ORECLEN option, 7-29
OUT parameter mode, 6-4
output host variable, 5-2
P
PAGELEN option, 7-29
paragraph names
associating with SQL statements, 3-6
coding area for, 3-7
parameter mode, 6-4
parent cursor, 6-16
parse, 11-5
parse error offset, 9-21
parsing dynamic statements
PREPARE command, F-41
password
defining, 3-40
hardcoding, 3-40
passwords
changing at runtime, 3-52
passwords, changing at runtime, 3-52
performance
improving, D-3
reasons for poor, D-2
PICX, 7-30
new default, 3-36
PICX precompiler option, 7-30
PL/SQL, 1-5
,
9-25
advantages, 1-5
cursor FOR loop, 6-3
datatype equivalents, 12-19
embedded, 4-30
exception, 6-12
integration with server, 6-2
opening a cursor variable
anonymous block, 6-28
stored procedure, 6-27
package, 6-4
relationship with SQL, 1-5
subprogram, 6-3
user-defined record, 6-5
PL/SQL blocks
embedded in Oracle7 precompiler programs, F-28
PL/SQL table, 6-5
supported datatype conversions, 6-14
placeholder
duplicate, 11-15,
11-30
naming, 11-16
using in dynamic SQL statements, 11-4
plan, execution, D-6
precision, 4-4
definition of, 12-21
using SQLPRC to extract, 12-21
when not specified, 12-21
precompilation, 7-3
conditional, 7-35
separate, 7-37
precompilation unit, 7-9
precompiler, 1-2
precompiler command
optional arguments of, 7-3
required arguments, 7-2
precompiler directives
EXEC SQL DECLARE DATABASE, F-17
precompiler options
abbreviating name, 7-4
ASACC, 7-12
ASSUME_SQLCODE, 7-12
AUTO_CONNECT, 3-42,
7-13
CLOSE_ON_COMMIT, 7-13
CONFIG, 7-14-
7-15,
7-18,
7-30
DATE_FORMAT, 7-15
DBMS, 7-15
DECLARE_SECTION, 7-18
DEFINE, 7-19
displaying, 7-4,
7-9
END_OF_FETCH, 7-19
entering, 7-7
entering inline, 7-7
entering on the command line, 7-7
ERRORS, 7-20
FIPS, 7-20
FORMAT, 7-21
HOLD_CURSOR, 7-21
HOST, 7-22
INAME, 7-22
INCLUDE, 7-23
IRECLEN, 7-24
LITDELIM, 3-4,
7-24
LNAME, 7-25
LRECLEN, 7-25
LTYPE, 7-25
macro and micro, 7-5
MAXLITERAL, 7-26
MAXOPENCURSORS, 7-26
MODE, 3-36,
7-27,
9-2,
9-4
NLS_LOCAL, 7-28
ONAME, 7-28
ORACA, 7-29,
9-35
ORECLEN, 7-29
PAGELEN, 7-29
PICX, 7-30
precedence, 7-4
RELEASE_CURSOR, 7-30
respecifying, 7-9
scope of, 7-9
SELECT_ERROR, 7-31
specifying, 7-3,
7-7
SQLCHECK, 7-32
syntax for, 7-7
UNSAFE_NULL, 7-34
USERID, 7-34
VARCHAR, 7-35
XREF, 7-35
PREPARE command, F-41
examples, F-42
PREPARE statement
effect on data definition statements, 11-6
in dynamic SQL Method 4, 12-30
using in dynamic SQL, 11-14,
11-20
private SQL area
association with cursors, 2-7
opening, 2-7
purpose, D-10
Program Global Area (PGA), 6-15
program termination, 8-10
programming guidelines, 3-2
programming language support, 1-3
pseudocolumn, 4-6
CURRVAL, 4-7
LEVEL, 4-7
NEXTVAL, 4-7
ROWID, 4-7
ROWNUM, 4-7
pseudotype, VARCHAR, 2-13
Q
query, 5-7
association with cursor, 5-11
multirow, 5-7
single-row versus multirow, 5-8
R
RAW column
maximum width, 4-5
RAW datatype
compared with CHAR, 4-5
converting, 4-28
external, 4-14
internal, 4-5
restrictions, 4-5
RAWTOHEX function, 4-28
read consistency, 8-2
READ ONLY parameter
using in SET TRANSACTION, 8-10
read-only transaction, 8-10
ending, 8-10
example, 8-10
record, user-defined, 6-5
REDEFINES clause
purpose, 3-7
restrictions, 3-7
reference
host array, 10-3
host variable, 2-13
indicator variable, 2-14
reference cursor, 6-25
referencing
host tables, 3-31
host variables, 3-17
indicator variables, 3-27
VARCHAR variables, 3-35
relational operators, 3-8
RELEASE option, 8-5,
8-10
COMMIT statement, 8-5
omitting, 8-10
restrictions, 8-9
ROLLBACK statement, 8-6
RELEASE_CURSOR option, 7-30
of ORACLE Precompilers, F-10
using to improve performance, D-13
what it affects, D-8
remote database
declaration of, F-17
resource manager, 4-36
restrictions
AT clause, 3-47
COBOL-74, 3-8
CURRENT OF clause, 5-15
cursor declaration, 5-12
cursor variables, 6-30
dynamic SQL, 3-6
FOR clause, 10-12
host array, 10-6,
10-8-
10-10
host tables, 3-30
host variables, 3-19
naming, 3-5
referencing, 3-19
input host variable, 5-2
LONG datatype, 4-3
LONG RAW datatype, 4-4
RAW datatype, 4-5
REDEFINES clause, 3-7
RELEASE option, 8-9
separate precompilation, 7-37
SET TRANSACTION statement, 8-10
SQLCHECK option, E-2
SQLGLM subroutine, 9-26
SQLIEM subroutine, 9-26
TO SAVEPOINT clause, 8-9
retrieving rows from a table
embedded SQL, F-47
return code, 13-9
roll back
to a savepoint, F-46
to the same savepoint multiple times, F-45
rollback
automatic, 8-7
purpose, 8-3
statement-level, 8-7
ROLLBACK command, F-42
ending a transaction, F-44
examples, F-45
rollback segment, 8-2
ROLLBACK statement, 8-6
effects, 8-6
example, 8-6
RELEASE option, 8-6
TO SAVEPOINT clause, 8-6
using in a PL/SQL block, 8-15
using in error-handling routines, 8-6
where to place, 8-6
rolling back
transactions, F-42
row lock
acquiring with FOR UPDATE OF, 8-11
using to improve performance, D-7
when acquired, 8-12
when released, 8-12
ROWID datatype
external, 4-14
internal, 4-5
ROWID pseudocolumn, 4-7
using to mimic CURRENT OF, 8-13,
10-14
ROWLABEL column, 4-8
ROWNUM pseudocolumn, 4-7
rows
fetching from cursors, F-33
inserting into tables and views, F-36
updating, F-51
rows-processed count, 9-21
S
sample database table
DEPT table, 2-15
EMP table, 2-15
sample programs
calling a stored procedure, 6-20
cursor operations, 5-16
cursor variables
PL/SQL source, 6-31
Pro*COBOL source, 6-31
datatype equivalencing, 5-18
dynamic SQL Method 1, 11-11
dynamic SQL Method 2, 11-16
dynamic SQL Method 3, 11-21
dynamic SQL Method 4, 12-45
fetching in batches, 10-15
Oracle Forms user exit, 13-10
simple query, 2-16
savepoint, 8-7
when erased, 8-9
SAVEPOINT command, F-46
examples, F-47
SAVEPOINT statement, 8-7
example, 8-7
savepoints
creating, F-46
SAVEPOINTS parameter, 8-9
scalar type, 12-19
Scale
using SQLPRC to extract, 4-23
scale, 4-4
definition, 12-21
definition of, 4-23
extracting with SQLPRC, 12-21
when negative, 4-23,
12-21
scope
cursor variables, 6-26
of DECLARE STATEMENT command, F-20
of precompiler options, 7-9
of the EXEC ORACLE statement, 7-8
WHENEVER statement, 9-30
search condition, 5-10
using in the WHERE clause, 5-10
SELDFCLP variable (SQLDA), 12-14
SELDFCRCP variable (SQLDA), 12-14
SELDFMT variable (SQLDA), 12-10
SELDH-CUR-VNAMEL variable (SQLDA), 12-13
SELDH-MAX-VNAMEL variable (SQLDA), 12-13
SELDH-VNAME variable (SQLDA), 12-13
SELDI variable (SQLDA), 12-12
SELDI-CUR-VNAMEL variable (SQLDA), 12-14
SELDI-MAX-VNAMEL variable (SQLDA), 12-14
SELDI-VNAME variable (SQLDA), 12-14
SELDV variable (SQLDA), 12-9
SELDVLN variable (SQLDA), 12-10
SELDVTYP variable (SQLDA), 12-11
SELECT command, F-47
embedded SQL examples, F-50
select descriptor, 12-4
information in, 11-26
select list, 5-8
select SQLDA
purpose of, 12-3
SELECT statement, 5-8
available clauses, 5-9
example, 5-8
INTO clause, 5-8
using host arrays, 10-4
SELECT_ERROR option, 5-8,
7-31
select-list items
naming, 12-4
semantic checking, E-2
enabling, E-3
using the SQLCHECK option, E-2
separate precompilation
guidelines, 7-37
restrictions, 7-37
session, 8-2
sessions
beginning, F-13
SET clause, 5-10
using a subquery, 5-10
SET TRANSACTION statement, 8-10
example, 8-10
READ ONLY parameter, 8-10
restrictions, 8-10
snapshot, 8-2
SQL
summary of commands, F-3
SQL codes
returned by SQLGLS function, 9-32
SQL Communications Area, 2-12
SQL Descriptor Area, 11-25,
12-4
SQL standards conformance, ix
SQL statement
controlling transactions, 8-3
optimizing to improve performance, D-6
static versus dynamic, 2-5
using to control a cursor, 5-7,
5-11
using to manipulate Oracle data, 5-7
SQL*Connect
using ROWID datatype, 4-15
SQL*Forms
Display Error screen, 13-9
IAP constants, 13-10
returning values to, 13-9
Reverse Return Code switch, 13-9
user exit, 13-3
SQL*Net
concurrent logons, 3-43
connection syntax, 3-44
using to connect to Oracle, 3-43
SQL*Plus, 1-5
SQL_CURSOR, F-8
SQL92
conformance, ix
minimum requirement, ix
SQLADR subroutine
example, 12-27
parameters, 12-15
storing buffer addresses, 12-3
syntax, 12-15
SQLCA, 9-3
components set for a PL/SQL block, 9-25
fields, 9-22
interaction with Oracle, 2-12
overview, 2-9
SQLCABC field, 9-22
SQLCAID field, 9-22
SQLCODE field, 9-22
SQLERRD(3) field, 9-23
SQLERRD(5) field, 9-23
SQLERRMC field, 9-23
SQLERRML field, 9-23
SQLWARN(4) flag, 9-24
SQLWARN(5) flag, 9-24
using in separate precompilations, 7-37
using with SQL*Net, 9-19
SQLCA status variable
data structure, 9-19
declaring, 9-20
effect of MODE option, 9-4
explicit versus implicit checking, 9-3
purpose, 9-19
SQLCABC field, 9-22
SQLCAID field, 9-22
SQLCHECK option, 7-32
restrictions, E-2
using the DECLARE TABLE statement, E-4
using to check syntax/semantics, E-1
SQLCODE
declaring, 9-6
SQLCODE field, 9-22
interpreting its value, 9-22
SQLCODE status variable
declaring, 9-6
description, 9-3
effect of MODE option, 9-4
SQL92 deprecated feature, 9-3
usage, 9-4
SQLCODE variable
interpreting values of, 9-10
SQLDA, 11-25-
11-26
bind versus select, 11-26
BNDDFCLP variable, 12-14
BNDDFCRCP variable, 12-14
BNDDFMT variable, 12-10
BNDDH-CUR-VNAMEL variable, 12-13
BNDDH-MAX-VNAMEL variable, 12-13
BNDDH-VNAME variable, 12-13
BNDDI variable, 12-12
BNDDI-CUR-VNAMEL variable, 12-14
BNDDI-MAX-VNAMEL variable, 12-14
BNDDI-VNAME variable, 12-14
BNDDV variable, 12-9
BNDDVLN variable, 12-10
BNDDVTYP variable, 12-11
declaring, 12-7
example, 12-7
information stored in, 11-26
purpose, 12-4
SELDFCLP variable, 12-14
SELDFCRCP variable, 12-14
SELDFMT variable, 12-10
SELDH-CUR-VNAMEL variable, 12-13
SELDH-MAX-VNAMEL variable, 12-13
SELDH-VNAME variable, 12-13
SELDI variable, 12-12
SELDI-CUR-VNAMEL variable, 12-14
SELDI-MAX-VNAMEL variable, 12-14
SELDI-VNAME variable, 12-14
SELDV variable, 12-9
SELDVLN variable, 12-10
SELDVTYP variable, 12-11
SQLADR subroutine, 12-15
SQLDFND variable, 12-9
SQLDNUM variable, 12-8
structure, 12-8
SQLDFND variable (SQLDA), 12-9
SQLDNUM variable (SQLDA), 12-8
SQLERRD(3) field, 9-23
using with batch fetch, 10-5
SQLERRD(3) variable, 9-21
SQLERRD(5) field, 9-23
SQLERRMC field, 9-23
SQLERRMC variable, 9-21
SQLERRML field, 9-23
SQLERROR
WHENEVER command condition, F-57
SQLERROR condition, 9-27
SQLFC parameter, 9-32
SQLGLM subroutine
example, 9-25
parameters, 9-25
purpose, 9-25
restrictions, 9-26
syntax, 9-25
SQLGLS function
parameters, 9-32
SQL codes returned by, 9-32
syntax, 9-31
using to obtain SQL text, 9-31
SQLGLS routine, 9-31-
9-32
SQLIEM function
replacement for, 13-16
using in user exit, 13-10
SQLIEM subroutine
restrictions, 9-26
SQLLDA routine, 4-35
SQLNUL subroutine
example, 12-23
parameters, 12-22
purpose, 12-22
syntax, 12-22
SQLPR2 subroutine, 12-22
SQLPRC subroutine
example, 12-21
parameters, 12-21
purpose, 12-21
syntax, 12-21
SQLSTATE
declaring, 9-6
SQLSTATE status variable
class code, 9-10
coding scheme, 9-10
effect of MODE option, 9-4
interpreting values, 9-11
predefined classes, 9-11
predefined status codes and conditions, 9-13
subclass code, 9-10
usage, 9-4
SQLSTM parameter, 9-32
SQLSTM routine, 9-32
SQLWARN(4) flag, 9-24
SQLWARN(5) flag, 9-24
SQLWARNING
WHENEVER command condition, F-57
SQLWARNING condition, 9-27
statement-level rollback, 8-7
breaking deadlocks, 8-7
status codes for error reporting, 9-21
STMLEN parameter, 9-32
STOP action, 9-28
STOP option
of WHENEVER command, F-57
stored procedure
opening a cursor, 6-27,
6-30
sample programs, 6-20,
6-30
stored subprogram, 6-17
calling, 6-19
creating, 6-17
packaged versus standalone, 6-17
stored versus inline, D-5
using to improve performance, D-4
STRING datatype, 4-15
string literals
continuing to the next line, 3-4
subprogram, PL/SQL, 6-3,
6-17
subquery, 5-9
example, 5-9-
5-10
using in the SET clause, 5-10
using in the VALUES clause, 5-9
syntactic checking, E-2
syntax
continuation lines, 3-4
embedded SQL statements, 3-4
SQLADR subroutine, 12-15
SQLGLM subroutine, 9-25
SQLNUL subroutine, 12-22
SQLPRC, 12-21
syntax diagram
description of, F-5
how to read, F-5
how to use, F-5
symbols used in, F-5
syntax, embedded SQL, 2-5
SYSDATE function, 4-8
system failure
effect on transactions, 8-4
System Global Area (SGA), 6-17
T
table lock
acquiring with LOCK TABLE, 8-12
exclusive, 8-12
row share, 8-12
when released, 8-13
tables
inserting rows into, F-36
updating rows in, F-51
terminator for embedded SQL statements, 3-8
TO SAVEPOINT clause, 8-8
restrictions, 8-9
using in ROLLBACK statement, 8-8
trace facility
using to improve performance, D-7
transaction, 8-3
contents, 2-8,
8-3
guidelines, 8-14
how to begin, 8-3
how to end, 8-3
in-doubt, 8-14
making permanent, 8-4
subdividing with savepoints, 8-7
undoing, 8-6
undoing parts of, 8-8
when rolled back automatically, 8-4,
8-7
transaction processing
overview, 2-8
statements used, 2-8
transaction, read-only, 8-10
transactions
committing, F-11
distributed, F-45
rolling back, F-42
truncated value, 6-12
detecting, 5-4
truncated values
indicator variables, 4-31
truncation error
when generated, 5-6
Trusted Oracle7, 12-19
tuning, performance, D-2
TYPE statement
using the CHARF datatype specifier, 4-27
U
UID function, 4-8
unconditional delete, 9-24
undo a transaction, F-42
UNSAFE_NULL option, 7-34
UNSIGNED datatype, 4-15
UPDATE command, F-51
embedded SQL examples, F-54
UPDATE statement, 5-10
example, 5-10
SET clause, 5-10
using host arrays, 10-8
updating
rows in tables and views, F-51
user exit, 13-3
calling from a SQL*Forms trigger, 13-8
common uses, 13-4
guidelines, 13-14
linking into IAP, 13-14
meaning of codes returned by, 13-9
naming, 13-14
passing parameters, 13-9
requirements for variables, 13-6
running the GENXTB form, 13-13
statements allowed in, 13-5
steps in developing, 13-5
using EXEC IAF statements, 13-6
using EXEC TOOLS statements, 13-15
using the WHENEVER statement, 13-10
USER function, 4-8
user session, 8-2
user-defined record, 6-5
USERID option, 7-34
using with the SQLCHECK option, E-4
username
defining, 3-40
hardcoding, 3-40
USING clause
CONNECT statement, 3-45
of FETCH command, F-34
of OPEN command, F-40
using in the EXECUTE statement, 11-15
using indicator variables, 11-16
using dbstring
SQL*Net database id specification, F-14
V
VALUE clause
initializing host variables, 3-16
VALUES clause
INSERT statement, 5-9
of embedded SQL INSERT command, F-38
of INSERT command, F-38
using a subquery, 5-9
VAR command, F-55
examples, F-56
VAR statement
CONVBUFSZ clause, 4-24
syntax for, 4-22
using the CHARF datatype specifier, 4-27
VARCHAR
precompiler option, 7-35
VARCHAR datatype, 4-15
VARCHAR precompiler option, 7-34
VARCHAR pseudotype, 2-13
maximum length, 2-13
using with PL/SQL, 6-10
VARCHAR variables
advantages, 3-39
as input variables, 3-38
as output variables, 3-39
declaring, 3-33
implicit group items, 3-34
length element, 3-33
maximum length, 3-33
referencing, 3-35
server handling, 3-38-
3-39
string element, 3-33
structure, 3-33
versus fixed-length strings, 3-39
with PL/SQL, 4-30
VARCHAR2 column
maximum width, 4-5
VARCHAR2 datatype
external, 4-16
internal, 4-5
variable, 2-6
VARNUM datatype, 4-16
example of output value, 4-28
VARRAW datatype, 4-17
VARYING keyword
versus VARYING phrase, 3-33
views
inserting rows into, F-36
updating rows in, F-51
W
warning flags for error reporting, 9-21
WHENEVER command, F-56
examples, F-58
WHENEVER Statement, 9-27
WHENEVER statement
CONTINUE action, 9-28
DO action, 9-28
example, 9-29
GOTO action, 9-28
NOT FOUND condition, 9-27
overview, 2-9
purpose, 9-27
scope, 9-30
SQLERROR condition, 9-27
SQLWARNING condition, 9-27
STOP action, 9-28
syntax, 9-28
using to check SQLCA automatically, 9-27
WHENEVER statement, careless usage, 9-30
WHENEVER statement, scope of, 9-30
WHERE clause, 5-10
DELETE statement, 5-10
of DELETE command, F-25
of UPDATE command, F-53
search condition, 5-10
SELECT statement, 5-8
UPDATE statement, 5-10
using host arrays, 10-13
WHERE CURRENT OF clause, 5-15
WORK option
of COMMIT command, F-12
of ROLLBACK command, F-44
X
X/Open application, 4-36
XA interface, 4-37
XREF option, 7-35
Prev
Next
Copyright © 1997 Oracle Corporation.
All Rights Reserved.
Library
Product
Contents
Index