Oracle 8i Data Cartridge Developer's Guide
Release 2 (8.1.6)

Part Number A76937-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Reference: Extensibility Constants, Types, & Mappings, 2 of 2


Extensibility Constants, Types, & Mappings

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.

System Defined Constants

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.

Alter Options Values

ODCIArgDesc.ArgType Bits

ODCIPredInfo.Flag Bits

ODCIFuncInfo.Flags Bits

ODCIQueryInfo.Flags Bits

ODCIStatsOptions.Flags Bits

ODCIStatsOptions.Options Bits

ScnFlg (Function with Index Context) Values

Status Values

System Defined Types

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 odci.h The ODCIIndex routines use these types as parameters, and ODCIStats described in Chapters 16 and 17.

Unless otherwise mentioned, the names parsed as type attributes are unquoted identifiers.

ODCIArgDesc

Name

ODCIArgDesc 

Datatype

Object type.

Purpose

Stores function/operator arguments.

Table 15-1 Function/Operator Argument Description -- Attributes
Name  Datatype  Purpose 
ArgType
 
NUMBER
 

Argument type - see "ODCICost" 

TableName
 
VARCHAR2(30)
 

Name of table 

TableSchema
 
VARCHAR2(30)
 

Schema containing the table 

ColName
 
VARCHAR2(4000)
 

Name of column. This could be top level column name such as "A", or a nested column "A"."B" Note that the column name are quoted identifiers. 

ODCIArgDescList

Name

ODCIArgDesc 

Datatype

VARRAY(32767) of ODCIArgDesc

Purpose

Lists descriptions of arguments.

ODCIRidList

Name

ODCIRidList 

Datatype

VARRAY(32767) OF VARCHAR2("M_URID_SZ")

Purpose

Stores list of rowids. The rowids are stored in their character format.

ODCIColInfo

Name

ODCIColInfo 

Datatype

Object type.

Purpose

Stores information related column.

Table 15-2 Column Related Information -- Attributes
Name  Datatype  Purpose 
TableSchema
 
VARCHAR2(30)
 

Schema containing table 

TableName
 
VARCHAR2(30)
 

Name of table 

ColName
 
VARCHAR2(4000)
 

Name of column. This could be top level column name such as "A", or a nested column "A"."B" Note that the column name are quoted identifiers. 

ColTypeName
 
VARCHAR2(30)
 

Datatype of column 

ColTypeSchema
 
VARCHAR2(30)
 

Schema containing datatype if user-defined datatype 

ODCIColInfoList

Name

ODCIColInfoList 

Datatype

VARRAY(32) OF ODCIColInfo

Purpose

Stores information related to a list of columns.

ODCICost

Name

ODCICost 

Datatype

Object type.

Purpose

Stores cost information.

Table 15-3 Cost Information -- Attributes
Name  Datatype  Purpose 
CPUCost
 
NUMBER
 

CPU cost 

IOCost
 
NUMBER
 

I/O cost 

NetworkCost
 
NUMBER
 

Communication cost 

ODCIFuncInfo

Name

ODCIFuncInfo 

Datatype

Object type.

Purpose

Stores function information.

Table 15-4 Function Information -- Attributes
Name  Datatype  Purpose 
ObjectSchema
 
VARCHAR2(30)
 

Object schema name 

ObjectName
 
VARCHAR2(30)
 

Function/package/type name 

MethodName
 
VARCHAR2(30)
 

Method name for package/type 

Flags
 
NUMBER
 

Function flags - see ODCIConst 

ODCIIndexInfo

Name

ODCIIndexInfo 

Datatype

Object type

Purpose

Stores the metadata information related to a domain index. It is passed as a parameter to all ODCIIndex routines.

Table 15-5 Index Related Information -- Attributes  
Name  Datatype  Purpose 
IndexSchema
 
VARCHAR2(30)
 

Schema containing domain index 

IndexName
 
VARCHAR2(30)
 

Name of domain index 

IndexCols
 
ODCIColInfoList
 

