Oracle8i interMedia Audio, Image, and Video User's Guide and Reference Release 8.1.5 A67299-01 |
|
This appendix describes additional reference information presented elsewhere in this guide as part of the demo program. It describes the following:
Oracle8i interMedia makes use of the following object types in its demo program:
The ORDAnnotations object type supports the storage of annotation information.
This object type is defined in the following list:
CREATE OR REPLACE TYPE ORDAnnotations AS OBJECT ( -- TYPE ATTRIBUTES annotations ORDAnnotationList, -- METHOD DECLARATION MEMBER PROCEDURE setAnnotation(key IN VARCHAR2, value IN VARCHAR2), MEMBER FUNCTION getAnnotation(key IN VARCHAR2) RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getAnnotation, WNDS, WNPS, RNPS), MEMBER PROCEDURE deleteAnnotation(key IN VARCHAR2), MEMBER PROCEDURE appendToAnnotation(key IN VARCHAR2, value IN VARCHAR2), MEMBER FUNCTION getAnnotationCount RETURN INTEGER, PRAGMA RESTRICT_REFERENCES(getAnnotationCount, WNDS, WNPS, RNPS), MEMBER FUNCTION getAnnotationObjByPosition(pos IN INTEGER) RETURN ORDAnnotation, PRAGMA RESTRICT_REFERENCES(getAnnotationObjByPosition, WNDS, WNPS, RNPS), MEMBER FUNCTION getAnnotationKeyByPosition(pos IN INTEGER) RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getAnnotationKeyByPosition, WNDS, WNPS, RNPS), MEMBER FUNCTION getAnnotationValueByPosition(pos IN INTEGER) RETURN VARCHAR2, PRAGMA RESTRICT_REFERENCES(getAnnotationValueByPosition, WNDS, WNPS, RNPS),
);
where:
This section presents reference information on the methods used for annotation manipulation.
The ORDAnnotations methods are described as follows:
This section presents reference information on the ORDAnnotations methods associated with the annotations attribute.
The methods described in this reference chapter show examples based on a TANNOT table. Refer to the TANNOT table definition that follows when reading through the examples in this chapter:
CREATE TABLE TANNOT(n NUMBER, a ORDSYS.ORDAnnotations) storage (initial 100K next 100K pctincrease 0), nested table a.annotations store as base_annot; INSERT INTO TANNOT VALUES(1, ORDSYS.ORDAnnotations(NULL));
setAnnotation(key IN VARCHAR2, value IN VARCHAR2);
Creates or alters the values for the key and value fields for the ORDAnnotation object.
The value of the key field for the ORDAnnotation object.
The value of the value field for the ORDAnnotation object.
none
none
none
none
getAnnotation(key IN VARCHAR2) RETURN VARCHAR2;
Returns the value of the value field for the ORDAnnotation object based on the value of the key field.
The value of the key field for the ORDAnnotation object.
none
Pragma RESTRICT_REFERENCES(getAnnotation, WNDS, WNPS, RNPS)
If the key cannot be found based on its value, then calling this method raises a KEY_NOT_FOUND exception.
If the value of the annotations attribute is empty (NULL), then calling this method raises a NULL_ANNOTATION_LIST exception.
Return the value of the key and value fields for the first ORDAnnotation object in the ORDAnnotationList table of the ORDAnnotations object:
DECLARE mya ORDSYS.ORDAnnotations; BEGIN SELECT T.a INTO mya FROM TANNOT T WHERE N = 1; DBMS_OUTPUT.PUT_LINE('Annotation for key: '||mya.getAnnotation('key')); DBMS_OUTPUT.PUT_LINE('Annotation for value:'||mya.getAnnotation('note1')); EXCEPTION WHEN ORDSYS.ORDAnnotationsExceptions.KEY_NOT_FOUND THEN DBMS_OUTPUT.PUT_LINE('key does not exist in annotations'); END;
deleteAnnotation(key IN VARCHAR2);
Deletes the ORDAnnotation object based on the value of its key field.
The value of the key field for the ORDAnnotation object.
none
none
If the key cannot be found based on its value, then calling this method raises a KEY_NOT_FOUND exception.
none
appendToAnnotation(key IN VARCHAR2, value IN VARCHAR2);
Appends the specified values for the key and value fields to the ORDAnnotation object's current values.
The appended value of the key field for the ORDAnnotation object.
The appended value of the value field for the ORDAnnotation object.
none
none
If the key cannot be found based on its value, then calling this method raises a KEY_NOT_FOUND exception.
If the value of the annotations attribute is empty (NULL), then calling this method raises a NULL_ANNOTATION_LIST exception.
none
getAnnotationCount RETURN INTEGER;
Returns the number of ORDAnnotation objects in the ORDAnnotationList table.
none
none
Pragma RESTRICT_REFERENCES(getAnnotationCount, WNDS, WNPS, RNPS)
none
Return the ORDAnnotation object count:
DECLARE mya ORDSYS.ORDAnnotations; BEGIN SELECT T.a INTO mya FROM TANNOT T WHERE N = 1; DBMS_OUTPUT.PUT_LINE(TO_CHAR(mya.getAnnotationCount)); END;
getAnnotationObjByPosition(pos IN INTEGER) RETURN ORDAnnotation;
Returns the ORDAnnotation object by its position in the ORDAnnotationList table.
The ORDAnnotation object's position in the ORDAnnotationList table.
none
Pragma RESTRICT_REFERENCES(getAnnotationObjByPosition, WNDS, WNPS, RNPS)
If the value of pos is greater than the number of ORDAnnotation objects in the ORDAnnotationList table, then calling this method raises a POSITION_OUT_OF_RANGE exception.
Return the ORDAnnotation object by its position in the ORDAnnotationList table:
DECLARE mya ORDSYS.ORDAnnotations; obj ORDSYS.ORDAnnotation; n INTEGER; BEGIN SELECT T.a INTO mya FROM TANNOT T WHERE N = 1; n := mya.getAnnotationCount; FOR i in 1..n LOOP obj := mya.getAnnotationObjByPosition(i); DBMS_OUTPUT.PUT_LINE('Key '||TO_CHAR(i)||':'||obj.key); DBMS_OUTPUT.PUT_LINE('Value: '||obj.value); DBMS_OUTPUT.PUT_LINE('---------------------------------------'); END LOOP; END;
getAnnotationKeyByPosition(pos IN INTEGER) RETURN VARCHAR2;
Returns the value of the key field by the ORDAnnotation object's position in the ORDAnnotationList table.
The ORDAnnotation object's position in the ORDAnnotationList table.
none
Pragma RESTRICT_REFERENCES(getAnnotationKeyByPosition, WNDS, WNPS, RNPS)
If the value of pos is greater than the number of ORDAnnotation objects in the ORDAnnotationList table, then calling this method raises a POSITION_OUT_OF_RANGE exception.
Return the value of the key field by the ORDAnnotation object's position in the ORDAnnotationList table:
DECLARE mya ORDSYS.ORDAnnotations; n INTEGER; BEGIN SELECT T.a INTO mya FROM TANNOT T WHERE N = 1; n := mya.getAnnotationCount; FOR i in 1..n LOOP DBMS_OUTPUT.PUT_LINE('Key '||TO_CHAR(i)||':'||mya.getAnnotationKeyByPosition( i)); DBMS_OUTPUT.PUT_LINE('Value: '||mya.getAnnotationValueByPosition(i)); DBMS_OUTPUT.PUT_LINE('---------------------------------------'); END LOOP; END;
getAnnotationValueByPosition(pos IN INTEGER) RETURN VARCHAR2;
Returns the value of the value field by the ORDAnnotation object's position in the ORDAnnotationList table.
The ORDAnnotation object's position in the ORDAnnotationList table.
none
Pragma RESTRICT_REFERENCES(getAnnotationValueByPosition, WNDS, WNPS, RNPS)
If the value of pos is greater than the number of ORDAnnotation objects in the ORDAnnotationList table, then calling this method raises a POSITION_OUT_OF_RANGE exception.
Return the value of the value field by the ORDAnnotation object's position in the ORDAnnotationList table:
DECLARE mya ORDSYS.ORDAnnotations; n INTEGER; BEGIN SELECT T.a INTO mya FROM TANNOT T WHERE N = 1; n := mya.getAnnotationCount; FOR i in 1..n LOOP DBMS_OUTPUT.PUT_LINE('Key '||TO_CHAR(i)||':'||mya.getAnnotationKeyByPosition( i)); DBMS_OUTPUT.PUT_LINE('Value: '||mya.getAnnotationValueByPosition(i)); DBMS_OUTPUT.PUT_LINE('---------------------------------------'); END LOOP; END;