Oracle9i Data Cartridge Developer's Guide Release 2 (9.2) Part Number A96595-01 |
|
This chapter first describes System Defined Constants and System Defined Types. Both of these apply generically to all supported languages. Next, in three subsections, this chapter describes mappings that are specific to the PL/SQL, C, and Java languages.
All the constants referred to in this chapter are defined in the ODCIConst
package installed as part of the catodci.sql
script. There are equivalent definitions for use within C routines in odci.h
.
We strongly recommend that you use these constants instead of hard coding their underlying values in your routines.
PredExactMatch
PredPrefixMatch
PredIncludeStart
PredIncludeStop
PredMultiTable
PredObjectFunc
PredObjectPkg
PredObjectType
Success
Error
Warning
ErrContinue
Fatal
A number of system-defined types are defined by Oracle and need to be created by running the catodci.sql
catalog script. The C mappings for these object types are defined in odci.h The ODCIIndex
and ODCIStats
routines described in Chapter 17 and Chapter 18 use these types as parameters.
Unless otherwise mentioned, the names parsed as type attributes are unquoted identifiers.
ODCIArgDesc
Object type.
Stores function/operator arguments.
ODCIArgDescList
VARRAY(32767) of ODCIArgDesc
Contains a list of argument descriptors
ODCIRidList
VARRAY(32767) OF VARCHAR2("M_URID_SZ")
Stores list of rowids. The rowids are stored in their character format.
ODCIColInfo
Object type.
Stores information related column.
ODCIColInfoList
VARRAY(32) OF ODCIColInfo
Stores information related to a list of columns.
ODCIColStats
Object type
Stores statistics for a list of columns for a table function.
ODCIColStatsList
VARRAY(32)
of ODCIColStats
Stores statistics for a list of column for a table function.
ODCICost
Object type.
Stores cost information.
ODCIEnv
Object type
Contains general information about the environment in which the extensibility routines are executing.
Name | Datatype | Purpose |
---|---|---|
|
|
Not currently used |
|
|
CallProperty
is used only for local domain indexes. For non-local domain indexes it is always set to 0
.
For local domain indexes, CallProperty
is set to indicate which is the current call in cases where multiple calls are made to the same routine.
For example, when creating a local domain index, the ODCIIndexCreate
routine is called N
+2 times, where N
is the number of partitions. For the first call, CallProperty
is set to FirstCall
, for the N
intermediate calls, it is set to IntermediateCall
, and for the last call it is set to FinalCall
.
CallProperty
is used only for CREATE INDEX
, DROP INDEX
, TRUNCATE TABLE
, and for some of the extensible optimizer-related calls for local domain indexes. In all other cases, including DML and query routines for local domain indexes, it is set to 0
.
ODCIFuncInfo
Object type.
Stores function information.
ODCIIndexInfo
Object type
Stores the metadata information related to a domain index. It is passed as a parameter to all ODCIIndex
routines.
ODCIPredInfo
Object type
Stores the metadata information related to a predicate containing a user-defined operator or function. It is also passed as a parameter to ODCIIndexStart
() query routine.
ODCIIndexCtx
Object type
Stores the index context, including the domain index metadata and the ROWID
. It is passed as parameter to the functional implementation of an operator that expects index context.
Name | Datatype | Purpose |
---|---|---|
|
|
Stores the metadata information about the domain index |
|
|
Row identifier of the current row |
ODCIObject
Object type
Stores information about a schema object.
Name | Datatype | Purpose |
---|---|---|
|
|
Name of schema in which object is located |
|
|
Name of object |
ODCIObjectList
VARRAY(32) OF ODCIObject
Stores information about a list of schema objects.
ODCIPartInfo
Object type
Contains the names of both the table partition and the index partition.
Name | Datatype | Purpose |
---|---|---|
TablePartition |
|
Contains the table partition name |
IndexPartition |
|
Contains the index partition name |
ODCIQueryInfo
Object type
Stores information about the context of a query. It is passed as a parameter to the ODCIIndexStart
routine.
Name | Datatype | Purpose |
---|---|---|
|
|
The following flags can be set: |
|
|
Ancillary operators referenced in the query |
ODCIStatsOptions
Object type.
Stores options information for ANALYZE.
Name | Datatype | Purpose |
---|---|---|
Sample |
NUMBER |
Sample size |
Options |
NUMBER |
ANALYZE options - see "ODCICost" |
Flags |
NUMBER |
ANALYZE flags - see "ODCICost" |
ODCITabStats
NUMBER
Stores table statistics for a table function
Name | Datatype | Purpose |
---|---|---|
|
|
Number of rows in table |
ODCITableFunctionStats
Object type
Stores table function statistics
Name | Datatype | Purpose |
---|---|---|
|
|
Column statistics for a table function argument |
|
|
Table statistics for a table function argument |
A variety of PL/SQL mappings are common to both Extensible Indexing and the Extensible Optimizer.
ODCIConst
package found in catodci.sql
catodci.sql
Mappings of constants and types are defined for C in the public header file odci.h
. Each C structure to which a type is mapped has a corresponding indicator structure called structname_ind
and a reference definition called structname_ref
.
The ODCI (Oracle Data Cartridge Interface) interfaces are described in the Oracle9i Supplied Java Packages Reference., To use these classes, they must first be loaded. See Chapter 15 for loading instructions.
The following constants create or replace the ODCIConst IS
package.
To ensure that the database or packet state are not inadvertently corrupted, the following statement is always used with these methods to restrict reads and writes:
pragma restrict_references(ODCIConst, WNDS, RNDS, WNPS, RNPS);
Success CONSTANT INTEGER := 0; Error CONSTANT INTEGER := 1; Warning CONSTANT INTEGER := 2; ErrContinue CONSTANT INTEGER := 3; Fatal CONSTANT INTEGER := 4;
PredExactMatch CONSTANT INTEGER := 1; PredPrefixMatch CONSTANT INTEGER := 2; PredIncludeStart CONSTANT INTEGER := 4; PredIncludeStop CONSTANT INTEGER := 8; PredObjectFunc CONSTANT INTEGER := 16; PredObjectPkg CONSTANT INTEGER := 32; PredObjectType CONSTANT INTEGER := 64; PredMultiTable CONSTANT INTEGER := 128;
QueryFirstRows CONSTANT INTEGER := 1; QueryAllRows CONSTANT INTEGER := 2;
CleanupCall CONSTANT INTEGER := 1; RegularCall CONSTANT INTEGER := 2;
ObjectFunc CONSTANT INTEGER := 1; ObjectPkg CONSTANT INTEGER := 2; ObjectType CONSTANT INTEGER := 4;
ArgOther CONSTANT INTEGER := 1; ArgCol CONSTANT INTEGER := 2; ArgLit CONSTANT INTEGER := 3; ArgAttr CONSTANT INTEGER := 4; ArgNull CONSTANT INTEGER := 5;
PercentOption CONSTANT INTEGER := 1; RowOption CONSTANT INTEGER := 2;
EstimateStats CONSTANT INTEGER := 1; ComputeStats CONSTANT INTEGER := 2; Validate CONSTANT INTEGER := 4;
AlterIndexNone CONSTANT INTEGER := 0; AlterIndexRename CONSTANT INTEGER := 1; AlterIndexRebuild CONSTANT INTEGER := 2; AlterIndexUpdBlockRefs CONSTANT INTEGER := 5;
Local CONSTANT INTEGER := 1; RangePartn CONSTANT INTEGER := 2; Parallel CONSTANT INTEGER := 16; Unusable CONSTANT INTEGER := 32; IndexOnIOT CONSTANT INTEGER := 64; FunctionIdx CONSTANT INTEGER := 256;
None CONSTANT INTEGER := 0; FirstCall CONSTANT INTEGER := 1; IntermediateCall CONSTANT INTEGER := 2; FinalCall CONSTANT INTEGER := 3;
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|