List of indexed columns 

ODCIPredInfo

Name

ODCIPredInfo 

Datatype

Object type

Purpose

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.

Table 15-6 Operator Related Information -- Attributes  
Name  Datatype  Purpose 
ObjectSchema
 
VARCHAR2(30)
 

Schema of operator/function 

ObjectName
 
VARCHAR2(30)
 

Name of operator/function 

MethodName
 
VARCHAR2(30)
 

Name of method, applies only to package methods type 

Flags
 
NUMBER
 

The possible flags that could be set are:

PredExactMatch - Exact Match

PredPrefixMatch - Prefix Match

PredIncludeStart - Bounds include the start key value

PredIncludeStop - Bounds include the stop key value

PredObjectFunc - Object is a function

PredObjectPlg - Object is a package

PredObjectType - Object is a type 

ODCIIndexCtx

Name

ODCIIndexCtx 

Datatype

Object type

Purpose

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.

Table 15-7 Index Context Related Information -- Attributes
Name  Datatype  Purpose 
IndexInfo
 
ODCIIndexInfo
 

Stores the metadata information about the domain index 

rid
 
VARCHAR2("M_URID_
SZ")
 

Row identifier of the current row 

ODCIObject

Name

ODCIObject 

Datatype

Object type

Purpose

Stores information about a schema object.

Table 15-8 Index Context Related Information -- Attributes
Name  Datatype  Purpose 
ObjectSchema
 
VARCHAR2(30)
 

Name of schema in which object is located 

ObjectName
 
VARCHAR2(30)
 

Name of object 

ODCIObjectList

Name

ODCIObjectList 

Datatype

VARRAY(32) OF ODCIObject 

Purpose

Stores information about a list of schema objects.

ODCIQueryInfo

Name

ODCIQueryInfo 

Datatype

Object type

Purpose

Stores information about the context of a query. It is passed as a parameter to the ODCIIndexStart routine.

Table 15-9 Index Context Related Information -- Attributes
Name  Datatype  Purpose 
Flags
 
NUMBER
 

The following flags can be set:

QueryFirstRows --'FIRST_ROWS' specified in the query

QueryAllRows --'ALL_ROWS' specified in the query 

AncOps
 
ODCIObjectList
 

Ancillary operators referenced in the query 

ODCIStatsOptions

Name

ODCIStatsOptions 

Datatype

Object type.

Purpose

Stores options information for ANALYZE.

Table 15-10 Cost Information -- Attributes
Name  Datatype  Purpose 
Sample
 
NUMBER
 

Sample size 

Options
 
NUMBER
 

ANALYZE options - see "ODCICost" 

Flags
 
NUMBER
 

ANALYZE flags - see "ODCICost" 

Mappings in PL/SQL

A variety of PL/SQL mappings are common to both Extensible Indexing and the Extensible Optimizer.

Mappings in C

Mappings for C are defined in the public header file odci.h

C Constants

Constants for C are defined as macros in odci.h.

Table 15-11 C Constants
Category  Macro  Integer 

Return Status 

odci_success 

 

odci_error 

 

odci_warning 

ODCIPredInfo.Flags 

PredExactMatch  

 

PredPrefixMatch  

 

PredIncludeStart 

 

PredIncludeStop  

 

PredObjectFunc  

16 

 

PredObjectPkg 

32 

 

PredObjectType 

64 

ODCIQueryInfo.Flags 

QueryFirstRows 

 

QueryAllRows 

 

QuerySortAsc 

 

QuerySortDes 

 

QueryBlocking 

16 

ScnFlg 

CleanupCall 

 

RegularCall  

ODCIFuncInfo.Flags 

ObjectFunc  

 

ObjectPkg  

 

ObjectType  

ODCIArgDesc.ArgType 

ArgOther  

 

ArgCol 

 

ArgLit 

 

ArgAttr 

 

ArgNull 

ODCIStatsOptions.Options 

PercentOption 

 

RowOption 

ODCIStatsOptions.Flags 

EstimateStats  

 

ComputeStats 

 

Validate 

ODCIIndexAlter parameter alter_option 

AlterIndexNone 

 

AlterIndexRename  

C Types

Structures are defined in odci.h. Note that each structure has a corresponding indicator structure called structname_ind, and a reference definition called structname_ref.

Table 15-12 C Types
Description  Structure Name  Indicator Structure  Reference 

Column Information 

ODCIColInfo 

ODCIColInfo_ind 

ODCIColInfo_ref 

Index Information 

ODCIIndexInfo 

ODCIIndexInfo_ind 

ODCIIndexInfo_ref 

Predicate (User-defined operator or function) Information 

ODCIPredInfo 

ODCIPredInfo_ind 

ODCIPredInfo_ref 

Row ID List 

ODCIRidList 

ODCIRidList_ind 

ODCIRidList_ref 

Index Context 

ODCIIndexCtx 

ODCIIndexCtx_ind 

ODCIIndexCtx_ref 

Schema Object 

ODCIObject 

ODCIObject_ind 

ODCIObject_ref 

Query Information 

ODCIQueryInfo 

ODCIQueryInfo_ind 

ODCIQueryInfo_ref 

Function 

ODCIFuncInfo 

ODCIFuncInfo_ind 

ODCIFuncInfo_ref 

Cost 

ODCICost 

ODCICost_ind 

ODCICost_ref 

Argument Descriptions 

ODCIArgDesc 

ODCIArgDesc_ind 

ODCIArgDesc_ref 

Options for ANALYZE 

ODCIStatsOptions 

ODCIStatsOptions_ind 

ODCIStatsOptions_ref 

Constants Definitions

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);

