@psr - Based on the discussion in the comments, I believe that you should be able to use code something like the following:
/// Method that will take in various arguments and return a BLOB as an output argument
ClassMethod GetBLOB(
arg1 As %String,
arg2 As %String,
...
Output blob As %Stream.TmpBinary) [ SqlProc ]
{
// Do work to produce your BLOB
Set blob = yourBLOB
Quit
}
Actual support for the BLOB may depend on your client software and whether you are using ODBC or JDBC, but anything reasonably recent should not pose any problems.
You would invoke this stored procedure using syntax like:
CALL Your_Schema.YourClass_GetBLOB('arg1','arg2',?)
The actual method for retrieving the BLOB will then depend on your client software and access method. You can also control the stored procedure name (i.e. the piece after the schema) by adding SqlName = MyGetBLOB
next to the SqlProc
keyword.