You can display or play an object stored in a database table as a BLOB or whose content is stored in a file (and pointed to from the database table). If the object is stored as a BLOB, specify MMDB_PLAY_HANDLE. If the object content is stored in a file, specify MMDB_PLAY_FILE. MMDB_PLAY_HANDLE and MMDB_PLAY_FILE are constants that are defined by the extenders.
For example, the following statement in a C application program plays a video whose content is in a file:
rc = DBvPlay( "explore %s", MMDB_PLAY_FILE, /* content in file */ "/employee/videos/ajones.mpg", MMDB_PLAY_NO_WAIT );
Display and play programs typically accept input from a file. If you specify MMDB_PLAY_FILE, the extender will using the value in environment variables to resolve the file's relative file name and path. The extender then starts the browse program and passes it the file name. If you specify MMDB_PLAY_HANDLE, the extender extracts the file name from the handle (provided that the file name is not null). If the file name in the handle is null, the object is stored as a BLOB. The extender will create a temporary file in the client and copy the content of the object from the database table to the client file. The extender will then start the program and pass it the name of the file (or temporary file) that holds the content.
For example, the following statements in a C application program get the handle of an image stored as a BLOB and use the handle to display the image:
EXEC SQL BEGIN DECLARE SECTION; char hvImg_hdl[251]; EXEC SQL END DECLARE SECTION; rc = DBiBrowse( "ib %s", MMDB_PLAY_HANDLE, /* content is BLOB */ hvImg_hdl, MMDB_PLAY_NO_WAIT );
The content must be accessible: Make sure that the display or play program can access the object content. If the content is in a server file, but the program requires the content on the client, copy the file to a client file or use the Content UDF. If the content is stored as a BLOB, the extender will automatically retrieve it to the client.