Constants for Return Status

     Success          CONSTANT INTEGER  :=  0;
     Error            CONSTANT INTEGER  :=  1;
     Warning          CONSTANT INTEGER  :=  2;

Constants for ODCIPredInfo.Flags

     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;

Constants for ODCIQueryInfo.Flags

     QueryFirstRows   CONSTANT INTEGER  :=  1;
     QueryAllRows     CONSTANT INTEGER  :=  2;
     QuerySortAsc     CONSTANT INTEGER  :=  4;
     QuerySortDesc    CONSTANT INTEGER  :=  8;
     QueryBlocking    CONSTANT INTEGER  := 16;

Constants for ScnFlg (Func with Index Context)

     CleanupCall      CONSTANT INTEGER  :=  1;
     RegularCall      CONSTANT INTEGER  :=  2;

Constants for ODCIFuncInfo.Flags

     ObjectFunc       CONSTANT INTEGER  :=  1;
     ObjectPkg        CONSTANT INTEGER  :=  2;
     ObjectType       CONSTANT INTEGER  :=  4;

Constants for ODCIArgDesc.ArgType

     ArgOther         CONSTANT INTEGER  :=  1;
     ArgCol           CONSTANT INTEGER  :=  2;
     ArgLit           CONSTANT INTEGER  :=  3;
     ArgAttr          CONSTANT INTEGER  :=  4;
     ArgNull          CONSTANT INTEGER  :=  5;

Constants for ODCIStatsOptions.Options

     PercentOption    CONSTANT INTEGER  :=  1;
     RowOption        CONSTANT INTEGER  :=  2;

Constants for ODCIStatsOptions.Flags

     EstimateStats    CONSTANT INTEGER  :=  1;
     ComputeStats     CONSTANT INTEGER  :=  2;
     Validate         CONSTANT INTEGER  :=  4;

Constants for ODCIIndexAlter parameter alter_option

     AlterIndexNone           CONSTANT INTEGER  :=  0;
     AlterIndexRename         CONSTANT INTEGER  :=  1;
     AlterIndexRebuild        CONSTANT INTEGER  :=  2;
     

Mappings in Java

The ODCI (Oracle Data Cartridge Interface) interfaces are described in the Oracle8i Supplied Java Packages Reference., To use these classes, they must first be loaded. See Chapter 14 for loading instructions.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index