Use the Comment UDF to retrieve comments that are stored with an image, audio, or video object. When you retrieve a comment for an object, you specify the column in the database table that contains the object's handle. For example, the following statement retrieves a comment that is stored with an audio clip in the employee table.
EXEC SQL BEGIN DECLARE SECTION; struct { short len; char data[32700]; }hvComment EXEC SQL END DECLARE SECTION; EXEC SQL SELECT COMMENT(SOUND) INTO :hvComment FROM EMPLOYEE WHERE NAME = 'Anita Jones';
You can also use the Comment UDF as a predicate in the WHERE clause of an SQL query. For example, the following statement retrieves the file name of all images in the employee table that have been noted as "touched up".
EXEC SQL BEGIN DECLARE SECTION; struct { short len; char data[250]; }hvImg_fname EXEC SQL END DECLARE SECTION; EXEC SQL SELECT FILENAME(PICTURE) INTO :hvImg_fname FROM EMPLOYEE WHERE COMMENT(PICTURE) LIKE '%touch%up';