Image | Audio | Video |
---|---|---|
X | X | X |
Returns or updates a comment that is stored with an image, audio, or video.
Include file
Syntax
Retrieve comment
>>-Comment--(--handle--)---------------------------------------><
Syntax
Update comment
>>-Comment--(--handle--,--new_comment--)-----------------------><
Parameters (data type)
Return values (data type)
For update, the handle of the image, audio, or video (DB2IMAGE, DB2AUDIO, or DB2VIDEO). For retrieval, the comment (LONG VARCHAR).
Examples
Get the file name of all images from the picture column of the employee table that have the word "confidential" in associated comments:
EXEC SQL BEGIN DECLARE SECTION; char hvImg_fname[255; EXEC SQL END DECLARE SECTION; EXEC SQL SELECT FILENAME(PICTURE) INTO :hvImg_fname FROM EMPLOYEE WHERE COMMENT(PICTURE) LIKE '%confidential%';
Update the comment that is associated with the Anita Jones's video clip in the video column of the employee table:
EXEC SQL BEGIN DECLARE SECTION; struct{ short len; char data[4000]; }hvRemarks; EXEC SQL END DECLARE SECTION; /* Get the old comment */ EXEC SQL SELECT COMMENT(VIDEO) INTO :hvRemarks FROM EMPLOYEE WHERE NAME = 'Anita Jones'; /* Update the comment */ hvRemarks.data[hvRemarks.len]='\0'; strcat (hvRemarks.data, "Updated video"); hvRemarks.len=strlen(hvRemarks.data); EXEC SQL UPDATE EMPLOYEE SET VIDEO=COMMENT(VIDEO, :hvRemarks) WHERE NAME = 'Anita Jones';