Oracle9i Data Cartridge Developer's Guide Release 1 (9.0.1) Part Number A88896-01 |
|
This chapter describes the routines that need to be implemented to define pipelined and parallel table functions in C.
STATIC FUNCTION ODCITableStart(sctx OUT <imptype>, <args>) RETURN NUMBER
ODCITableStart
initializes the scan of a table function.
ODCIConst.Success
on success, ODCIConst.Error
otherwise.
sctx
) and returned to Oracle. The arguments to the table function, specified by the user in the SELECT
statement, are passed in as parameters to this routine.
REF CURSOR
arguments of the table function must be declared as SYS_REFCURSOR
type in the declaration of the ODCITableStart
method.
MEMBER FUNCTION ODCITableFetch(self IN OUT <imptype>, nrows IN NUMBER, rws OUT <coll-type>) RETURN NUMBER
ODCITableFetch returns the next batch of rows from a table function.
ODCIConst.Success
on success, ODCIConst.Error
otherwise.
ODCITableFetch
is invoked one or more times by Oracle to retrieve all the rows in the collection returned by the table function. The scan context is passed in as a parameter. Typically ODCITableFetch
uses the input scan context and computes the next set of rows to be returned to Oracle. In addition, it may update the scan context accordingly.
Returning more rows in each invocation of fetch()
reduces the number of fetch calls that need to be made and thus improves performance.
Oracle calls ODCITableFetch
repeatedly until all rows in the table function's collection have been returned. When all rows have been returned, ODCITableFetch
should return a null collection.
MEMBER FUNCTION ODCITableClose(self IN <imptype>) RETURN NUMBER
ODCITableClose performs cleanup operations after scanning a table function.
Parameter | Meaning |
---|---|
self (IN) |
The scan context set up by previous scan routine invocation |
ODCIConst.Success
on success, ODCIConst.Error
otherwise.
Oracle invokes ODCITableClose after the last fetch call. The scan context is passed in as a parameter. ODCITableClose then performs any necessary cleanup operations, such as freeing memory.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|