• Check out http://msdn.microsoft.com/en-us/library/windows/desktop/ms710963(v=vs.85).aspx

    In your code:

    retcode = SQLBindParameter(hStmtHandle,

    output_blobs_.cur_pos,

    SQL_PARAM_OUTPUT,

    SQL_WCHAR,

    SQL_WLONGVARCHAR,

    0,

    0,

    (SQLPOINTER)output_blobs_.cur_blob,

    0,

    (SQLINTEGER*)&size

    );

    I think the 2nd parameter should be 2 and not output_blobs_.cur_pos, because you are defining the 2nd parameter to the stored procedure. I'm gussing (hoping) that output_blobs_.cur_pos is pointing to some data area that you have allocated on the heap.

    The 2nd to last parameter shouldn't be 0, it should contain the size of the data area that you have allocated.

    I hope this helps!