The ACCESS* member functions are used to extract values of specified data types from ANYDATA. Each function returns a value of the corresponding data type.
Access functions can be based on SQL. These functions do not throw an exception when types do not match. Instead, if the type of ANYDATA does not correspond to the accessed type, NULL is returned. If you only want to return ANYDATA of the appropriate type in a query, use a WHERE clause that selects the type you are interested in using GETTYPENAME (for example, SYS.NUMBER).
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support it.
Syntax
MEMBER FUNCTION AccessNumber(self IN AnyData) return NUMBER DETERMINISTIC;
MEMBER FUNCTION AccessDate(self IN AnyData) return DATE DETERMINISTIC;
MEMBER FUNCTION AccessChar(self IN AnyData) return CHAR DETERMINISTIC;
MEMBER FUNCTION AccessVarchar(self IN AnyData) return VARCHAR DETERMINISTIC;
MEMBER FUNCTION AccessVarchar2(self IN AnyData) return VARCHAR2 DETERMINISTIC;
MEMBER FUNCTION AccessRaw(self IN AnyData) return RAW DETERMINISTIC;
MEMBER FUNCTION AccessBlob(self IN AnyData) return BLOB DETERMINISTIC;
MEMBER FUNCTION AccessClob(self IN AnyData) return CLOB DETERMINISTIC;
MEMBER FUNCTION AccessTimestamp(self IN AnyData) return TIMESTAMP_UNCONSTRAINED DETERMINISTIC;
MEMBER FUNCTION AccessTimestampTZ(self IN AnyData) return TIMESTAMP_TZ_UNCONSTRAINED DETERMINISTIC;
MEMBER FUNCTION AccessTimestampLTZ(self IN AnyData) return TIMESTAMP_LTZ_UNCONSTRAINED DETERMINISTIC;
MEMBER FUNCTION AccessIntervalYM(self IN AnyData) return YMINTERVAL_UNCONSTRAINED DETERMINISTIC;
MEMBER FUNCTION AccessIntervalDS(self IN AnyData) return DSINTERVAL_UNCONSTRAINED DETERMINISTIC;
MEMBER FUNCTION AccessNchar(self IN AnyData) return NCHAR DETERMINISTIC;
MEMBER FUNCTION AccessNVarchar2(self IN AnyData) return NVARCHAR2 DETERMINISTIC;
MEMBER FUNCTION AccessBFloat(self IN AnyData) return BINARY_FLOAT DETERMINISTIC;
MEMBER FUNCTION AccessBDouble(self IN AnyData) return BINARY_DOUBLE DETERMINISTIC;
MEMBER FUNCTION AccessURowid(self IN AnyData) return UROWID DETERMINISTIC;
Parameters
Parameter |
Description |
|---|---|
| self | OneANYDATA. |
Return value
Returns a value of the data type corresponding to the function being called, stored in ANYDATA. If the type of ANYDATA does not match the accessed type, NULL is returned without raising an exception.
Usage instructions
- The
ANYDATAtype must have been built before the call. CallingACCESS*onANYDATAthat is in the process of being built byBEGINCREATEwill result in an error. - Calling
ACCESS*onSELFofNULLwill result in an error.