Oracle® interMedia Reference 10g Release 1 (10.1) Part Number B10829-01 |
|
|
View PDF |
The ORDSource object type supports access to a variety of sources of multimedia data. It supports access to data sources locally in a BLOB within the database, externally from a BFILE on a local file system, externally from a URL on an HTTP server, or externally from a user-defined source on another server. This object type is defined as follows:
CREATE OR REPLACE TYPE ORDsource AS OBJECT ( -- ATTRIBUTES localData BLOB, srcType VARCHAR2(4000), srcLocation VARCHAR2(4000), srcName VARCHAR2(4000), updateTime DATE, local NUMBER, -- METHODS -- Methods associated with the local attribute MEMBER PROCEDURE setLocal, MEMBER PROCEDURE clearLocal, MEMBER FUNCTION isLocal RETURN BOOLEAN, PRAGMA RESTRICT_REFERENCES(isLocal, WNDS, WNPS, RNDS, RNPS), -- Methods associated with the updateTime attribute MEMBER FUNCTION getUpdateTime RETURN DATE, PRAGMA RESTRICT_REFERENCES(getUpdateTime, WNDS, WNPS, RNDS, RNPS), MEMBER PROCEDURE setUpdateTime(current_time DATE), -- Methods associated with the source information MEMBER PROCEDURE setSourceInformation( source_type IN VARCHAR2, source_location IN VARCHAR2, source_name IN VARCHAR2), MEMBER FUNCTION getSourceInformation RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getSourceInformation, WNDS, WNPS, RNDS, RNPS), MEMBER FUNCTION getSourceType RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getSourceType, WNDS, WNPS, RNDS, RNPS), MEMBER FUNCTION getSourceLocation RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getSourceLocation, WNDS, WNPS, RNDS, RNPS), MEMBER FUNCTION getSourceName RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getSourceName, WNDS, WNPS, RNDS, RNPS), MEMBER FUNCTION getBFile RETURN BFILE, PRAGMA RESTRICT_REFERENCES(getBFile, WNDS, WNPS, RNDS, RNPS), -- Methods associated with source import/export operations MEMBER PROCEDURE import( ctx IN OUT RAW, mimetype OUT VARCHAR2, format OUT VARCHAR2), MEMBER PROCEDURE importFrom( ctx IN OUT RAW, mimetype OUT VARCHAR2, format OUT VARCHAR2, source_type IN VARCHAR2, source_location IN VARCHAR2, source_name IN VARCHAR2), MEMBER PROCEDURE export( ctx IN OUT RAW, source_type IN VARCHAR2, source_location IN VARCHAR2, source_name IN VARCHAR2), -- Methods associated with source content-related operations MEMBER FUNCTION getContentLength(ctx IN OUT RAW) RETURN INTEGER, PRAGMA RESTRICT_REFERENCES(getContentLength, WNDS, WNPS, RNDS, RNPS), MEMBER FUNCTION getSourceAddress(ctx IN OUT RAW, userData IN VARCHAR2) RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getSourceAddress, WNDS, WNPS, RNDS, RNPS), MEMBER FUNCTION getLocalContent RETURN BLOB, PRAGMA RESTRICT_REFERENCES(geLocalContent, WNDS, WNPS, RNDS, RNPS), MEMBER PROCEDURE getContentInTempLob( ctx IN OUT RAW, tempLob IN OUT NOCOPY BLOB, mimetype OUT VARCHAR2, format OUT VARCHAR2, duration IN PLS_INTEGER := 10, cache IN BOOLEAN := TRUE), MEMBER PROCEDURE deleteLocalContent, -- Methods associated with source access methods MEMBER FUNCTION open(userArg IN RAW, ctx OUT RAW) RETURN INTEGER, MEMBER FUNCTION close(ctx IN OUT RAW) RETURN INTEGER, MEMBER FUNCTION trim(ctx IN OUT RAW, newlen IN INTEGER) RETURN INTEGER, -- Methods associated with content read/write operations MEMBER PROCEDURE read( ctx IN OUT RAW, startPos IN INTEGER, numBytes IN OUT INTEGER, buffer OUT RAW), MEMBER PROCEDURE write( ctx IN OUT RAW, startPos IN INTEGER, numBytes IN OUT INTEGER, buffer IN RAW), -- Methods associated with any commands to be sent to the external source MEMBER FUNCTION processCommand( ctx IN OUT RAW, command IN VARCHAR2, arglist IN VARCHAR2, result OUT RAW) RETURN RAW );
where:
localData: the locally stored multimedia data stored as a BLOB within the object. Up to 4 gigabytes of data can be stored as a BLOB within Oracle Database and is protected by the Oracle security and transaction environment.
srcType: the data source type. Supported values for srcType are:
srcType Value | Description |
---|---|
file | A BFILE on a local file system |
HTTP | An HTTP server |
<name> | User-defined |
Note: The srcType "file" value is a reserved word for the BFILE source plug-in provided by Oracle Corporation. To implement your own file plug-in, select a different name, for example, MYFILE.The srcType "HTTP" value is a reserved word for the HTTP source plug-in provided by Oracle Corporation. |
srcLocation: the place where data can be found based on the srcType value. Valid srcLocation values for corresponding srcType values are:
srcType | Location Value |
---|---|
file | <DIR> or name of the directory object |
HTTP | <SourceBase> or URL needed to find the base directory (without the string "http://" ) |
<name> | <iden> or identifier string required to access a user-defined source |
srcName: the data object name. Valid srcName values for corresponding srcType values are:
srcType | Name Value |
---|---|
file | <file> or name of the file |
HTTP | <Source> or name of the object |
<name> | <object name> or name of the object |
updateTime: the time at which the data was last updated.
local: a flag to determine whether or not the data is local:
1 means the data is in the BLOB.
0 means the data is in external sources.
NULL, which may be a default state when you first insert an empty row, is assumed to mean data is local.